openplanr 1.25.3 → 2.0.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 +70 -0
- package/CONTRIBUTING.md +33 -0
- package/README.md +154 -131
- package/dist/cli/commands/artifact.d.ts.map +1 -1
- package/dist/cli/commands/artifact.js +214 -30
- package/dist/cli/commands/artifact.js.map +1 -1
- package/dist/cli/commands/backlog.d.ts +1 -21
- package/dist/cli/commands/backlog.d.ts.map +1 -1
- package/dist/cli/commands/backlog.js +1 -428
- package/dist/cli/commands/backlog.js.map +1 -1
- package/dist/cli/commands/company.d.ts +3 -0
- package/dist/cli/commands/company.d.ts.map +1 -0
- package/dist/cli/commands/company.js +173 -0
- package/dist/cli/commands/company.js.map +1 -0
- package/dist/cli/commands/config-deterministic.d.ts +3 -0
- package/dist/cli/commands/config-deterministic.d.ts.map +1 -0
- package/dist/cli/commands/config-deterministic.js +88 -0
- package/dist/cli/commands/config-deterministic.js.map +1 -0
- package/dist/cli/commands/dashboard.d.ts +3 -0
- package/dist/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.js +36 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/diagram/index.d.ts +3 -0
- package/dist/cli/commands/diagram/index.d.ts.map +1 -0
- package/dist/cli/commands/diagram/index.js +73 -0
- package/dist/cli/commands/diagram/index.js.map +1 -0
- package/dist/cli/commands/diagram/presentation.d.ts +4 -0
- package/dist/cli/commands/diagram/presentation.d.ts.map +1 -0
- package/dist/cli/commands/diagram/presentation.js +38 -0
- package/dist/cli/commands/diagram/presentation.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +1 -11
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/epic.d.ts +1 -9
- package/dist/cli/commands/epic.d.ts.map +1 -1
- package/dist/cli/commands/epic.js +1 -259
- package/dist/cli/commands/epic.js.map +1 -1
- package/dist/cli/commands/feature.d.ts +1 -8
- package/dist/cli/commands/feature.d.ts.map +1 -1
- package/dist/cli/commands/feature.js +1 -220
- package/dist/cli/commands/feature.js.map +1 -1
- package/dist/cli/commands/groups/delivery.d.ts +3 -0
- package/dist/cli/commands/groups/delivery.d.ts.map +1 -0
- package/dist/cli/commands/groups/delivery.js +13 -0
- package/dist/cli/commands/groups/delivery.js.map +1 -0
- package/dist/cli/commands/groups/foundation.d.ts +3 -0
- package/dist/cli/commands/groups/foundation.d.ts.map +1 -0
- package/dist/cli/commands/groups/foundation.js +11 -0
- package/dist/cli/commands/groups/foundation.js.map +1 -0
- package/dist/cli/commands/groups/intelligence.d.ts +3 -0
- package/dist/cli/commands/groups/intelligence.d.ts.map +1 -0
- package/dist/cli/commands/groups/intelligence.js +19 -0
- package/dist/cli/commands/groups/intelligence.js.map +1 -0
- package/dist/cli/commands/groups/operations.d.ts +3 -0
- package/dist/cli/commands/groups/operations.d.ts.map +1 -0
- package/dist/cli/commands/groups/operations.js +17 -0
- package/dist/cli/commands/groups/operations.js.map +1 -0
- package/dist/cli/commands/groups/planning.d.ts +3 -0
- package/dist/cli/commands/groups/planning.d.ts.map +1 -0
- package/dist/cli/commands/groups/planning.js +25 -0
- package/dist/cli/commands/groups/planning.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +14 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init-deterministic.d.ts +3 -0
- package/dist/cli/commands/init-deterministic.d.ts.map +1 -0
- package/dist/cli/commands/init-deterministic.js +40 -0
- package/dist/cli/commands/init-deterministic.js.map +1 -0
- package/dist/cli/commands/land.d.ts +15 -0
- package/dist/cli/commands/land.d.ts.map +1 -0
- package/dist/cli/commands/land.js +176 -0
- package/dist/cli/commands/land.js.map +1 -0
- package/dist/cli/commands/operate/input.d.ts +54 -0
- package/dist/cli/commands/operate/input.d.ts.map +1 -0
- package/dist/cli/commands/operate/input.js +98 -0
- package/dist/cli/commands/operate/input.js.map +1 -0
- package/dist/cli/commands/operate/registrars/assignments.d.ts +5 -0
- package/dist/cli/commands/operate/registrars/assignments.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/assignments.js +167 -0
- package/dist/cli/commands/operate/registrars/assignments.js.map +1 -0
- package/dist/cli/commands/operate/registrars/catalog.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/catalog.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/catalog.js +12 -0
- package/dist/cli/commands/operate/registrars/catalog.js.map +1 -0
- package/dist/cli/commands/operate/registrars/contracts.d.ts +41 -0
- package/dist/cli/commands/operate/registrars/contracts.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/contracts.js +2 -0
- package/dist/cli/commands/operate/registrars/contracts.js.map +1 -0
- package/dist/cli/commands/operate/registrars/dashboard.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/dashboard.js +26 -0
- package/dist/cli/commands/operate/registrars/dashboard.js.map +1 -0
- package/dist/cli/commands/operate/registrars/dispatch.d.ts +7 -0
- package/dist/cli/commands/operate/registrars/dispatch.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/dispatch.js +55 -0
- package/dist/cli/commands/operate/registrars/dispatch.js.map +1 -0
- package/dist/cli/commands/operate/registrars/experience.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/experience.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/experience.js +93 -0
- package/dist/cli/commands/operate/registrars/experience.js.map +1 -0
- package/dist/cli/commands/operate/registrars/index.d.ts +5 -0
- package/dist/cli/commands/operate/registrars/index.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/index.js +28 -0
- package/dist/cli/commands/operate/registrars/index.js.map +1 -0
- package/dist/cli/commands/operate/registrars/lifecycle.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/lifecycle.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/lifecycle.js +46 -0
- package/dist/cli/commands/operate/registrars/lifecycle.js.map +1 -0
- package/dist/cli/commands/operate/registrars/measurement.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/measurement.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/measurement.js +122 -0
- package/dist/cli/commands/operate/registrars/measurement.js.map +1 -0
- package/dist/cli/commands/operate/registrars/note-validation.d.ts +6 -0
- package/dist/cli/commands/operate/registrars/note-validation.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/note-validation.js +103 -0
- package/dist/cli/commands/operate/registrars/note-validation.js.map +1 -0
- package/dist/cli/commands/operate/registrars/planning.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/planning.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/planning.js +41 -0
- package/dist/cli/commands/operate/registrars/planning.js.map +1 -0
- package/dist/cli/commands/operate/registrars/recovery.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/recovery.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/recovery.js +65 -0
- package/dist/cli/commands/operate/registrars/recovery.js.map +1 -0
- package/dist/cli/commands/operate/registrars/reviews.d.ts +4 -0
- package/dist/cli/commands/operate/registrars/reviews.d.ts.map +1 -0
- package/dist/cli/commands/operate/registrars/reviews.js +83 -0
- package/dist/cli/commands/operate/registrars/reviews.js.map +1 -0
- package/dist/cli/commands/operate/registration.d.ts +4 -0
- package/dist/cli/commands/operate/registration.d.ts.map +1 -0
- package/dist/cli/commands/operate/registration.js +3 -0
- package/dist/cli/commands/operate/registration.js.map +1 -0
- package/dist/cli/commands/operate/render.d.ts +19 -0
- package/dist/cli/commands/operate/render.d.ts.map +1 -0
- package/dist/cli/commands/operate/render.js +201 -0
- package/dist/cli/commands/operate/render.js.map +1 -0
- package/dist/cli/commands/operate.d.ts +58 -13
- package/dist/cli/commands/operate.d.ts.map +1 -1
- package/dist/cli/commands/operate.js +169 -984
- package/dist/cli/commands/operate.js.map +1 -1
- package/dist/cli/commands/planning-artifacts.d.ts +10 -0
- package/dist/cli/commands/planning-artifacts.d.ts.map +1 -0
- package/dist/cli/commands/planning-artifacts.js +350 -0
- package/dist/cli/commands/planning-artifacts.js.map +1 -0
- package/dist/cli/commands/quick/interaction.d.ts +8 -0
- package/dist/cli/commands/quick/interaction.d.ts.map +1 -0
- package/dist/cli/commands/quick/interaction.js +8 -0
- package/dist/cli/commands/quick/interaction.js.map +1 -0
- package/dist/cli/commands/quick/project.d.ts +8 -0
- package/dist/cli/commands/quick/project.d.ts.map +1 -0
- package/dist/cli/commands/quick/project.js +8 -0
- package/dist/cli/commands/quick/project.js.map +1 -0
- package/dist/cli/commands/quick.d.ts +1 -29
- package/dist/cli/commands/quick.d.ts.map +1 -1
- package/dist/cli/commands/quick.js +1 -337
- package/dist/cli/commands/quick.js.map +1 -1
- package/dist/cli/commands/rules.js +1 -1
- package/dist/cli/commands/rules.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +40 -18
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/spec.d.ts +6 -4
- package/dist/cli/commands/spec.d.ts.map +1 -1
- package/dist/cli/commands/spec.js +166 -174
- package/dist/cli/commands/spec.js.map +1 -1
- package/dist/cli/commands/sprint.d.ts +1 -8
- package/dist/cli/commands/sprint.d.ts.map +1 -1
- package/dist/cli/commands/sprint.js +1 -522
- package/dist/cli/commands/sprint.js.map +1 -1
- package/dist/cli/commands/story/interaction.d.ts +7 -0
- package/dist/cli/commands/story/interaction.d.ts.map +1 -0
- package/dist/cli/commands/story/interaction.js +7 -0
- package/dist/cli/commands/story/interaction.js.map +1 -0
- package/dist/cli/commands/story/project.d.ts +10 -0
- package/dist/cli/commands/story/project.d.ts.map +1 -0
- package/dist/cli/commands/story/project.js +10 -0
- package/dist/cli/commands/story/project.js.map +1 -0
- package/dist/cli/commands/story.d.ts +1 -8
- package/dist/cli/commands/story.d.ts.map +1 -1
- package/dist/cli/commands/story.js +1 -358
- package/dist/cli/commands/story.js.map +1 -1
- package/dist/cli/commands/task.d.ts +1 -9
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +1 -351
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/error-boundary.d.ts +29 -0
- package/dist/cli/error-boundary.d.ts.map +1 -0
- package/dist/cli/error-boundary.js +103 -0
- package/dist/cli/error-boundary.js.map +1 -0
- package/dist/cli/helpers/bulk-checkbox-update.d.ts +1 -1
- package/dist/cli/helpers/bulk-checkbox-update.js +1 -1
- package/dist/cli/index.js +38 -113
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +68 -0
- package/dist/dashboard/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/dashboard/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/dashboard/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/dashboard/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/dist/dashboard/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/dashboard/assets/index-Bk8DyO_2.css +1 -0
- package/dist/dashboard/assets/index-zeygL5iu.js +557 -0
- package/dist/dashboard/assets/index-zeygL5iu.js.map +1 -0
- package/dist/dashboard/dashboard-manifest.json +84 -0
- package/dist/dashboard/index.html +13 -0
- package/dist/generators/base-generator.d.ts +2 -0
- package/dist/generators/base-generator.d.ts.map +1 -1
- package/dist/generators/base-generator.js +8 -0
- package/dist/generators/base-generator.js.map +1 -1
- package/dist/generators/claude-generator.d.ts.map +1 -1
- package/dist/generators/claude-generator.js +12 -14
- package/dist/generators/claude-generator.js.map +1 -1
- package/dist/generators/codex-generator.d.ts.map +1 -1
- package/dist/generators/codex-generator.js +7 -7
- package/dist/generators/codex-generator.js.map +1 -1
- package/dist/generators/cursor-generator.d.ts.map +1 -1
- package/dist/generators/cursor-generator.js +11 -30
- package/dist/generators/cursor-generator.js.map +1 -1
- package/dist/models/schema.d.ts +0 -23
- package/dist/models/schema.d.ts.map +1 -1
- package/dist/models/schema.js +0 -7
- package/dist/models/schema.js.map +1 -1
- package/dist/models/types.d.ts +3 -14
- package/dist/models/types.d.ts.map +1 -1
- package/dist/services/artifact-pipeline-service.d.ts +99 -1
- package/dist/services/artifact-pipeline-service.d.ts.map +1 -1
- package/dist/services/artifact-pipeline-service.js +681 -4
- package/dist/services/artifact-pipeline-service.js.map +1 -1
- package/dist/services/canonical-json.d.ts +3 -0
- package/dist/services/canonical-json.d.ts.map +1 -0
- package/dist/services/canonical-json.js +71 -0
- package/dist/services/canonical-json.js.map +1 -0
- package/dist/services/claude-plugin-service.d.ts +6 -1
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +184 -12
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/codex-plugin-service.d.ts +30 -0
- package/dist/services/codex-plugin-service.d.ts.map +1 -0
- package/dist/services/codex-plugin-service.js +195 -0
- package/dist/services/codex-plugin-service.js.map +1 -0
- package/dist/services/company-auth-service.d.ts +70 -0
- package/dist/services/company-auth-service.d.ts.map +1 -0
- package/dist/services/company-auth-service.js +720 -0
- package/dist/services/company-auth-service.js.map +1 -0
- package/dist/services/company-auth-store.d.ts +22 -0
- package/dist/services/company-auth-store.d.ts.map +1 -0
- package/dist/services/company-auth-store.js +158 -0
- package/dist/services/company-auth-store.js.map +1 -0
- package/dist/services/company-common.d.ts +9 -0
- package/dist/services/company-common.d.ts.map +1 -0
- package/dist/services/company-common.js +35 -0
- package/dist/services/company-common.js.map +1 -0
- package/dist/services/company-sync-service.d.ts +214 -0
- package/dist/services/company-sync-service.d.ts.map +1 -0
- package/dist/services/company-sync-service.js +1299 -0
- package/dist/services/company-sync-service.js.map +1 -0
- package/dist/services/connectors/adapters/business-metrics.d.ts +5 -0
- package/dist/services/connectors/adapters/business-metrics.d.ts.map +1 -0
- package/dist/services/connectors/adapters/business-metrics.js +41 -0
- package/dist/services/connectors/adapters/business-metrics.js.map +1 -0
- package/dist/services/connectors/adapters/deployment-health.d.ts +18 -0
- package/dist/services/connectors/adapters/deployment-health.d.ts.map +1 -0
- package/dist/services/connectors/adapters/deployment-health.js +67 -0
- package/dist/services/connectors/adapters/deployment-health.js.map +1 -0
- package/dist/services/connectors/adapters/github.d.ts +5 -0
- package/dist/services/connectors/adapters/github.d.ts.map +1 -0
- package/dist/services/connectors/adapters/github.js +31 -0
- package/dist/services/connectors/adapters/github.js.map +1 -0
- package/dist/services/connectors/adapters/linear-jira.d.ts +5 -0
- package/dist/services/connectors/adapters/linear-jira.d.ts.map +1 -0
- package/dist/services/connectors/adapters/linear-jira.js +26 -0
- package/dist/services/connectors/adapters/linear-jira.js.map +1 -0
- package/dist/services/connectors/adapters/posthog.d.ts +5 -0
- package/dist/services/connectors/adapters/posthog.d.ts.map +1 -0
- package/dist/services/connectors/adapters/posthog.js +31 -0
- package/dist/services/connectors/adapters/posthog.js.map +1 -0
- package/dist/services/connectors/adapters/sentry.d.ts +5 -0
- package/dist/services/connectors/adapters/sentry.d.ts.map +1 -0
- package/dist/services/connectors/adapters/sentry.js +31 -0
- package/dist/services/connectors/adapters/sentry.js.map +1 -0
- package/dist/services/connectors/checkpoint-custody.d.ts +45 -0
- package/dist/services/connectors/checkpoint-custody.d.ts.map +1 -0
- package/dist/services/connectors/checkpoint-custody.js +496 -0
- package/dist/services/connectors/checkpoint-custody.js.map +1 -0
- package/dist/services/connectors/connector-registry.d.ts +144 -0
- package/dist/services/connectors/connector-registry.d.ts.map +1 -0
- package/dist/services/connectors/connector-registry.js +423 -0
- package/dist/services/connectors/connector-registry.js.map +1 -0
- package/dist/services/connectors/connector-runtime.d.ts +200 -0
- package/dist/services/connectors/connector-runtime.d.ts.map +1 -0
- package/dist/services/connectors/connector-runtime.js +1297 -0
- package/dist/services/connectors/connector-runtime.js.map +1 -0
- package/dist/services/connectors/credential-custody.d.ts +96 -0
- package/dist/services/connectors/credential-custody.d.ts.map +1 -0
- package/dist/services/connectors/credential-custody.js +390 -0
- package/dist/services/connectors/credential-custody.js.map +1 -0
- package/dist/services/credential-backends.d.ts +11 -1
- package/dist/services/credential-backends.d.ts.map +1 -1
- package/dist/services/credential-backends.js +104 -21
- package/dist/services/credential-backends.js.map +1 -1
- package/dist/services/credential-write-lock.d.ts +8 -0
- package/dist/services/credential-write-lock.d.ts.map +1 -0
- package/dist/services/credential-write-lock.js +104 -0
- package/dist/services/credential-write-lock.js.map +1 -0
- package/dist/services/credentials-service.d.ts +8 -2
- package/dist/services/credentials-service.d.ts.map +1 -1
- package/dist/services/credentials-service.js +66 -21
- package/dist/services/credentials-service.js.map +1 -1
- package/dist/services/deprecation-notices.d.ts +2 -2
- package/dist/services/deprecation-notices.d.ts.map +1 -1
- package/dist/services/deprecation-notices.js +2 -2
- package/dist/services/deprecation-notices.js.map +1 -1
- package/dist/services/design-artifact-service.d.ts +37 -0
- package/dist/services/design-artifact-service.d.ts.map +1 -0
- package/dist/services/design-artifact-service.js +94 -0
- package/dist/services/design-artifact-service.js.map +1 -0
- package/dist/services/diagram-artifact-service.d.ts +12 -0
- package/dist/services/diagram-artifact-service.d.ts.map +1 -0
- package/dist/services/diagram-artifact-service.js +41 -0
- package/dist/services/diagram-artifact-service.js.map +1 -0
- package/dist/services/diagram-pipeline-service.d.ts +125 -0
- package/dist/services/diagram-pipeline-service.d.ts.map +1 -0
- package/dist/services/diagram-pipeline-service.js +329 -0
- package/dist/services/diagram-pipeline-service.js.map +1 -0
- package/dist/services/gherkin-service.d.ts +3 -0
- package/dist/services/gherkin-service.d.ts.map +1 -0
- package/dist/services/gherkin-service.js +9 -0
- package/dist/services/gherkin-service.js.map +1 -0
- package/dist/services/graph-service.d.ts.map +1 -1
- package/dist/services/graph-service.js +6 -4
- package/dist/services/graph-service.js.map +1 -1
- package/dist/services/landing/landing-service.d.ts +42 -0
- package/dist/services/landing/landing-service.d.ts.map +1 -0
- package/dist/services/landing/landing-service.js +197 -0
- package/dist/services/landing/landing-service.js.map +1 -0
- package/dist/services/landing/operation-registry.d.ts +56 -0
- package/dist/services/landing/operation-registry.d.ts.map +1 -0
- package/dist/services/landing/operation-registry.js +165 -0
- package/dist/services/landing/operation-registry.js.map +1 -0
- package/dist/services/landing/receipt-custody.d.ts +48 -0
- package/dist/services/landing/receipt-custody.d.ts.map +1 -0
- package/dist/services/landing/receipt-custody.js +375 -0
- package/dist/services/landing/receipt-custody.js.map +1 -0
- package/dist/services/linear/constants.d.ts.map +1 -1
- package/dist/services/linear/constants.js +2 -6
- package/dist/services/linear/constants.js.map +1 -1
- package/dist/services/linear/task-status-aggregation.d.ts +1 -1
- package/dist/services/linear/task-status-aggregation.js +1 -1
- package/dist/services/linear-pull-service.d.ts.map +1 -1
- package/dist/services/linear-pull-service.js +7 -30
- package/dist/services/linear-pull-service.js.map +1 -1
- package/dist/services/linear-push-service.d.ts.map +1 -1
- package/dist/services/linear-push-service.js +4 -5
- package/dist/services/linear-push-service.js.map +1 -1
- package/dist/services/migration-registry.d.ts +0 -19
- package/dist/services/migration-registry.d.ts.map +1 -1
- package/dist/services/migration-registry.js +18 -32
- package/dist/services/migration-registry.js.map +1 -1
- package/dist/services/operate/assignment-lifecycle-service.d.ts +135 -0
- package/dist/services/operate/assignment-lifecycle-service.d.ts.map +1 -0
- package/dist/services/operate/assignment-lifecycle-service.js +113 -0
- package/dist/services/operate/assignment-lifecycle-service.js.map +1 -0
- package/dist/services/operate/assignment-packet-service.d.ts +79 -0
- package/dist/services/operate/assignment-packet-service.d.ts.map +1 -0
- package/dist/services/operate/assignment-packet-service.js +1030 -0
- package/dist/services/operate/assignment-packet-service.js.map +1 -0
- package/dist/services/operate/client/governance.d.ts +4 -0
- package/dist/services/operate/client/governance.d.ts.map +1 -0
- package/dist/services/operate/client/governance.js +3 -0
- package/dist/services/operate/client/governance.js.map +1 -0
- package/dist/services/operate/client/lifecycle.d.ts +18 -0
- package/dist/services/operate/client/lifecycle.d.ts.map +1 -0
- package/dist/services/operate/client/lifecycle.js +15 -0
- package/dist/services/operate/client/lifecycle.js.map +1 -0
- package/dist/services/operate/client/runtime.d.ts +13 -0
- package/dist/services/operate/client/runtime.d.ts.map +1 -0
- package/dist/services/operate/client/runtime.js +11 -0
- package/dist/services/operate/client/runtime.js.map +1 -0
- package/dist/services/operate/client-error.d.ts +9 -0
- package/dist/services/operate/client-error.d.ts.map +1 -0
- package/dist/services/operate/client-error.js +14 -0
- package/dist/services/operate/client-error.js.map +1 -0
- package/dist/services/operate/client.d.ts +415 -0
- package/dist/services/operate/client.d.ts.map +1 -0
- package/dist/services/operate/client.js +2432 -0
- package/dist/services/operate/client.js.map +1 -0
- package/dist/services/operate/command-gateway.d.ts +152 -0
- package/dist/services/operate/command-gateway.d.ts.map +1 -0
- package/dist/services/operate/command-gateway.js +883 -0
- package/dist/services/operate/command-gateway.js.map +1 -0
- package/dist/services/operate/composition.d.ts +421 -0
- package/dist/services/operate/composition.d.ts.map +1 -0
- package/dist/services/operate/composition.js +394 -0
- package/dist/services/operate/composition.js.map +1 -0
- package/dist/services/operate/cycle-lifecycle-service.d.ts +35 -0
- package/dist/services/operate/cycle-lifecycle-service.d.ts.map +1 -0
- package/dist/services/operate/cycle-lifecycle-service.js +427 -0
- package/dist/services/operate/cycle-lifecycle-service.js.map +1 -0
- package/dist/services/operate/delivery-evidence.d.ts +34 -0
- package/dist/services/operate/delivery-evidence.d.ts.map +1 -0
- package/dist/services/operate/delivery-evidence.js +666 -0
- package/dist/services/operate/delivery-evidence.js.map +1 -0
- package/dist/services/operate/domain-catalog-service.d.ts +24 -0
- package/dist/services/operate/domain-catalog-service.d.ts.map +1 -0
- package/dist/services/operate/domain-catalog-service.js +99 -0
- package/dist/services/operate/domain-catalog-service.js.map +1 -0
- package/dist/services/operate/experience-read-service.d.ts +64 -0
- package/dist/services/operate/experience-read-service.d.ts.map +1 -0
- package/dist/services/operate/experience-read-service.js +109 -0
- package/dist/services/operate/experience-read-service.js.map +1 -0
- package/dist/services/operate/governed-action-service.d.ts +80 -0
- package/dist/services/operate/governed-action-service.d.ts.map +1 -0
- package/dist/services/operate/governed-action-service.js +497 -0
- package/dist/services/operate/governed-action-service.js.map +1 -0
- package/dist/services/operate/identity-contract.d.ts +3 -0
- package/dist/services/operate/identity-contract.d.ts.map +1 -0
- package/dist/services/operate/identity-contract.js +6 -0
- package/dist/services/operate/identity-contract.js.map +1 -0
- package/dist/services/operate/measurement-schedule-service.d.ts +81 -0
- package/dist/services/operate/measurement-schedule-service.d.ts.map +1 -0
- package/dist/services/operate/measurement-schedule-service.js +461 -0
- package/dist/services/operate/measurement-schedule-service.js.map +1 -0
- package/dist/services/operate/path-custody.d.ts +16 -0
- package/dist/services/operate/path-custody.d.ts.map +1 -0
- package/dist/services/operate/path-custody.js +120 -0
- package/dist/services/operate/path-custody.js.map +1 -0
- package/dist/services/operate/pinned-legacy-replay-runner.d.ts +9 -0
- package/dist/services/operate/pinned-legacy-replay-runner.d.ts.map +1 -0
- package/dist/services/operate/pinned-legacy-replay-runner.js +441 -0
- package/dist/services/operate/pinned-legacy-replay-runner.js.map +1 -0
- package/dist/services/operate/planning-bridge.d.ts +28 -0
- package/dist/services/operate/planning-bridge.d.ts.map +1 -0
- package/dist/services/operate/planning-bridge.js +341 -0
- package/dist/services/operate/planning-bridge.js.map +1 -0
- package/dist/services/operate/planning-handoff-gateway.d.ts +47 -0
- package/dist/services/operate/planning-handoff-gateway.d.ts.map +1 -0
- package/dist/services/operate/planning-handoff-gateway.js +169 -0
- package/dist/services/operate/planning-handoff-gateway.js.map +1 -0
- package/dist/services/operate/planning-handoff-service.d.ts +38 -0
- package/dist/services/operate/planning-handoff-service.d.ts.map +1 -0
- package/dist/services/operate/planning-handoff-service.js +304 -0
- package/dist/services/operate/planning-handoff-service.js.map +1 -0
- package/dist/services/operate/project-transaction-lock.d.ts +6 -0
- package/dist/services/operate/project-transaction-lock.d.ts.map +1 -0
- package/dist/services/operate/project-transaction-lock.js +146 -0
- package/dist/services/operate/project-transaction-lock.js.map +1 -0
- package/dist/services/operate/recovery-service.d.ts +16 -0
- package/dist/services/operate/recovery-service.d.ts.map +1 -0
- package/dist/services/operate/recovery-service.js +59 -0
- package/dist/services/operate/recovery-service.js.map +1 -0
- package/dist/services/operate/replay-safe-retry-service.d.ts +21 -0
- package/dist/services/operate/replay-safe-retry-service.d.ts.map +1 -0
- package/dist/services/operate/replay-safe-retry-service.js +66 -0
- package/dist/services/operate/replay-safe-retry-service.js.map +1 -0
- package/dist/services/operate/repository-read-service.d.ts +13 -0
- package/dist/services/operate/repository-read-service.d.ts.map +1 -0
- package/dist/services/operate/repository-read-service.js +153 -0
- package/dist/services/operate/repository-read-service.js.map +1 -0
- package/dist/services/operate/review-lifecycle-service.d.ts +50 -0
- package/dist/services/operate/review-lifecycle-service.d.ts.map +1 -0
- package/dist/services/operate/review-lifecycle-service.js +63 -0
- package/dist/services/operate/review-lifecycle-service.js.map +1 -0
- package/dist/services/operate/review-read-gateway.d.ts +21 -0
- package/dist/services/operate/review-read-gateway.d.ts.map +1 -0
- package/dist/services/operate/review-read-gateway.js +119 -0
- package/dist/services/operate/review-read-gateway.js.map +1 -0
- package/dist/services/operate/screened-evidence-service.d.ts +24 -0
- package/dist/services/operate/screened-evidence-service.d.ts.map +1 -0
- package/dist/services/operate/screened-evidence-service.js +186 -0
- package/dist/services/operate/screened-evidence-service.js.map +1 -0
- package/dist/services/operate/search-hit-contract.d.ts +11 -0
- package/dist/services/operate/search-hit-contract.d.ts.map +1 -0
- package/dist/services/operate/search-hit-contract.js +29 -0
- package/dist/services/operate/search-hit-contract.js.map +1 -0
- package/dist/services/operate/session-capability.d.ts +61 -0
- package/dist/services/operate/session-capability.d.ts.map +1 -0
- package/dist/services/operate/session-capability.js +124 -0
- package/dist/services/operate/session-capability.js.map +1 -0
- package/dist/services/operate/spec-operating-origin-service.d.ts +60 -0
- package/dist/services/operate/spec-operating-origin-service.d.ts.map +1 -0
- package/dist/services/operate/spec-operating-origin-service.js +401 -0
- package/dist/services/operate/spec-operating-origin-service.js.map +1 -0
- package/dist/services/operate/storage-layout.d.ts +82 -0
- package/dist/services/operate/storage-layout.d.ts.map +1 -0
- package/dist/services/operate/storage-layout.js +1244 -0
- package/dist/services/operate/storage-layout.js.map +1 -0
- package/dist/services/operate/storage-migration-service.d.ts +15 -0
- package/dist/services/operate/storage-migration-service.d.ts.map +1 -0
- package/dist/services/operate/storage-migration-service.js +27 -0
- package/dist/services/operate/storage-migration-service.js.map +1 -0
- package/dist/services/operate/store.d.ts +132 -0
- package/dist/services/operate/store.d.ts.map +1 -0
- package/dist/services/operate/store.js +1344 -0
- package/dist/services/operate/store.js.map +1 -0
- package/dist/services/pipeline-package-service.d.ts +93 -2
- package/dist/services/pipeline-package-service.d.ts.map +1 -1
- package/dist/services/pipeline-package-service.js +867 -7
- package/dist/services/pipeline-package-service.js.map +1 -1
- package/dist/services/planning-id-service.d.ts +8 -0
- package/dist/services/planning-id-service.d.ts.map +1 -0
- package/dist/services/planning-id-service.js +114 -0
- package/dist/services/planning-id-service.js.map +1 -0
- package/dist/services/provenance-service.d.ts +33 -1
- package/dist/services/provenance-service.d.ts.map +1 -1
- package/dist/services/provenance-service.js +104 -8
- package/dist/services/provenance-service.js.map +1 -1
- package/dist/services/runtime-manager/doctor.d.ts +22 -0
- package/dist/services/runtime-manager/doctor.d.ts.map +1 -0
- package/dist/services/runtime-manager/doctor.js +74 -0
- package/dist/services/runtime-manager/doctor.js.map +1 -0
- package/dist/services/runtime-manager/global-state.d.ts +47 -0
- package/dist/services/runtime-manager/global-state.d.ts.map +1 -0
- package/dist/services/runtime-manager/global-state.js +59 -0
- package/dist/services/runtime-manager/global-state.js.map +1 -0
- package/dist/services/runtime-manager/install-plan.d.ts +37 -0
- package/dist/services/runtime-manager/install-plan.d.ts.map +1 -0
- package/dist/services/runtime-manager/install-plan.js +91 -0
- package/dist/services/runtime-manager/install-plan.js.map +1 -0
- package/dist/services/runtime-manager/inventory.d.ts +29 -0
- package/dist/services/runtime-manager/inventory.d.ts.map +1 -0
- package/dist/services/runtime-manager/inventory.js +46 -0
- package/dist/services/runtime-manager/inventory.js.map +1 -0
- package/dist/services/runtime-manager-service.d.ts +16 -71
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +1288 -505
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/spec-service.d.ts +213 -39
- package/dist/services/spec-service.d.ts.map +1 -1
- package/dist/services/spec-service.js +938 -171
- package/dist/services/spec-service.js.map +1 -1
- package/dist/services/template-service.d.ts.map +1 -1
- package/dist/services/template-service.js +1 -0
- package/dist/services/template-service.js.map +1 -1
- package/dist/templates/quick/quick-task.md.hbs +6 -0
- package/dist/templates/rules/claude/CLAUDE.md.hbs +3 -111
- package/dist/templates/rules/codex/AGENTS.md.hbs +2 -92
- package/dist/templates/rules/cursor/create-task-list.mdc.hbs +1 -1
- package/dist/templates/rules/cursor/implement-task-list.mdc.hbs +5 -83
- package/dist/templates/rules/cursor/openplanr.mdc.hbs +12 -0
- package/dist/templates/rules/shared/host-native-guidance.md.hbs +12 -0
- package/dist/templates/rules/shared/implementation-guidance.md.hbs +44 -0
- package/dist/templates/spec/spec-shaped.md.hbs +66 -22
- package/dist/templates/spec/spec.md.hbs +46 -23
- package/dist/templates/spec/story.md.hbs +15 -4
- package/dist/templates/spec/task.md.hbs +53 -5
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/logger.d.ts +0 -3
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +0 -6
- package/dist/utils/logger.js.map +1 -1
- package/docs/ARTIFACT_REVIEW.md +110 -0
- package/docs/CLI.md +1216 -0
- package/docs/CROSS_RUNTIME_SETUP.md +168 -0
- package/docs/TROUBLESHOOTING.md +227 -0
- package/lib/dashboard-verifier.d.mts +29 -0
- package/lib/dashboard-verifier.mjs +307 -0
- package/lib/host-packages/adapter-registry.json +44 -0
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +20 -0
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +9 -0
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +1179 -0
- package/lib/host-packages/claude/openplanr/agents/planr-backend.md +66 -0
- package/lib/host-packages/claude/openplanr/agents/planr-database.md +165 -0
- package/lib/host-packages/claude/openplanr/agents/planr-designer.md +57 -0
- package/lib/host-packages/claude/openplanr/agents/planr-devops.md +57 -0
- package/lib/host-packages/claude/openplanr/agents/planr-documentation.md +63 -0
- package/lib/host-packages/claude/openplanr/agents/planr-entity-scaffold.md +29 -0
- package/lib/host-packages/claude/openplanr/agents/planr-frontend.md +69 -0
- package/lib/host-packages/claude/openplanr/agents/planr-qa.md +162 -0
- package/lib/host-packages/claude/openplanr/agents/planr-specification.md +124 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/backend.md +93 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/designer.md +90 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/devops.md +55 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/doc-gen.md +67 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/frontend.md +94 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/qa.md +17 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/specification.md +111 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/contract-create-modify-preserve.md +17 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/design-craft-rubric.md +51 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/design-principles.md +43 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/design-spec-template.md +88 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +60 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/verification-and-recovery-backend.md +26 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/verification-and-recovery-frontend.md +27 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/backend.md +96 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/designer.md +83 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/devops.md +55 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/doc-gen.md +67 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/frontend.md +96 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/qa.md +17 -0
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/specification.md +112 -0
- package/lib/host-packages/claude/openplanr/references/pipeline/stacks/backend/nestjs.md +130 -0
- package/lib/host-packages/claude/openplanr/references/pipeline/stacks/database/mongodb.md +122 -0
- package/lib/host-packages/claude/openplanr/references/pipeline/stacks/database/prisma.md +155 -0
- package/lib/host-packages/claude/openplanr/references/pipeline/stacks/devops/docker-compose.md +140 -0
- package/lib/host-packages/claude/openplanr/references/pipeline/stacks/frontend/nextjs.md +123 -0
- package/lib/host-packages/claude/openplanr/skills/artifact/SKILL.md +54 -0
- package/lib/host-packages/claude/openplanr/skills/artifact/openplanr.skill.json +48 -0
- package/lib/host-packages/claude/openplanr/skills/artifact/references/company-review.md +18 -0
- package/lib/host-packages/claude/openplanr/skills/artifact/references/design-sharing.md +51 -0
- package/lib/host-packages/claude/openplanr/skills/browser-qa/SKILL.md +34 -0
- package/lib/host-packages/claude/openplanr/skills/browser-qa/openplanr.skill.json +26 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/SKILL.md +47 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/ceo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/chair-review/SKILL.md +101 -0
- package/lib/host-packages/claude/openplanr/skills/chair-review/openplanr.skill.json +70 -0
- package/lib/host-packages/claude/openplanr/skills/chair-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/chair-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/chair-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/chair-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/challenger-review/SKILL.md +86 -0
- package/lib/host-packages/claude/openplanr/skills/challenger-review/openplanr.skill.json +70 -0
- package/lib/host-packages/claude/openplanr/skills/challenger-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/challenger-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/challenger-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/challenger-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/SKILL.md +46 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/cmo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/SKILL.md +45 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/coo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/SKILL.md +48 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/cpo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/SKILL.md +47 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/openplanr.skill.json +81 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/cto-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/dashboard/SKILL.md +20 -0
- package/lib/host-packages/claude/openplanr/skills/dashboard/openplanr.skill.json +26 -0
- package/lib/host-packages/claude/openplanr/skills/design/SKILL.md +73 -0
- package/lib/host-packages/claude/openplanr/skills/design/openplanr.skill.json +466 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/craft.md +68 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/design-spec-template.md +88 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +33 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/discovery.md +53 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +105 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/handoff.md +47 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/review.md +88 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/team-review.md +131 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +93 -0
- package/lib/host-packages/claude/openplanr/skills/design/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/design/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/design/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/design.mjs +17323 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/SKILL.md +58 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/openplanr.skill.json +466 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/craft.md +68 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-spec-template.md +88 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +33 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/discovery.md +53 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +105 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/handoff.md +47 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/review.md +88 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/team-review.md +131 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +93 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/design.mjs +17323 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/SKILL.md +54 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/openplanr.skill.json +466 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/craft.md +68 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/design-spec-template.md +88 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +33 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/discovery.md +53 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +105 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/handoff.md +47 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/review.md +88 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/team-review.md +131 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +93 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/design.mjs +17323 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/claude/openplanr/skills/diagram/SKILL.md +65 -0
- package/lib/host-packages/claude/openplanr/skills/diagram/openplanr.skill.json +59 -0
- package/lib/host-packages/claude/openplanr/skills/diagram/references/diagram-document.md +86 -0
- package/lib/host-packages/claude/openplanr/skills/diagram/references/diagram-fidelity.md +19 -0
- package/lib/host-packages/claude/openplanr/skills/diagram/references/diagram-intent-to-ir.md +22 -0
- package/lib/host-packages/claude/openplanr/skills/doctor/SKILL.md +40 -0
- package/lib/host-packages/claude/openplanr/skills/doctor/openplanr.skill.json +37 -0
- package/lib/host-packages/claude/openplanr/skills/doctor/references/upgrade.md +106 -0
- package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +31 -0
- package/lib/host-packages/claude/openplanr/skills/investigate/openplanr.skill.json +26 -0
- package/lib/host-packages/claude/openplanr/skills/land/SKILL.md +33 -0
- package/lib/host-packages/claude/openplanr/skills/land/openplanr.skill.json +26 -0
- package/lib/host-packages/claude/openplanr/skills/operate/SKILL.md +181 -0
- package/lib/host-packages/claude/openplanr/skills/operate/openplanr.skill.json +70 -0
- package/lib/host-packages/claude/openplanr/skills/operate/scripts/errors.mjs +8 -0
- package/lib/host-packages/claude/openplanr/skills/operate/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/claude/openplanr/skills/operate/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/claude/openplanr/skills/operate/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +106 -0
- package/lib/host-packages/claude/openplanr/skills/plan/openplanr.skill.json +389 -0
- package/lib/host-packages/claude/openplanr/skills/plan/references/artifact-contract.md +39 -0
- package/lib/host-packages/claude/openplanr/skills/plan/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/plan/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/plan/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/design.mjs +17323 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/planning-ids.mjs +120 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/claude/openplanr/skills/plan-review/SKILL.md +39 -0
- package/lib/host-packages/claude/openplanr/skills/plan-review/openplanr.skill.json +26 -0
- package/lib/host-packages/claude/openplanr/skills/release/SKILL.md +180 -0
- package/lib/host-packages/claude/openplanr/skills/release/assets/changelog-template.md +18 -0
- package/lib/host-packages/claude/openplanr/skills/release/assets/profile-template.md +45 -0
- package/lib/host-packages/claude/openplanr/skills/release/openplanr.skill.json +92 -0
- package/lib/host-packages/claude/openplanr/skills/release/references/cadence.md +92 -0
- package/lib/host-packages/claude/openplanr/skills/release/references/release-notes.md +127 -0
- package/lib/host-packages/claude/openplanr/skills/release/references/schemes.md +103 -0
- package/lib/host-packages/claude/openplanr/skills/release/scripts/collect_changes.sh +85 -0
- package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +80 -0
- package/lib/host-packages/claude/openplanr/skills/ship/openplanr.skill.json +48 -0
- package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +14 -0
- package/lib/host-packages/claude/openplanr/skills/ship/scripts/discover-verification.mjs +107 -0
- package/lib/host-packages/claude/openplanr/skills/spec/SKILL.md +53 -0
- package/lib/host-packages/claude/openplanr/skills/spec/openplanr.skill.json +37 -0
- package/lib/host-packages/claude/openplanr/skills/spec/references/specification-contract.md +32 -0
- package/lib/host-packages/claude/openplanr/skills/status/SKILL.md +21 -0
- package/lib/host-packages/claude/openplanr/skills/status/openplanr.skill.json +26 -0
- package/lib/host-packages/claude/openplanr/skills/sync/SKILL.md +30 -0
- package/lib/host-packages/claude/openplanr/skills/sync/openplanr.skill.json +37 -0
- package/lib/host-packages/claude/openplanr/skills/sync/scripts/sync.mjs +230 -0
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +939 -0
- package/lib/host-packages/cursor/openplanr/manifest.json +32 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/company-review.md +18 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/design-sharing.md +51 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-artifact.mdc +53 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-browser-qa.mdc +34 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review.mdc +45 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-chair-review.mdc +99 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review.mdc +84 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review.mdc +44 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-coo-review.mdc +43 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review.mdc +46 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-cto-review.mdc +45 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-dashboard.mdc +19 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/craft.md +68 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-spec-template.md +88 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +33 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/discovery.md +53 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +105 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/handoff.md +47 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/review.md +88 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/team-review.md +131 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +93 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/design.mjs +17323 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/craft.md +68 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-spec-template.md +88 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +33 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/discovery.md +53 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +105 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/handoff.md +47 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/review.md +88 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/team-review.md +131 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +93 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/design.mjs +17323 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop.mdc +57 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/craft.md +68 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-spec-template.md +88 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +33 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/discovery.md +53 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +105 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/handoff.md +47 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/review.md +88 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/team-review.md +131 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +93 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/design.mjs +17323 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review.mdc +53 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design.mdc +72 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-diagram/references/diagram-document.md +86 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-diagram/references/diagram-fidelity.md +19 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-diagram/references/diagram-intent-to-ir.md +22 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-diagram.mdc +64 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-doctor/references/upgrade.md +106 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-doctor.mdc +39 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-land.mdc +32 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-operate/scripts/errors.mjs +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-operate/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-operate/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-operate/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-operate.mdc +180 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/references/artifact-contract.md +39 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/design.mjs +17323 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/planning-ids.mjs +120 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan-review.mdc +38 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +105 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release/assets/changelog-template.md +18 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release/assets/profile-template.md +45 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release/references/cadence.md +92 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release/references/release-notes.md +127 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release/references/schemes.md +103 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release/scripts/collect_changes.sh +85 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-release.mdc +179 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +14 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/discover-verification.mjs +107 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +79 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-spec/references/specification-contract.md +32 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-spec.mdc +52 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-status.mdc +20 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sync/scripts/sync.mjs +230 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sync.mdc +29 -0
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +19 -0
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +10 -0
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +1139 -0
- package/lib/host-packages/openai/openplanr/skills/artifact/SKILL.md +54 -0
- package/lib/host-packages/openai/openplanr/skills/artifact/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/artifact/openplanr.skill.json +48 -0
- package/lib/host-packages/openai/openplanr/skills/artifact/references/company-review.md +18 -0
- package/lib/host-packages/openai/openplanr/skills/artifact/references/design-sharing.md +51 -0
- package/lib/host-packages/openai/openplanr/skills/browser-qa/SKILL.md +34 -0
- package/lib/host-packages/openai/openplanr/skills/browser-qa/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/browser-qa/openplanr.skill.json +26 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/SKILL.md +47 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/ceo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/SKILL.md +101 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/openplanr.skill.json +70 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/chair-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/SKILL.md +86 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/openplanr.skill.json +70 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/challenger-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/SKILL.md +46 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/cmo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/SKILL.md +45 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/coo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/SKILL.md +48 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/openplanr.skill.json +81 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/cpo-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/SKILL.md +47 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/openplanr.skill.json +81 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/references/operate-advisor-contract.md +111 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/cto-review/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/dashboard/SKILL.md +20 -0
- package/lib/host-packages/openai/openplanr/skills/dashboard/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/dashboard/openplanr.skill.json +26 -0
- package/lib/host-packages/openai/openplanr/skills/design/SKILL.md +73 -0
- package/lib/host-packages/openai/openplanr/skills/design/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/design/openplanr.skill.json +466 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/craft.md +68 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/design-spec-template.md +88 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +33 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/discovery.md +53 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +105 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/handoff.md +47 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/review.md +88 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/team-review.md +131 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +93 -0
- package/lib/host-packages/openai/openplanr/skills/design/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/design/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/design/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/design.mjs +17323 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/SKILL.md +58 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/openplanr.skill.json +466 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/craft.md +68 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-spec-template.md +88 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +33 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/discovery.md +53 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +105 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/handoff.md +47 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/review.md +88 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/team-review.md +131 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +93 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/design.mjs +17323 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/SKILL.md +54 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/openplanr.skill.json +466 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/craft.md +68 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/design-spec-template.md +88 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +33 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/discovery.md +53 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +105 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/handoff.md +47 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/review.md +88 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/team-review.md +131 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +93 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/design.mjs +17323 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/openai/openplanr/skills/diagram/SKILL.md +65 -0
- package/lib/host-packages/openai/openplanr/skills/diagram/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/diagram/openplanr.skill.json +59 -0
- package/lib/host-packages/openai/openplanr/skills/diagram/references/diagram-document.md +86 -0
- package/lib/host-packages/openai/openplanr/skills/diagram/references/diagram-fidelity.md +19 -0
- package/lib/host-packages/openai/openplanr/skills/diagram/references/diagram-intent-to-ir.md +22 -0
- package/lib/host-packages/openai/openplanr/skills/doctor/SKILL.md +40 -0
- package/lib/host-packages/openai/openplanr/skills/doctor/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/doctor/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/doctor/references/upgrade.md +106 -0
- package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +31 -0
- package/lib/host-packages/openai/openplanr/skills/investigate/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +26 -0
- package/lib/host-packages/openai/openplanr/skills/land/SKILL.md +33 -0
- package/lib/host-packages/openai/openplanr/skills/land/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/land/openplanr.skill.json +26 -0
- package/lib/host-packages/openai/openplanr/skills/operate/SKILL.md +181 -0
- package/lib/host-packages/openai/openplanr/skills/operate/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/operate/openplanr.skill.json +70 -0
- package/lib/host-packages/openai/openplanr/skills/operate/scripts/errors.mjs +8 -0
- package/lib/host-packages/openai/openplanr/skills/operate/scripts/operate-review-contract.mjs +438 -0
- package/lib/host-packages/openai/openplanr/skills/operate/scripts/operate-review-note.mjs +595 -0
- package/lib/host-packages/openai/openplanr/skills/operate/scripts/validate-note.mjs +31 -0
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +106 -0
- package/lib/host-packages/openai/openplanr/skills/plan/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +389 -0
- package/lib/host-packages/openai/openplanr/skills/plan/references/artifact-contract.md +39 -0
- package/lib/host-packages/openai/openplanr/skills/plan/schemas/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/plan/schemas/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/plan/schemas/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/design.mjs +17323 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/planning-ids.mjs +120 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/notices/entities.txt +13 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/notices/parse5.txt +21 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/artifact/templates/artifact-review-stage.js +3994 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/enhancements.css +378 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/enhancements.js +805 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/share.css +1 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/share.js +132 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/studio.css +1103 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/design/templates/studio/studio.js +1775 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/package.json +115 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/registry/artifact-theme.json +60 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-document.schema.json +306 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/lib/host-packages/openai/openplanr/skills/plan-review/SKILL.md +39 -0
- package/lib/host-packages/openai/openplanr/skills/plan-review/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/plan-review/openplanr.skill.json +26 -0
- package/lib/host-packages/openai/openplanr/skills/release/SKILL.md +180 -0
- package/lib/host-packages/openai/openplanr/skills/release/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/release/assets/changelog-template.md +18 -0
- package/lib/host-packages/openai/openplanr/skills/release/assets/profile-template.md +45 -0
- package/lib/host-packages/openai/openplanr/skills/release/openplanr.skill.json +92 -0
- package/lib/host-packages/openai/openplanr/skills/release/references/cadence.md +92 -0
- package/lib/host-packages/openai/openplanr/skills/release/references/release-notes.md +127 -0
- package/lib/host-packages/openai/openplanr/skills/release/references/schemes.md +103 -0
- package/lib/host-packages/openai/openplanr/skills/release/scripts/collect_changes.sh +85 -0
- package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +80 -0
- package/lib/host-packages/openai/openplanr/skills/ship/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +48 -0
- package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +14 -0
- package/lib/host-packages/openai/openplanr/skills/ship/scripts/discover-verification.mjs +107 -0
- package/lib/host-packages/openai/openplanr/skills/spec/SKILL.md +53 -0
- package/lib/host-packages/openai/openplanr/skills/spec/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/spec/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/spec/references/specification-contract.md +32 -0
- package/lib/host-packages/openai/openplanr/skills/status/SKILL.md +21 -0
- package/lib/host-packages/openai/openplanr/skills/status/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/status/openplanr.skill.json +26 -0
- package/lib/host-packages/openai/openplanr/skills/sync/SKILL.md +30 -0
- package/lib/host-packages/openai/openplanr/skills/sync/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/sync/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/sync/scripts/sync.mjs +230 -0
- package/lib/integrations.d.mts +43 -0
- package/lib/integrations.mjs +230 -0
- package/lib/skill-runtime/errors.mjs +8 -0
- package/lib/skill-runtime/operate-review-contract.mjs +438 -0
- package/lib/skill-runtime/operate-review-note.mjs +595 -0
- package/package.json +56 -18
- package/dist/ai/codebase/context-builder.d.ts +0 -50
- package/dist/ai/codebase/context-builder.d.ts.map +0 -1
- package/dist/ai/codebase/context-builder.js +0 -281
- package/dist/ai/codebase/context-builder.js.map +0 -1
- package/dist/ai/codebase/file-reader.d.ts +0 -22
- package/dist/ai/codebase/file-reader.d.ts.map +0 -1
- package/dist/ai/codebase/file-reader.js +0 -144
- package/dist/ai/codebase/file-reader.js.map +0 -1
- package/dist/ai/codebase/index.d.ts +0 -7
- package/dist/ai/codebase/index.d.ts.map +0 -1
- package/dist/ai/codebase/index.js +0 -7
- package/dist/ai/codebase/index.js.map +0 -1
- package/dist/ai/codebase/pattern-rules.d.ts +0 -28
- package/dist/ai/codebase/pattern-rules.d.ts.map +0 -1
- package/dist/ai/codebase/pattern-rules.js +0 -186
- package/dist/ai/codebase/pattern-rules.js.map +0 -1
- package/dist/ai/codebase/rules-reader.d.ts +0 -14
- package/dist/ai/codebase/rules-reader.d.ts.map +0 -1
- package/dist/ai/codebase/rules-reader.js +0 -25
- package/dist/ai/codebase/rules-reader.js.map +0 -1
- package/dist/ai/codebase/stack-detector.d.ts +0 -18
- package/dist/ai/codebase/stack-detector.d.ts.map +0 -1
- package/dist/ai/codebase/stack-detector.js +0 -173
- package/dist/ai/codebase/stack-detector.js.map +0 -1
- package/dist/ai/codebase/tree-generator.d.ts +0 -8
- package/dist/ai/codebase/tree-generator.d.ts.map +0 -1
- package/dist/ai/codebase/tree-generator.js +0 -84
- package/dist/ai/codebase/tree-generator.js.map +0 -1
- package/dist/ai/errors.d.ts +0 -22
- package/dist/ai/errors.d.ts.map +0 -1
- package/dist/ai/errors.js +0 -72
- package/dist/ai/errors.js.map +0 -1
- package/dist/ai/index.d.ts +0 -11
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -10
- package/dist/ai/index.js.map +0 -1
- package/dist/ai/prompts/prompt-builder.d.ts +0 -134
- package/dist/ai/prompts/prompt-builder.d.ts.map +0 -1
- package/dist/ai/prompts/prompt-builder.js +0 -295
- package/dist/ai/prompts/prompt-builder.js.map +0 -1
- package/dist/ai/prompts/system-prompts.d.ts +0 -41
- package/dist/ai/prompts/system-prompts.d.ts.map +0 -1
- package/dist/ai/prompts/system-prompts.js +0 -512
- package/dist/ai/prompts/system-prompts.js.map +0 -1
- package/dist/ai/provider-factory.d.ts +0 -10
- package/dist/ai/provider-factory.d.ts.map +0 -1
- package/dist/ai/provider-factory.js +0 -49
- package/dist/ai/provider-factory.js.map +0 -1
- package/dist/ai/providers/anthropic-provider.d.ts +0 -24
- package/dist/ai/providers/anthropic-provider.d.ts.map +0 -1
- package/dist/ai/providers/anthropic-provider.js +0 -97
- package/dist/ai/providers/anthropic-provider.js.map +0 -1
- package/dist/ai/providers/ollama-provider.d.ts +0 -13
- package/dist/ai/providers/ollama-provider.d.ts.map +0 -1
- package/dist/ai/providers/ollama-provider.js +0 -16
- package/dist/ai/providers/ollama-provider.js.map +0 -1
- package/dist/ai/providers/openai-provider.d.ts +0 -19
- package/dist/ai/providers/openai-provider.d.ts.map +0 -1
- package/dist/ai/providers/openai-provider.js +0 -84
- package/dist/ai/providers/openai-provider.js.map +0 -1
- package/dist/ai/schemas/ai-response-schemas.d.ts +0 -340
- package/dist/ai/schemas/ai-response-schemas.d.ts.map +0 -1
- package/dist/ai/schemas/ai-response-schemas.js +0 -278
- package/dist/ai/schemas/ai-response-schemas.js.map +0 -1
- package/dist/ai/types.d.ts +0 -76
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/ai/types.js +0 -49
- package/dist/ai/types.js.map +0 -1
- package/dist/ai/validation/index.d.ts +0 -2
- package/dist/ai/validation/index.d.ts.map +0 -1
- package/dist/ai/validation/index.js +0 -2
- package/dist/ai/validation/index.js.map +0 -1
- package/dist/ai/validation/task-validator.d.ts +0 -37
- package/dist/ai/validation/task-validator.d.ts.map +0 -1
- package/dist/ai/validation/task-validator.js +0 -81
- package/dist/ai/validation/task-validator.js.map +0 -1
- package/dist/cli/commands/config.d.ts +0 -8
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js +0 -224
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/estimate.d.ts +0 -3
- package/dist/cli/commands/estimate.d.ts.map +0 -1
- package/dist/cli/commands/estimate.js +0 -368
- package/dist/cli/commands/estimate.js.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -9
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -166
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/pipeline.d.ts +0 -3
- package/dist/cli/commands/pipeline.d.ts.map +0 -1
- package/dist/cli/commands/pipeline.js +0 -59
- package/dist/cli/commands/pipeline.js.map +0 -1
- package/dist/cli/commands/plan.d.ts +0 -15
- package/dist/cli/commands/plan.d.ts.map +0 -1
- package/dist/cli/commands/plan.js +0 -444
- package/dist/cli/commands/plan.js.map +0 -1
- package/dist/cli/commands/refine.d.ts +0 -10
- package/dist/cli/commands/refine.d.ts.map +0 -1
- package/dist/cli/commands/refine.js +0 -226
- package/dist/cli/commands/refine.js.map +0 -1
- package/dist/cli/commands/revise.d.ts +0 -24
- package/dist/cli/commands/revise.d.ts.map +0 -1
- package/dist/cli/commands/revise.js +0 -572
- package/dist/cli/commands/revise.js.map +0 -1
- package/dist/cli/helpers/task-creation.d.ts +0 -89
- package/dist/cli/helpers/task-creation.d.ts.map +0 -1
- package/dist/cli/helpers/task-creation.js +0 -139
- package/dist/cli/helpers/task-creation.js.map +0 -1
- package/dist/services/ai-service.d.ts +0 -77
- package/dist/services/ai-service.d.ts.map +0 -1
- package/dist/services/ai-service.js +0 -241
- package/dist/services/ai-service.js.map +0 -1
- package/dist/services/artifact-gathering.d.ts +0 -55
- package/dist/services/artifact-gathering.d.ts.map +0 -1
- package/dist/services/artifact-gathering.js +0 -147
- package/dist/services/artifact-gathering.js.map +0 -1
- package/dist/services/operate/advisors.d.ts +0 -625
- package/dist/services/operate/advisors.d.ts.map +0 -1
- package/dist/services/operate/advisors.js +0 -1545
- package/dist/services/operate/advisors.js.map +0 -1
- package/dist/services/operate/artifact-route-generation.d.ts +0 -111
- package/dist/services/operate/artifact-route-generation.d.ts.map +0 -1
- package/dist/services/operate/artifact-route-generation.js +0 -460
- package/dist/services/operate/artifact-route-generation.js.map +0 -1
- package/dist/services/operate/artifacts.d.ts +0 -66
- package/dist/services/operate/artifacts.d.ts.map +0 -1
- package/dist/services/operate/artifacts.js +0 -336
- package/dist/services/operate/artifacts.js.map +0 -1
- package/dist/services/operate/cadence.d.ts +0 -50
- package/dist/services/operate/cadence.d.ts.map +0 -1
- package/dist/services/operate/cadence.js +0 -56
- package/dist/services/operate/cadence.js.map +0 -1
- package/dist/services/operate/canonical.d.ts +0 -18
- package/dist/services/operate/canonical.d.ts.map +0 -1
- package/dist/services/operate/canonical.js +0 -157
- package/dist/services/operate/canonical.js.map +0 -1
- package/dist/services/operate/citation-resolution.d.ts +0 -161
- package/dist/services/operate/citation-resolution.d.ts.map +0 -1
- package/dist/services/operate/citation-resolution.js +0 -593
- package/dist/services/operate/citation-resolution.js.map +0 -1
- package/dist/services/operate/completion.d.ts +0 -80
- package/dist/services/operate/completion.d.ts.map +0 -1
- package/dist/services/operate/completion.js +0 -279
- package/dist/services/operate/completion.js.map +0 -1
- package/dist/services/operate/config.d.ts +0 -154
- package/dist/services/operate/config.d.ts.map +0 -1
- package/dist/services/operate/config.js +0 -791
- package/dist/services/operate/config.js.map +0 -1
- package/dist/services/operate/consolidation.d.ts +0 -18
- package/dist/services/operate/consolidation.d.ts.map +0 -1
- package/dist/services/operate/consolidation.js +0 -539
- package/dist/services/operate/consolidation.js.map +0 -1
- package/dist/services/operate/context-research.d.ts +0 -84
- package/dist/services/operate/context-research.d.ts.map +0 -1
- package/dist/services/operate/context-research.js +0 -448
- package/dist/services/operate/context-research.js.map +0 -1
- package/dist/services/operate/decision-brief.d.ts +0 -237
- package/dist/services/operate/decision-brief.d.ts.map +0 -1
- package/dist/services/operate/decision-brief.js +0 -368
- package/dist/services/operate/decision-brief.js.map +0 -1
- package/dist/services/operate/doctor.d.ts +0 -85
- package/dist/services/operate/doctor.d.ts.map +0 -1
- package/dist/services/operate/doctor.js +0 -1070
- package/dist/services/operate/doctor.js.map +0 -1
- package/dist/services/operate/drafts.d.ts +0 -48
- package/dist/services/operate/drafts.d.ts.map +0 -1
- package/dist/services/operate/drafts.js +0 -398
- package/dist/services/operate/drafts.js.map +0 -1
- package/dist/services/operate/engine.d.ts +0 -151
- package/dist/services/operate/engine.d.ts.map +0 -1
- package/dist/services/operate/engine.js +0 -1896
- package/dist/services/operate/engine.js.map +0 -1
- package/dist/services/operate/event-store.d.ts +0 -113
- package/dist/services/operate/event-store.d.ts.map +0 -1
- package/dist/services/operate/event-store.js +0 -384
- package/dist/services/operate/event-store.js.map +0 -1
- package/dist/services/operate/evidence-cache.d.ts +0 -41
- package/dist/services/operate/evidence-cache.d.ts.map +0 -1
- package/dist/services/operate/evidence-cache.js +0 -193
- package/dist/services/operate/evidence-cache.js.map +0 -1
- package/dist/services/operate/evidence-import.d.ts +0 -40
- package/dist/services/operate/evidence-import.d.ts.map +0 -1
- package/dist/services/operate/evidence-import.js +0 -340
- package/dist/services/operate/evidence-import.js.map +0 -1
- package/dist/services/operate/evidence.d.ts +0 -21
- package/dist/services/operate/evidence.d.ts.map +0 -1
- package/dist/services/operate/evidence.js +0 -20
- package/dist/services/operate/evidence.js.map +0 -1
- package/dist/services/operate/ids.d.ts +0 -7
- package/dist/services/operate/ids.d.ts.map +0 -1
- package/dist/services/operate/ids.js +0 -23
- package/dist/services/operate/ids.js.map +0 -1
- package/dist/services/operate/index.d.ts +0 -16
- package/dist/services/operate/index.d.ts.map +0 -1
- package/dist/services/operate/index.js +0 -1864
- package/dist/services/operate/index.js.map +0 -1
- package/dist/services/operate/integrity.d.ts +0 -81
- package/dist/services/operate/integrity.d.ts.map +0 -1
- package/dist/services/operate/integrity.js +0 -152
- package/dist/services/operate/integrity.js.map +0 -1
- package/dist/services/operate/interaction/action-service.d.ts +0 -34
- package/dist/services/operate/interaction/action-service.d.ts.map +0 -1
- package/dist/services/operate/interaction/action-service.js +0 -103
- package/dist/services/operate/interaction/action-service.js.map +0 -1
- package/dist/services/operate/interaction/answer-service.d.ts +0 -40
- package/dist/services/operate/interaction/answer-service.d.ts.map +0 -1
- package/dist/services/operate/interaction/answer-service.js +0 -317
- package/dist/services/operate/interaction/answer-service.js.map +0 -1
- package/dist/services/operate/interaction/charter-suggestions.d.ts +0 -29
- package/dist/services/operate/interaction/charter-suggestions.d.ts.map +0 -1
- package/dist/services/operate/interaction/charter-suggestions.js +0 -104
- package/dist/services/operate/interaction/charter-suggestions.js.map +0 -1
- package/dist/services/operate/interaction/confirmation-service.d.ts +0 -30
- package/dist/services/operate/interaction/confirmation-service.d.ts.map +0 -1
- package/dist/services/operate/interaction/confirmation-service.js +0 -78
- package/dist/services/operate/interaction/confirmation-service.js.map +0 -1
- package/dist/services/operate/interaction/initialization-replay.d.ts +0 -9
- package/dist/services/operate/interaction/initialization-replay.d.ts.map +0 -1
- package/dist/services/operate/interaction/initialization-replay.js +0 -64
- package/dist/services/operate/interaction/initialization-replay.js.map +0 -1
- package/dist/services/operate/interaction/question-engine.d.ts +0 -41
- package/dist/services/operate/interaction/question-engine.d.ts.map +0 -1
- package/dist/services/operate/interaction/question-engine.js +0 -434
- package/dist/services/operate/interaction/question-engine.js.map +0 -1
- package/dist/services/operate/interaction/question-registry.d.ts +0 -52
- package/dist/services/operate/interaction/question-registry.d.ts.map +0 -1
- package/dist/services/operate/interaction/question-registry.js +0 -305
- package/dist/services/operate/interaction/question-registry.js.map +0 -1
- package/dist/services/operate/interaction/session-service.d.ts +0 -55
- package/dist/services/operate/interaction/session-service.d.ts.map +0 -1
- package/dist/services/operate/interaction/session-service.js +0 -304
- package/dist/services/operate/interaction/session-service.js.map +0 -1
- package/dist/services/operate/interaction/terminal-renderer.d.ts +0 -19
- package/dist/services/operate/interaction/terminal-renderer.d.ts.map +0 -1
- package/dist/services/operate/interaction/terminal-renderer.js +0 -124
- package/dist/services/operate/interaction/terminal-renderer.js.map +0 -1
- package/dist/services/operate/journal.d.ts +0 -34
- package/dist/services/operate/journal.d.ts.map +0 -1
- package/dist/services/operate/journal.js +0 -235
- package/dist/services/operate/journal.js.map +0 -1
- package/dist/services/operate/legacy-import-service.d.ts +0 -58
- package/dist/services/operate/legacy-import-service.d.ts.map +0 -1
- package/dist/services/operate/legacy-import-service.js +0 -922
- package/dist/services/operate/legacy-import-service.js.map +0 -1
- package/dist/services/operate/lifecycle-driver.d.ts +0 -309
- package/dist/services/operate/lifecycle-driver.d.ts.map +0 -1
- package/dist/services/operate/lifecycle-driver.js +0 -434
- package/dist/services/operate/lifecycle-driver.js.map +0 -1
- package/dist/services/operate/lifecycle.d.ts +0 -96
- package/dist/services/operate/lifecycle.d.ts.map +0 -1
- package/dist/services/operate/lifecycle.js +0 -596
- package/dist/services/operate/lifecycle.js.map +0 -1
- package/dist/services/operate/lock-service.d.ts +0 -37
- package/dist/services/operate/lock-service.d.ts.map +0 -1
- package/dist/services/operate/lock-service.js +0 -215
- package/dist/services/operate/lock-service.js.map +0 -1
- package/dist/services/operate/maintenance.d.ts +0 -139
- package/dist/services/operate/maintenance.d.ts.map +0 -1
- package/dist/services/operate/maintenance.js +0 -2200
- package/dist/services/operate/maintenance.js.map +0 -1
- package/dist/services/operate/migration.d.ts +0 -68
- package/dist/services/operate/migration.d.ts.map +0 -1
- package/dist/services/operate/migration.js +0 -243
- package/dist/services/operate/migration.js.map +0 -1
- package/dist/services/operate/mission-dispatch.d.ts +0 -271
- package/dist/services/operate/mission-dispatch.d.ts.map +0 -1
- package/dist/services/operate/mission-dispatch.js +0 -590
- package/dist/services/operate/mission-dispatch.js.map +0 -1
- package/dist/services/operate/outcomes.d.ts +0 -48
- package/dist/services/operate/outcomes.d.ts.map +0 -1
- package/dist/services/operate/outcomes.js +0 -312
- package/dist/services/operate/outcomes.js.map +0 -1
- package/dist/services/operate/pipeline-handoff.d.ts +0 -138
- package/dist/services/operate/pipeline-handoff.d.ts.map +0 -1
- package/dist/services/operate/pipeline-handoff.js +0 -175
- package/dist/services/operate/pipeline-handoff.js.map +0 -1
- package/dist/services/operate/profile-migration.d.ts +0 -69
- package/dist/services/operate/profile-migration.d.ts.map +0 -1
- package/dist/services/operate/profile-migration.js +0 -462
- package/dist/services/operate/profile-migration.js.map +0 -1
- package/dist/services/operate/projection-persistence.d.ts +0 -126
- package/dist/services/operate/projection-persistence.d.ts.map +0 -1
- package/dist/services/operate/projection-persistence.js +0 -752
- package/dist/services/operate/projection-persistence.js.map +0 -1
- package/dist/services/operate/projection.d.ts +0 -37
- package/dist/services/operate/projection.d.ts.map +0 -1
- package/dist/services/operate/projection.js +0 -209
- package/dist/services/operate/projection.js.map +0 -1
- package/dist/services/operate/protocol.d.ts +0 -86
- package/dist/services/operate/protocol.d.ts.map +0 -1
- package/dist/services/operate/protocol.js +0 -76
- package/dist/services/operate/protocol.js.map +0 -1
- package/dist/services/operate/read-only-providers.d.ts +0 -76
- package/dist/services/operate/read-only-providers.d.ts.map +0 -1
- package/dist/services/operate/read-only-providers.js +0 -421
- package/dist/services/operate/read-only-providers.js.map +0 -1
- package/dist/services/operate/redaction.d.ts +0 -74
- package/dist/services/operate/redaction.d.ts.map +0 -1
- package/dist/services/operate/redaction.js +0 -406
- package/dist/services/operate/redaction.js.map +0 -1
- package/dist/services/operate/reducer.d.ts +0 -10
- package/dist/services/operate/reducer.d.ts.map +0 -1
- package/dist/services/operate/reducer.js +0 -11
- package/dist/services/operate/reducer.js.map +0 -1
- package/dist/services/operate/report-html.d.ts +0 -32
- package/dist/services/operate/report-html.d.ts.map +0 -1
- package/dist/services/operate/report-html.js +0 -289
- package/dist/services/operate/report-html.js.map +0 -1
- package/dist/services/operate/reports.d.ts +0 -72
- package/dist/services/operate/reports.d.ts.map +0 -1
- package/dist/services/operate/reports.js +0 -481
- package/dist/services/operate/reports.js.map +0 -1
- package/dist/services/operate/routes.d.ts +0 -133
- package/dist/services/operate/routes.d.ts.map +0 -1
- package/dist/services/operate/routes.js +0 -1577
- package/dist/services/operate/routes.js.map +0 -1
- package/dist/services/operate/scratch.d.ts +0 -81
- package/dist/services/operate/scratch.d.ts.map +0 -1
- package/dist/services/operate/scratch.js +0 -190
- package/dist/services/operate/scratch.js.map +0 -1
- package/dist/services/operate/shipment-observer.d.ts +0 -14
- package/dist/services/operate/shipment-observer.d.ts.map +0 -1
- package/dist/services/operate/shipment-observer.js +0 -320
- package/dist/services/operate/shipment-observer.js.map +0 -1
- package/dist/services/operate/stalled-item-service.d.ts +0 -18
- package/dist/services/operate/stalled-item-service.d.ts.map +0 -1
- package/dist/services/operate/stalled-item-service.js +0 -121
- package/dist/services/operate/stalled-item-service.js.map +0 -1
- package/dist/services/operate/subprocess-env.d.ts +0 -4
- package/dist/services/operate/subprocess-env.d.ts.map +0 -1
- package/dist/services/operate/subprocess-env.js +0 -45
- package/dist/services/operate/subprocess-env.js.map +0 -1
- package/dist/services/operate/types.d.ts +0 -1064
- package/dist/services/operate/types.d.ts.map +0 -1
- package/dist/services/operate/types.js +0 -27
- package/dist/services/operate/types.js.map +0 -1
- package/dist/services/operate/workspace.d.ts +0 -76
- package/dist/services/operate/workspace.d.ts.map +0 -1
- package/dist/services/operate/workspace.js +0 -350
- package/dist/services/operate/workspace.js.map +0 -1
- package/dist/services/revise-service.d.ts +0 -115
- package/dist/services/revise-service.d.ts.map +0 -1
- package/dist/services/revise-service.js +0 -294
- package/dist/services/revise-service.js.map +0 -1
- package/dist/templates/rules/claude/planr-pipeline.md.hbs +0 -69
- package/dist/templates/rules/codex/_pipeline-section.md.hbs +0 -154
- package/dist/templates/rules/cursor/agents/backend-agent.md +0 -299
- package/dist/templates/rules/cursor/agents/db-agent.md +0 -163
- package/dist/templates/rules/cursor/agents/designer-agent.md +0 -219
- package/dist/templates/rules/cursor/agents/devops-agent.md +0 -197
- package/dist/templates/rules/cursor/agents/doc-gen-agent.md +0 -203
- package/dist/templates/rules/cursor/agents/frontend-agent.md +0 -220
- package/dist/templates/rules/cursor/agents/qa-agent.md +0 -170
- package/dist/templates/rules/cursor/agents/specification-agent.md +0 -282
- package/dist/templates/rules/cursor/planr-pipeline-plan.mdc.hbs +0 -196
- package/dist/templates/rules/cursor/planr-pipeline-ship.mdc.hbs +0 -246
- package/dist/templates/rules/cursor/planr-pipeline.mdc.hbs +0 -134
|
@@ -0,0 +1,2432 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { actionIdentity, artifactValue, configureContainedActionAuthority, containedActionAuthorityInput, deliveryActionAuthorityInput, exactAction, exactRollbackApprovalRecord, exactRollbackApprovalTemplate, exactRollbackPlanContext, GOVERNED_APPROVAL_TEMPLATE_ID, governedArtifactStore, governedDraft, later, mergeRecordsBy, sameActionIdentity, sameCanonicalValue, withVerificationArtifactReservations, } from './client/governance.js';
|
|
4
|
+
import { claimOperateAssignment, clearOperateStaleLock, createOperateComposition, createOperateStore, createProjectMeasurementScheduleService, createSpecForOperatingPlanning, ensureOperateStorageLayout, ingestPlanningDeliveryEvidence, inspectOperateRecovery, isOperatePublicId, loadOperateExperienceReaderOwner, MeasurementScheduleError, OPERATE_INTEGRITY_BOUNDARY, previewOperatingPlanningSpec, readCommittedOperateReviewReceipt, readOperateActionWorkspace, readOperateCycleWorkspace, readOperateExecutiveBoardDisplay, readOperateRecoveryDisplay, readOperateReview, restoreOperateGeneration, retryReplaySafeGenerationConflict, stageRuntimeAssignmentSubmission, startOperateCycle, submitBoundOperateReview, submitOperateReview, withOperateMutationLane, } from './client/lifecycle.js';
|
|
5
|
+
import { assertAcceptedLiveEvidenceBridgeV2, assertOperatingLiveEvidenceIngestionV2, assertProtocolArtifact, buildOperatingCycleWorkViewV2, buildOperatingRollbackPlanV2, buildOperatingTerminalVerificationInsufficientEvidenceV2, buildOperatingWorkLedgerV2, createDisposableLocalProjectTargetV2, createOperatingActionReviewV2, createOperatingApprovalRecordV2, createOperatingApprovalRequirementV2, createOperatingGovernedExecutionRuntimeV2, createOperatingGovernedRecoveryRuntimeV2, deriveOperateAuthorityAllowedActionsV2, evaluateOperatingActionPolicyV2, evaluateOperatingApprovalSetV2, OPEN_REFERENCE_PROJECT_EXECUTOR_HOST_V2, OPERATE_AUTHORITY_TOOL_CAPABILITIES_V2, preflightOperatingAssignmentResultV2, promoteOperatingActionAuthorityV2, readOperatingArtifactV2, recordOperatingRollbackPlanV2, recordOperatingTerminalVerificationInsufficientEvidenceV2, sha256Jcs, } from './client/runtime.js';
|
|
6
|
+
import { OperateClientError } from './client-error.js';
|
|
7
|
+
export { projectAccessSafeOperateSearchHits, } from './search-hit-contract.js';
|
|
8
|
+
const PROTOCOL_VERSION = '2.0.0';
|
|
9
|
+
const REVIEW_SUBMIT_CAPABILITY = Object.freeze({
|
|
10
|
+
id: 'operate-review-submit',
|
|
11
|
+
version: PROTOCOL_VERSION,
|
|
12
|
+
});
|
|
13
|
+
const SAFE_CODES = new Set([
|
|
14
|
+
'CYCLE_NOT_FOUND',
|
|
15
|
+
'CYCLE_TERMINAL',
|
|
16
|
+
'ASSIGNMENT_NOT_AVAILABLE',
|
|
17
|
+
'ASSIGNMENT_ALREADY_CLAIMED',
|
|
18
|
+
'ASSIGNMENT_ALREADY_SUBMITTED',
|
|
19
|
+
'ACTION_REVISION_MISMATCH',
|
|
20
|
+
'RESULT_CONTRACT_INVALID',
|
|
21
|
+
'SUBMISSION_ID_CONFLICT',
|
|
22
|
+
'CAPABILITY_DENIED',
|
|
23
|
+
'REVIEW_NOT_FOUND',
|
|
24
|
+
'REVIEW_NOT_PENDING',
|
|
25
|
+
'REVIEW_NOT_AUTHORIZED',
|
|
26
|
+
'STATE_TRANSITION_INVALID',
|
|
27
|
+
'ARTIFACT_NOT_FOUND',
|
|
28
|
+
'CONTRACT_VERSION_UNSUPPORTED',
|
|
29
|
+
'CONCURRENT_MODIFICATION',
|
|
30
|
+
'OPERATING_SCOPE_INVALID',
|
|
31
|
+
'DOMAIN_CONTRACT_UNSUPPORTED',
|
|
32
|
+
'OPERATE_STORE_CORRUPT',
|
|
33
|
+
'OPERATE_STORE_INCOMPATIBLE',
|
|
34
|
+
'OPERATE_STORE_CONFLICT',
|
|
35
|
+
'OPERATE_SUBJECT_NOT_FOUND',
|
|
36
|
+
'OPERATION_CONFLICT',
|
|
37
|
+
'OPERATION_UNCERTAIN',
|
|
38
|
+
'ROLLBACK_NOT_ELIGIBLE',
|
|
39
|
+
'APPROVAL_INVALID',
|
|
40
|
+
'APPROVAL_REQUIRED',
|
|
41
|
+
'POLICY_EVALUATION_REJECTED',
|
|
42
|
+
'E_OPERATE_PLANNING_ACCESS',
|
|
43
|
+
'E_OPERATE_PLANNING_BINDING',
|
|
44
|
+
'E_OPERATE_PLANNING_CONCURRENT',
|
|
45
|
+
'E_OPERATE_PLANNING_CONFIRMATION',
|
|
46
|
+
'E_OPERATE_PLANNING_CONFLICT',
|
|
47
|
+
'E_OPERATE_PLANNING_CUSTODY',
|
|
48
|
+
'E_OPERATE_PLANNING_INVALID',
|
|
49
|
+
'E_OPERATE_PLANNING_PATH',
|
|
50
|
+
'E_OPERATE_PLANNING_ROUTE',
|
|
51
|
+
'E_OPERATE_PLANNING_STALE',
|
|
52
|
+
'E_OPERATE_PLANNING_STATE',
|
|
53
|
+
'E_OPERATE_ORIGIN_INVALID',
|
|
54
|
+
'E_PROVENANCE_CONFLICT',
|
|
55
|
+
]);
|
|
56
|
+
function timestamp() {
|
|
57
|
+
return new Date().toISOString();
|
|
58
|
+
}
|
|
59
|
+
function id(prefix) {
|
|
60
|
+
return `${prefix}_${randomUUID().replaceAll('-', '')}`;
|
|
61
|
+
}
|
|
62
|
+
function stableId(prefix, value) {
|
|
63
|
+
return `${prefix}_${createHash('sha256').update(value).digest('hex').slice(0, 32)}`;
|
|
64
|
+
}
|
|
65
|
+
function replaySafeIssueFactory() {
|
|
66
|
+
const issued = new Map();
|
|
67
|
+
const allocate = (kind, index, create) => {
|
|
68
|
+
const values = issued.get(kind) ?? [];
|
|
69
|
+
if (!issued.has(kind))
|
|
70
|
+
issued.set(kind, values);
|
|
71
|
+
values[index] ??= create();
|
|
72
|
+
return values[index];
|
|
73
|
+
};
|
|
74
|
+
return () => {
|
|
75
|
+
const cursors = new Map();
|
|
76
|
+
const next = (kind, create) => {
|
|
77
|
+
const index = cursors.get(kind) ?? 0;
|
|
78
|
+
cursors.set(kind, index + 1);
|
|
79
|
+
return allocate(kind, index, create);
|
|
80
|
+
};
|
|
81
|
+
return Object.freeze({
|
|
82
|
+
id: (prefix) => next(`id:${prefix}`, () => id(prefix)),
|
|
83
|
+
stableId,
|
|
84
|
+
timestamp: () => next('timestamp', timestamp),
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function record(value) {
|
|
89
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
90
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The accepted lifecycle result is not a JSON object.', false);
|
|
91
|
+
}
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
function isLiveEvidenceAssignment(value) {
|
|
95
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
96
|
+
return false;
|
|
97
|
+
const assignment = value;
|
|
98
|
+
const outputContract = assignment.outputContract;
|
|
99
|
+
return (assignment.assignmentKind === 'verification' &&
|
|
100
|
+
outputContract !== null &&
|
|
101
|
+
typeof outputContract === 'object' &&
|
|
102
|
+
!Array.isArray(outputContract) &&
|
|
103
|
+
outputContract.schemaId === 'operating-live-evidence-ingestion' &&
|
|
104
|
+
outputContract.schemaVersion === '2.0.0' &&
|
|
105
|
+
outputContract.mediaType === 'application/json' &&
|
|
106
|
+
outputContract.encoding === 'utf-8');
|
|
107
|
+
}
|
|
108
|
+
function liveEvidenceSubmissionPreparation(runtime, input) {
|
|
109
|
+
const snapshot = state(runtime);
|
|
110
|
+
const assignment = snapshot.assignments.find((candidate) => candidate.assignmentId === input.assignmentId);
|
|
111
|
+
const submission = snapshot.submissions.find((candidate) => candidate.assignmentId === input.assignmentId &&
|
|
112
|
+
candidate.submissionId === input.submissionId);
|
|
113
|
+
const claim = assignment?.claim !== null &&
|
|
114
|
+
typeof assignment?.claim === 'object' &&
|
|
115
|
+
!Array.isArray(assignment.claim)
|
|
116
|
+
? assignment.claim
|
|
117
|
+
: null;
|
|
118
|
+
if (!assignment ||
|
|
119
|
+
!submission ||
|
|
120
|
+
!isLiveEvidenceAssignment(assignment) ||
|
|
121
|
+
!['running', 'validated'].includes(String(assignment.state)) ||
|
|
122
|
+
!['issued', 'accepted'].includes(String(submission.state)) ||
|
|
123
|
+
claim === null ||
|
|
124
|
+
claim.actorId !== input.actor.actorId ||
|
|
125
|
+
claim.actorKind !== input.actor.kind ||
|
|
126
|
+
claim.runtime !== input.actor.runtime) {
|
|
127
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'Live evidence requires the exact retained claimant and issued ingestion Assignment.', false, { assignmentId: input.assignmentId, submissionId: input.submissionId });
|
|
128
|
+
}
|
|
129
|
+
const artifactId = runtime.preferences.assignmentArtifactIds[input.assignmentId];
|
|
130
|
+
if (typeof artifactId !== 'string' || artifactId.length === 0) {
|
|
131
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'The live-evidence Assignment lost its runtime-owned Artifact reservation.', false, { assignmentId: input.assignmentId });
|
|
132
|
+
}
|
|
133
|
+
const issuedAssignment = assignment.state === 'validated'
|
|
134
|
+
? { ...structuredClone(assignment), state: 'running', completedAt: null }
|
|
135
|
+
: structuredClone(assignment);
|
|
136
|
+
const identities = {
|
|
137
|
+
assignmentHash: sha256Jcs(issuedAssignment),
|
|
138
|
+
assignmentId: input.assignmentId,
|
|
139
|
+
submissionId: input.submissionId,
|
|
140
|
+
artifactId,
|
|
141
|
+
ingestionId: stableId('ling', `live-evidence-ingestion:${input.submissionId}`),
|
|
142
|
+
candidateId: stableId('evc', `live-evidence-candidate:${input.submissionId}`),
|
|
143
|
+
evidenceRefId: stableId('evr', `live-evidence-ref:${input.submissionId}`),
|
|
144
|
+
evidenceArtifactId: stableId('art', `live-evidence-snapshot:${input.submissionId}`),
|
|
145
|
+
evidenceResolutionId: stableId('evs', `live-evidence-resolution:${input.submissionId}`),
|
|
146
|
+
resolutionEventId: stableId('evt', `live-evidence-resolution:${input.submissionId}`),
|
|
147
|
+
acceptanceEventIds: {
|
|
148
|
+
submitted: stableId('evt', `${input.submissionId}:submitted`),
|
|
149
|
+
artifactCreated: stableId('evt', `${input.submissionId}:artifact-created`),
|
|
150
|
+
validated: stableId('evt', `${input.submissionId}:validated`),
|
|
151
|
+
},
|
|
152
|
+
correlationId: stableId('corr', `live-evidence:${input.submissionId}`),
|
|
153
|
+
};
|
|
154
|
+
return Object.freeze({
|
|
155
|
+
assignment: issuedAssignment,
|
|
156
|
+
submissionId: identities.submissionId,
|
|
157
|
+
artifactId: identities.artifactId,
|
|
158
|
+
ingestionId: identities.ingestionId,
|
|
159
|
+
candidateId: identities.candidateId,
|
|
160
|
+
evidenceRefId: identities.evidenceRefId,
|
|
161
|
+
evidenceArtifactId: identities.evidenceArtifactId,
|
|
162
|
+
evidenceResolutionId: identities.evidenceResolutionId,
|
|
163
|
+
resolutionEventId: identities.resolutionEventId,
|
|
164
|
+
acceptanceEventIds: Object.freeze({ ...identities.acceptanceEventIds }),
|
|
165
|
+
correlationId: identities.correlationId,
|
|
166
|
+
preparationHash: sha256Jcs(identities),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function parseLiveEvidenceIngestion(contentBase64) {
|
|
170
|
+
let decoded;
|
|
171
|
+
let value;
|
|
172
|
+
try {
|
|
173
|
+
const bytes = Buffer.from(contentBase64, 'base64');
|
|
174
|
+
if (bytes.toString('base64') !== contentBase64)
|
|
175
|
+
throw new Error('non-canonical base64');
|
|
176
|
+
decoded = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
177
|
+
value = JSON.parse(decoded);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'Live-evidence submission bytes must be canonical base64 containing valid UTF-8 JSON.', false);
|
|
181
|
+
}
|
|
182
|
+
return record(value);
|
|
183
|
+
}
|
|
184
|
+
function exactAuditDisplayRequest(value) {
|
|
185
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
186
|
+
return false;
|
|
187
|
+
try {
|
|
188
|
+
const prototype = Object.getPrototypeOf(value);
|
|
189
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
190
|
+
return false;
|
|
191
|
+
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
192
|
+
const keys = Reflect.ownKeys(descriptors);
|
|
193
|
+
const allowed = new Set(['cycleId', 'actor', 'surface', 'subjectId', 'query', 'format']);
|
|
194
|
+
if (!(keys.every((key) => typeof key === 'string' &&
|
|
195
|
+
allowed.has(key) &&
|
|
196
|
+
descriptors[key]?.get === undefined &&
|
|
197
|
+
descriptors[key]?.set === undefined) && ['cycleId', 'actor', 'surface'].every((key) => Object.hasOwn(descriptors, key)))) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
const cycleId = descriptors.cycleId?.value;
|
|
201
|
+
const surface = descriptors.surface?.value;
|
|
202
|
+
const hasSubject = Object.hasOwn(descriptors, 'subjectId');
|
|
203
|
+
const subjectId = descriptors.subjectId?.value;
|
|
204
|
+
const hasQuery = Object.hasOwn(descriptors, 'query');
|
|
205
|
+
const query = descriptors.query?.value;
|
|
206
|
+
const hasFormat = Object.hasOwn(descriptors, 'format');
|
|
207
|
+
const format = descriptors.format?.value;
|
|
208
|
+
if (!isOperatePublicId(cycleId) ||
|
|
209
|
+
!['evidence', 'outcomes', 'outcome', 'history', 'search', 'export'].includes(surface) ||
|
|
210
|
+
(hasSubject && !isOperatePublicId(subjectId)) ||
|
|
211
|
+
(surface === 'outcome' && !hasSubject) ||
|
|
212
|
+
(!['evidence', 'outcome'].includes(surface) && hasSubject) ||
|
|
213
|
+
(hasQuery && (typeof query !== 'string' || query.length > 512)) ||
|
|
214
|
+
(surface !== 'search' && hasQuery) ||
|
|
215
|
+
(hasFormat && !['json', 'html'].includes(format)) ||
|
|
216
|
+
(surface !== 'export' && hasFormat)) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
const actor = descriptors.actor?.value;
|
|
220
|
+
if (actor === null || typeof actor !== 'object' || Array.isArray(actor))
|
|
221
|
+
return false;
|
|
222
|
+
const actorPrototype = Object.getPrototypeOf(actor);
|
|
223
|
+
if (actorPrototype !== Object.prototype && actorPrototype !== null)
|
|
224
|
+
return false;
|
|
225
|
+
const actorDescriptors = Object.getOwnPropertyDescriptors(actor);
|
|
226
|
+
const actorKeys = Reflect.ownKeys(actorDescriptors);
|
|
227
|
+
if (!actorKeys.every((key) => typeof key === 'string' &&
|
|
228
|
+
['actorId', 'kind', 'runtime'].includes(key) &&
|
|
229
|
+
actorDescriptors[key]?.get === undefined &&
|
|
230
|
+
actorDescriptors[key]?.set === undefined) &&
|
|
231
|
+
['actorId', 'kind'].every((key) => Object.hasOwn(actorDescriptors, key))) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
const actorId = actorDescriptors.actorId?.value;
|
|
235
|
+
const kind = actorDescriptors.kind?.value;
|
|
236
|
+
const hasRuntime = Object.hasOwn(actorDescriptors, 'runtime');
|
|
237
|
+
const runtime = actorDescriptors.runtime?.value;
|
|
238
|
+
return (isOperatePublicId(actorId) &&
|
|
239
|
+
['agent', 'human'].includes(kind) &&
|
|
240
|
+
(!hasRuntime || (typeof runtime === 'string' && runtime.length > 0 && runtime.length <= 128)));
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function state(runtime) {
|
|
247
|
+
return runtime.state;
|
|
248
|
+
}
|
|
249
|
+
function findBy(entries, key, value) {
|
|
250
|
+
return entries.find((entry) => entry[key] === value);
|
|
251
|
+
}
|
|
252
|
+
function cycleReadAction(cycleId) {
|
|
253
|
+
return {
|
|
254
|
+
tool: 'operate.cycle.get',
|
|
255
|
+
arguments: { cycleId },
|
|
256
|
+
label: 'Inspect the current cycle',
|
|
257
|
+
effect: 'read-only',
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function recoveryAction() {
|
|
261
|
+
return {
|
|
262
|
+
tool: 'operate.recovery.inspect',
|
|
263
|
+
arguments: {},
|
|
264
|
+
label: 'Inspect safe recovery options',
|
|
265
|
+
effect: 'read-only',
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function cycleReadActions(cycleId, _actor) {
|
|
269
|
+
return [cycleReadAction(cycleId)];
|
|
270
|
+
}
|
|
271
|
+
function assignmentActor(assignment) {
|
|
272
|
+
const claim = assignment.claim;
|
|
273
|
+
if (!claim || typeof claim !== 'object' || Array.isArray(claim))
|
|
274
|
+
return undefined;
|
|
275
|
+
const actorId = claim.actorId;
|
|
276
|
+
const runtime = claim.runtime;
|
|
277
|
+
if (typeof actorId !== 'string' || !actorId || typeof runtime !== 'string' || !runtime) {
|
|
278
|
+
return undefined;
|
|
279
|
+
}
|
|
280
|
+
return { actorId, kind: 'agent', runtime };
|
|
281
|
+
}
|
|
282
|
+
function isDurableCycleActor(runtime, snapshot, cycleId, actor) {
|
|
283
|
+
if (actor.kind === 'human' &&
|
|
284
|
+
runtime.preferences.reviewOwners[cycleId] === actor.actorId &&
|
|
285
|
+
runtime.preferences.actorMemberships[actor.actorId]?.role === 'owner') {
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
if (actor.kind !== 'agent' || !actor.runtime)
|
|
289
|
+
return false;
|
|
290
|
+
return snapshot.assignments.some((assignment) => {
|
|
291
|
+
if (assignment.cycleId !== cycleId)
|
|
292
|
+
return false;
|
|
293
|
+
const claimed = assignmentActor(assignment);
|
|
294
|
+
return claimed?.actorId === actor.actorId && claimed.runtime === actor.runtime;
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
function bindActorActions(actions, actor, approvedWorkDispositions) {
|
|
298
|
+
return actions.map((action) => {
|
|
299
|
+
const tool = String(action.tool ?? '');
|
|
300
|
+
if (!['operate.review.get', 'operate.review.submit'].includes(tool))
|
|
301
|
+
return action;
|
|
302
|
+
const argumentsValue = record(action.arguments);
|
|
303
|
+
return {
|
|
304
|
+
...action,
|
|
305
|
+
arguments: {
|
|
306
|
+
...argumentsValue,
|
|
307
|
+
actor,
|
|
308
|
+
...(tool === 'operate.review.submit' && argumentsValue.disposition === 'approved'
|
|
309
|
+
? { workDispositions: approvedWorkDispositions }
|
|
310
|
+
: {}),
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
function projectAllowedAction(action) {
|
|
316
|
+
if (['operate.assignment.submit', 'operate.review.get', 'operate.review.submit'].includes(String(action.tool))) {
|
|
317
|
+
return structuredClone(action);
|
|
318
|
+
}
|
|
319
|
+
const argumentsValue = record(action.arguments);
|
|
320
|
+
const { actor: _actor, ...publicArguments } = argumentsValue;
|
|
321
|
+
return {
|
|
322
|
+
...action,
|
|
323
|
+
arguments: publicArguments,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function governedExperienceActions(runtime, snapshot, cycle, actor) {
|
|
327
|
+
const projected = [];
|
|
328
|
+
for (const action of snapshot.actions.filter((candidate) => candidate.sourceCycleId === cycle.cycleId)) {
|
|
329
|
+
if (!Object.hasOwn(action, 'actionHash'))
|
|
330
|
+
continue;
|
|
331
|
+
const evaluations = (snapshot.policyEvaluations ?? [])
|
|
332
|
+
.filter((candidate) => record(candidate.action).actionId === action.actionId &&
|
|
333
|
+
record(candidate.action).revision === action.revision &&
|
|
334
|
+
record(candidate.action).actionHash === action.actionHash)
|
|
335
|
+
.sort((left, right) => String(left.evaluatedAt).localeCompare(String(right.evaluatedAt)) ||
|
|
336
|
+
String(left.evaluationId).localeCompare(String(right.evaluationId)));
|
|
337
|
+
const evaluation = evaluations.at(-1);
|
|
338
|
+
if (!evaluation)
|
|
339
|
+
continue;
|
|
340
|
+
const requirements = (snapshot.approvalRequirements ?? []).filter((candidate) => candidate.evaluationId === evaluation.evaluationId);
|
|
341
|
+
const approvals = (snapshot.approvalRecords ?? []).filter((candidate) => candidate.evaluationId === evaluation.evaluationId);
|
|
342
|
+
const effectivePolicy = (snapshot.actionPolicies ?? []).find((candidate) => candidate.policyId === record(evaluation.policy).policyId &&
|
|
343
|
+
candidate.policyVersion === record(evaluation.policy).policyVersion &&
|
|
344
|
+
candidate.policyHash === record(evaluation.policy).policyHash);
|
|
345
|
+
if (!effectivePolicy)
|
|
346
|
+
continue;
|
|
347
|
+
if (action.state === 'proposed' &&
|
|
348
|
+
cycle.state === 'approved' &&
|
|
349
|
+
!snapshot.reviews.some((review) => review.state === 'pending' && record(review.subject).actionId === action.actionId)) {
|
|
350
|
+
const party = requirements
|
|
351
|
+
.flatMap((requirement) => Array.isArray(requirement.parties) ? requirement.parties : [])
|
|
352
|
+
.find((candidate) => candidate.actorKind === actor.kind && candidate.actorId === actor.actorId);
|
|
353
|
+
if (party) {
|
|
354
|
+
try {
|
|
355
|
+
const allowed = deriveOperateAuthorityAllowedActionsV2({
|
|
356
|
+
actor: {
|
|
357
|
+
...actor,
|
|
358
|
+
capabilities: [
|
|
359
|
+
{
|
|
360
|
+
id: String(record(party.requiredCapability).id),
|
|
361
|
+
version: String(record(party.requiredCapability).version),
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
capabilities: [
|
|
366
|
+
structuredClone(OPERATE_AUTHORITY_TOOL_CAPABILITIES_V2['operate.action.approve']),
|
|
367
|
+
],
|
|
368
|
+
now: timestamp(),
|
|
369
|
+
action: action,
|
|
370
|
+
scope: {
|
|
371
|
+
scopeId: String(action.scopeId),
|
|
372
|
+
domainId: String(action.domainId),
|
|
373
|
+
domainVersion: String(action.domainVersion),
|
|
374
|
+
},
|
|
375
|
+
target: action.targetBinding,
|
|
376
|
+
actionPolicy: effectivePolicy,
|
|
377
|
+
actionPolicies: snapshot.actionPolicies,
|
|
378
|
+
policyEvaluation: evaluation,
|
|
379
|
+
approvalRequirements: requirements,
|
|
380
|
+
approvals: approvals,
|
|
381
|
+
});
|
|
382
|
+
projected.push(...allowed
|
|
383
|
+
.filter((candidate) => candidate.tool === 'operate.action.approve' &&
|
|
384
|
+
record(candidate.arguments).decision === 'approved')
|
|
385
|
+
.map((candidate) => ({
|
|
386
|
+
subjectId: String(action.actionId),
|
|
387
|
+
action: candidate,
|
|
388
|
+
})));
|
|
389
|
+
}
|
|
390
|
+
catch {
|
|
391
|
+
// The experience is fail-closed: malformed or expired authority emits
|
|
392
|
+
// no browser command and the public state remains readable.
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (action.state === 'approved' && cycle.state === 'approved') {
|
|
397
|
+
try {
|
|
398
|
+
const disposition = evaluateOperatingApprovalSetV2({
|
|
399
|
+
evaluation: evaluation,
|
|
400
|
+
action: action,
|
|
401
|
+
requirements: requirements,
|
|
402
|
+
approvals: approvals,
|
|
403
|
+
now: timestamp(),
|
|
404
|
+
});
|
|
405
|
+
const ownsOperation = snapshot.governedOperations.some((operation) => record(operation.action).actionId === action.actionId);
|
|
406
|
+
if (disposition.complete && disposition.disposition === 'approved' && !ownsOperation) {
|
|
407
|
+
projected.push({
|
|
408
|
+
subjectId: String(action.actionId),
|
|
409
|
+
action: {
|
|
410
|
+
tool: 'operate.action.execute',
|
|
411
|
+
arguments: { action: actionIdentity(action) },
|
|
412
|
+
label: 'Execute this exact approved Action',
|
|
413
|
+
effect: action.effectClass,
|
|
414
|
+
},
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
catch {
|
|
419
|
+
// Closed omission; the execution runtime performs the full authority
|
|
420
|
+
// chain again before any contained target is reachable.
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (action.state === 'completed') {
|
|
424
|
+
const operations = snapshot.governedOperations.filter((operation) => record(operation.action).actionId === action.actionId);
|
|
425
|
+
if (!snapshot.outcomes.some((outcome) => outcome.verificationPlanId === action.verificationPlanId)) {
|
|
426
|
+
const terminal = [...operations]
|
|
427
|
+
.filter((operation) => operation.state === 'succeeded')
|
|
428
|
+
.sort((left, right) => String(left.updatedAt).localeCompare(String(right.updatedAt)))
|
|
429
|
+
.at(-1);
|
|
430
|
+
const assignment = terminal
|
|
431
|
+
? snapshot.assignments.find((candidate) => candidate.assignmentKind === 'verification' &&
|
|
432
|
+
candidate.governedOperationId === terminal.operationId &&
|
|
433
|
+
candidate.state === 'running' &&
|
|
434
|
+
record(candidate.claim).actorId === actor.actorId)
|
|
435
|
+
: null;
|
|
436
|
+
const submission = assignment
|
|
437
|
+
? snapshot.submissions.find((candidate) => candidate.assignmentId === assignment.assignmentId && candidate.state === 'issued')
|
|
438
|
+
: null;
|
|
439
|
+
const verificationPlan = snapshot.verificationPlans.find((candidate) => candidate.verificationPlanId === action.verificationPlanId);
|
|
440
|
+
const sourceArtifactId = assignment
|
|
441
|
+
? runtime.preferences.assignmentArtifactIds[String(assignment.assignmentId)]
|
|
442
|
+
: null;
|
|
443
|
+
if (assignment && submission && verificationPlan && typeof sourceArtifactId === 'string') {
|
|
444
|
+
try {
|
|
445
|
+
const claimant = record(assignment.claim);
|
|
446
|
+
const records = buildOperatingTerminalVerificationInsufficientEvidenceV2({
|
|
447
|
+
action: action,
|
|
448
|
+
verificationPlan: verificationPlan,
|
|
449
|
+
assignment: assignment,
|
|
450
|
+
sourceArtifactId,
|
|
451
|
+
timestamp: String(submission.issuedAt),
|
|
452
|
+
});
|
|
453
|
+
const allowedAction = {
|
|
454
|
+
subjectId: String(assignment.assignmentId),
|
|
455
|
+
action: {
|
|
456
|
+
tool: 'operate.assignment.submit',
|
|
457
|
+
arguments: {
|
|
458
|
+
assignmentId: assignment.assignmentId,
|
|
459
|
+
submissionId: submission.submissionId,
|
|
460
|
+
actor: {
|
|
461
|
+
actorId: claimant.actorId,
|
|
462
|
+
kind: claimant.actorKind,
|
|
463
|
+
runtime: claimant.runtime,
|
|
464
|
+
},
|
|
465
|
+
mediaType: 'application/json',
|
|
466
|
+
encoding: 'utf-8',
|
|
467
|
+
contentBase64: Buffer.from(JSON.stringify(records.outcome)).toString('base64'),
|
|
468
|
+
},
|
|
469
|
+
label: 'Record that verification lacks accepted metric evidence',
|
|
470
|
+
effect: 'machine-local-write',
|
|
471
|
+
},
|
|
472
|
+
};
|
|
473
|
+
projected.push(allowedAction);
|
|
474
|
+
}
|
|
475
|
+
catch {
|
|
476
|
+
// Closed omission. The recording transaction independently proves
|
|
477
|
+
// the accepted Assignment bytes and full terminal authority chain.
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
const rollbackPlans = snapshot.rollbackPlans.filter((candidate) => sameActionIdentity(candidate.action, action) &&
|
|
482
|
+
['eligible', 'required'].includes(String(candidate.eligibility)));
|
|
483
|
+
if (rollbackPlans.length > 0) {
|
|
484
|
+
const { operation: original, plan, binding } = exactRollbackPlanContext(snapshot, action);
|
|
485
|
+
const bindingHash = sha256Jcs({
|
|
486
|
+
contract: 'openplanr-rollback-approval-v1',
|
|
487
|
+
action: actionIdentity(action),
|
|
488
|
+
...binding,
|
|
489
|
+
});
|
|
490
|
+
const template = exactRollbackApprovalTemplate(snapshot, action, actor);
|
|
491
|
+
const approvalReady = exactRollbackApprovalRecord(snapshot, action, actor, template, bindingHash, String(snapshot.generatedAt)) !== null;
|
|
492
|
+
if (approvalReady) {
|
|
493
|
+
projected.push({
|
|
494
|
+
subjectId: String(action.actionId),
|
|
495
|
+
action: {
|
|
496
|
+
tool: 'operate.action.rollback',
|
|
497
|
+
arguments: {
|
|
498
|
+
action: actionIdentity(action),
|
|
499
|
+
originalOperationId: original.operationId,
|
|
500
|
+
rollbackPlanId: plan.rollbackPlanId,
|
|
501
|
+
},
|
|
502
|
+
label: 'Rollback this exact reversible Action',
|
|
503
|
+
effect: action.effectClass,
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
projected.push({
|
|
509
|
+
subjectId: String(action.actionId),
|
|
510
|
+
action: {
|
|
511
|
+
tool: 'operate.action.approve',
|
|
512
|
+
arguments: {
|
|
513
|
+
action: actionIdentity(action),
|
|
514
|
+
decision: 'approved',
|
|
515
|
+
rollback: binding,
|
|
516
|
+
},
|
|
517
|
+
label: 'Approve this exact rollback plan',
|
|
518
|
+
effect: action.effectClass,
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return projected;
|
|
526
|
+
}
|
|
527
|
+
function errorCode(value) {
|
|
528
|
+
const candidate = value?.code;
|
|
529
|
+
return typeof candidate === 'string' && SAFE_CODES.has(candidate)
|
|
530
|
+
? candidate
|
|
531
|
+
: 'STATE_TRANSITION_INVALID';
|
|
532
|
+
}
|
|
533
|
+
function errorContext(value) {
|
|
534
|
+
const details = value?.details;
|
|
535
|
+
const candidate = details && typeof details === 'object' && !Array.isArray(details)
|
|
536
|
+
? (details.context ?? details)
|
|
537
|
+
: value?.context;
|
|
538
|
+
if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate))
|
|
539
|
+
return {};
|
|
540
|
+
return Object.fromEntries(Object.entries(candidate).filter(([, entry]) => typeof entry === 'string' ||
|
|
541
|
+
typeof entry === 'number' ||
|
|
542
|
+
typeof entry === 'boolean' ||
|
|
543
|
+
entry === null));
|
|
544
|
+
}
|
|
545
|
+
function previousEvent(runtime) {
|
|
546
|
+
const last = runtime.events.at(-1);
|
|
547
|
+
if (last)
|
|
548
|
+
return last;
|
|
549
|
+
const head = state(runtime).eventHead;
|
|
550
|
+
return head.sequence === 0 ? null : { sequence: head.sequence, eventHash: head.hash };
|
|
551
|
+
}
|
|
552
|
+
function cycleView(runtime, cycleId) {
|
|
553
|
+
const snapshot = state(runtime);
|
|
554
|
+
const cycle = findBy(snapshot.cycles, 'cycleId', cycleId);
|
|
555
|
+
if (!cycle) {
|
|
556
|
+
throw new OperateClientError('CYCLE_NOT_FOUND', 'The requested cycle does not exist.', false, {
|
|
557
|
+
cycleId,
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
const assignmentIds = new Set(Object.values(runtime.preferences.cycleRoleAssignments[cycleId] ?? {}));
|
|
561
|
+
const assignments = snapshot.assignments.filter((entry) => entry.cycleId === cycleId && assignmentIds.has(String(entry.assignmentId)));
|
|
562
|
+
const decisions = snapshot.decisions.filter((entry) => entry.sourceCycleId === cycleId);
|
|
563
|
+
const actions = snapshot.actions.filter((entry) => entry.sourceCycleId === cycleId);
|
|
564
|
+
const actionIds = new Set(actions.map((entry) => entry.actionId));
|
|
565
|
+
const outcomes = snapshot.outcomes.filter((entry) => actionIds.has(entry.actionId));
|
|
566
|
+
const outcomeIds = new Set(outcomes.map((entry) => entry.outcomeId));
|
|
567
|
+
const learnings = snapshot.learnings.filter((entry) => outcomeIds.has(entry.outcomeId));
|
|
568
|
+
const verificationPlans = snapshot.verificationPlans.filter((entry) => actionIds.has(entry.actionId));
|
|
569
|
+
const planId = runtime.preferences.cycleIntelligencePlanIds[cycleId];
|
|
570
|
+
const plan = snapshot.intelligencePlans.find((entry) => entry.planId === planId) ?? null;
|
|
571
|
+
const count = (...states) => assignments.filter((assignment) => states.includes(String(assignment.state))).length;
|
|
572
|
+
return {
|
|
573
|
+
generation: runtime.generation,
|
|
574
|
+
cycle,
|
|
575
|
+
progress: {
|
|
576
|
+
total: assignments.length,
|
|
577
|
+
pending: count('pending'),
|
|
578
|
+
available: count('available'),
|
|
579
|
+
active: count('claimed', 'running'),
|
|
580
|
+
submitted: count('submitted'),
|
|
581
|
+
validated: count('validated'),
|
|
582
|
+
rejected: count('rejected'),
|
|
583
|
+
terminal: count('validated', 'abandoned', 'failed'),
|
|
584
|
+
},
|
|
585
|
+
availableAssignments: assignments.filter((entry) => entry.state === 'available'),
|
|
586
|
+
assignments,
|
|
587
|
+
roleAssignments: runtime.preferences.cycleRoleAssignments[cycleId] ?? {},
|
|
588
|
+
intelligencePlan: plan,
|
|
589
|
+
activeReview: snapshot.reviews.find((entry) => entry.cycleId === cycleId && entry.state === 'pending') ??
|
|
590
|
+
null,
|
|
591
|
+
findings: snapshot.findings.filter((entry) => entry.sourceCycleId === cycleId),
|
|
592
|
+
decisions,
|
|
593
|
+
actions,
|
|
594
|
+
verificationPlans,
|
|
595
|
+
outcomes,
|
|
596
|
+
learnings,
|
|
597
|
+
lifecycle: {
|
|
598
|
+
decisionAcceptance: decisions.map((decision) => ({
|
|
599
|
+
decisionId: decision.decisionId,
|
|
600
|
+
state: decision.state,
|
|
601
|
+
acceptance: decision.state === 'approved'
|
|
602
|
+
? 'accepted'
|
|
603
|
+
: decision.state === 'deferred'
|
|
604
|
+
? 'deferred-pending-accepted-outcome'
|
|
605
|
+
: decision.state === 'proposed'
|
|
606
|
+
? 'awaiting-human-review'
|
|
607
|
+
: 'not-accepted',
|
|
608
|
+
})),
|
|
609
|
+
actionApproval: actions.map((action) => ({
|
|
610
|
+
actionId: action.actionId,
|
|
611
|
+
state: action.state,
|
|
612
|
+
approval: action.state === 'approved' ? 'approved' : 'not-approved',
|
|
613
|
+
})),
|
|
614
|
+
verification: {
|
|
615
|
+
state: actions.some((action) => action.state === 'approved')
|
|
616
|
+
? 'planned-not-yet-executed'
|
|
617
|
+
: 'not-yet-planned',
|
|
618
|
+
planIds: verificationPlans.map((entry) => entry.verificationPlanId),
|
|
619
|
+
assignmentState: 'not-yet-produced-before-terminal-execution',
|
|
620
|
+
resultState: 'not-yet-produced-before-verification',
|
|
621
|
+
},
|
|
622
|
+
outcomeState: outcomes.length > 0 ? 'observed' : 'not-yet-produced',
|
|
623
|
+
learningState: learnings.length > 0 ? 'recorded' : 'not-yet-produced',
|
|
624
|
+
},
|
|
625
|
+
acceptedArtifacts: snapshot.artifacts.filter((entry) => entry.cycleId === cycleId),
|
|
626
|
+
acceptedArtifactIds: snapshot.artifacts
|
|
627
|
+
.filter((entry) => entry.cycleId === cycleId)
|
|
628
|
+
.map((entry) => entry.artifactId),
|
|
629
|
+
integrityBoundary: OPERATE_INTEGRITY_BOUNDARY,
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
function canonicalCycleEnvelope(runtime, cycleId, operation) {
|
|
633
|
+
const snapshot = state(runtime);
|
|
634
|
+
const legacy = cycleView(runtime, cycleId);
|
|
635
|
+
const cycle = record(legacy.cycle);
|
|
636
|
+
const ledger = buildOperatingWorkLedgerV2(snapshot, cycle, {
|
|
637
|
+
generatedAt: String(snapshot.generatedAt),
|
|
638
|
+
});
|
|
639
|
+
const cycleWork = buildOperatingCycleWorkViewV2(snapshot, cycleId, {
|
|
640
|
+
generatedAt: String(snapshot.generatedAt),
|
|
641
|
+
});
|
|
642
|
+
const ownerActions = cycleReadActions(cycleId);
|
|
643
|
+
const projected = {
|
|
644
|
+
cycle,
|
|
645
|
+
progress: legacy.progress,
|
|
646
|
+
availableAssignments: legacy.availableAssignments,
|
|
647
|
+
acceptedArtifactIds: legacy.acceptedArtifactIds,
|
|
648
|
+
persistentWork: {
|
|
649
|
+
ledger,
|
|
650
|
+
cycleLinks: cycleWork.cycleLinks,
|
|
651
|
+
},
|
|
652
|
+
actions: ownerActions,
|
|
653
|
+
};
|
|
654
|
+
return assertProtocolArtifact('operate-api-envelope', {
|
|
655
|
+
ok: true,
|
|
656
|
+
operation,
|
|
657
|
+
data: projected,
|
|
658
|
+
allowedActions: ownerActions,
|
|
659
|
+
}, { protocolVersion: PROTOCOL_VERSION });
|
|
660
|
+
}
|
|
661
|
+
function defaultWorkDispositions(snapshot, cycleId) {
|
|
662
|
+
return [
|
|
663
|
+
...snapshot.findings
|
|
664
|
+
.filter((entry) => entry.sourceCycleId === cycleId && ['open', 'deferred'].includes(String(entry.state)))
|
|
665
|
+
.map((entry) => ({
|
|
666
|
+
entityType: 'operating-finding',
|
|
667
|
+
entityId: entry.findingId,
|
|
668
|
+
disposition: entry.state === 'deferred' ? 'deferred' : 'accepted',
|
|
669
|
+
})),
|
|
670
|
+
...snapshot.decisions
|
|
671
|
+
.filter((entry) => entry.sourceCycleId === cycleId && entry.state === 'proposed')
|
|
672
|
+
.map((entry) => ({
|
|
673
|
+
entityType: 'operating-decision',
|
|
674
|
+
entityId: entry.decisionId,
|
|
675
|
+
disposition: 'approved',
|
|
676
|
+
})),
|
|
677
|
+
...snapshot.actions
|
|
678
|
+
.filter((entry) => entry.sourceCycleId === cycleId && entry.state === 'proposed')
|
|
679
|
+
.map((entry) => ({
|
|
680
|
+
entityType: 'operating-action',
|
|
681
|
+
entityId: entry.actionId,
|
|
682
|
+
disposition: 'approved',
|
|
683
|
+
})),
|
|
684
|
+
];
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* OpenPlanr composition over the installed public Operate package. Every
|
|
688
|
+
* request first reconstructs state from canonical Event replay records; this class
|
|
689
|
+
* never imports package-private reducers, fixtures, schemas, or sibling source.
|
|
690
|
+
*/
|
|
691
|
+
export class OperateClient {
|
|
692
|
+
root;
|
|
693
|
+
projectDir;
|
|
694
|
+
store;
|
|
695
|
+
containedTargets = new Map();
|
|
696
|
+
compositionPromise = null;
|
|
697
|
+
measurementPromise = null;
|
|
698
|
+
constructor(projectDir) {
|
|
699
|
+
this.store = createOperateStore(projectDir);
|
|
700
|
+
this.root = this.store.root;
|
|
701
|
+
this.projectDir = path.resolve(projectDir);
|
|
702
|
+
}
|
|
703
|
+
async measurement(input) {
|
|
704
|
+
const effects = (scheduleWrite = false) => Object.freeze([
|
|
705
|
+
Object.freeze({ id: 'schedule-custody-write', executed: scheduleWrite }),
|
|
706
|
+
Object.freeze({ id: 'due-work-issue', executed: false }),
|
|
707
|
+
Object.freeze({ id: 'provider-call', executed: false }),
|
|
708
|
+
]);
|
|
709
|
+
const success = (data, options) => Object.freeze({
|
|
710
|
+
ok: true,
|
|
711
|
+
operation: input.operation,
|
|
712
|
+
effects: effects(options.scheduleWrite),
|
|
713
|
+
authorityRequired: options.authorityRequired ?? false,
|
|
714
|
+
ownerActionRequired: options.ownerActionRequired ?? false,
|
|
715
|
+
nextAction: options.nextAction,
|
|
716
|
+
recovery: null,
|
|
717
|
+
data: Object.freeze(structuredClone(data)),
|
|
718
|
+
});
|
|
719
|
+
try {
|
|
720
|
+
const service = await this.measurementService();
|
|
721
|
+
if (input.operation === 'measurement.preview') {
|
|
722
|
+
const candidate = service.preview(input.schedule);
|
|
723
|
+
this.assertMeasurementActor(input.actor, candidate.ownerActorId);
|
|
724
|
+
return success({ schedule: candidate, confirmationDigest: candidate.scheduleHash }, {
|
|
725
|
+
authorityRequired: true,
|
|
726
|
+
ownerActionRequired: true,
|
|
727
|
+
nextAction: 'The named owner must confirm this exact schedule digest before enabling it.',
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
if (input.operation === 'measurement.enable') {
|
|
731
|
+
const candidate = service.preview(input.schedule);
|
|
732
|
+
await this.assertCurrentMeasurementOwner(input.actor, candidate.ownerActorId);
|
|
733
|
+
if (input.confirmDigest !== candidate.scheduleHash) {
|
|
734
|
+
throw new MeasurementScheduleError('E_MEASUREMENT_CONFIRMATION_REQUIRED', 'Measurement confirmation does not match the exact previewed schedule.');
|
|
735
|
+
}
|
|
736
|
+
const applied = await service.enable(candidate, input.transition);
|
|
737
|
+
return success({ schedule: applied.schedule, receipt: applied.receipt, replayed: applied.replay }, {
|
|
738
|
+
scheduleWrite: !applied.replay,
|
|
739
|
+
nextAction: applied.replay
|
|
740
|
+
? 'The exact enable transition was already recorded.'
|
|
741
|
+
: 'Inspect schedule status; no monitor or provider was started.',
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
if (input.operation === 'measurement.disable') {
|
|
745
|
+
const current = await service.read(input.scheduleId);
|
|
746
|
+
await this.assertCurrentMeasurementOwner(input.actor, current.schedule.ownerActorId);
|
|
747
|
+
if (input.confirmDigest !== current.schedule.scheduleHash) {
|
|
748
|
+
throw new MeasurementScheduleError('E_MEASUREMENT_CONFIRMATION_REQUIRED', 'Measurement confirmation does not match current schedule custody.');
|
|
749
|
+
}
|
|
750
|
+
const applied = await service.disable(input.scheduleId, input.transition);
|
|
751
|
+
return success({ schedule: applied.schedule, receipt: applied.receipt, replayed: applied.replay }, {
|
|
752
|
+
scheduleWrite: !applied.replay,
|
|
753
|
+
nextAction: applied.replay
|
|
754
|
+
? 'The exact disable transition was already recorded.'
|
|
755
|
+
: 'The schedule is inactive and no due work can be issued.',
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
const current = await service.read(input.scheduleId);
|
|
759
|
+
await this.assertCurrentMeasurementOwner(input.actor, current.schedule.ownerActorId);
|
|
760
|
+
return success(current, {
|
|
761
|
+
nextAction: current.schedule.state === 'enabled'
|
|
762
|
+
? 'Use a governed measurement issuer when due work must be scheduled.'
|
|
763
|
+
: 'Preview and explicitly enable an exact schedule before expecting due work.',
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
catch (cause) {
|
|
767
|
+
const knownMeasurement = cause instanceof MeasurementScheduleError ? cause : null;
|
|
768
|
+
const knownOperate = cause instanceof OperateClientError ? cause : null;
|
|
769
|
+
const authorityRequired = knownMeasurement?.code === 'E_MEASUREMENT_SCHEDULE_CONFLICT' ||
|
|
770
|
+
knownMeasurement?.code === 'E_MEASUREMENT_SCHEDULE_LOCKED' ||
|
|
771
|
+
knownMeasurement?.code === 'E_MEASUREMENT_OWNER_REQUIRED' ||
|
|
772
|
+
knownMeasurement?.code === 'E_MEASUREMENT_CONFIRMATION_REQUIRED';
|
|
773
|
+
const code = knownMeasurement?.code ?? knownOperate?.code ?? errorCode(cause);
|
|
774
|
+
const problem = knownMeasurement?.message ??
|
|
775
|
+
knownOperate?.message ??
|
|
776
|
+
(cause instanceof Error
|
|
777
|
+
? cause.message
|
|
778
|
+
: 'The requested measurement operation could not be completed.');
|
|
779
|
+
return Object.freeze({
|
|
780
|
+
ok: false,
|
|
781
|
+
operation: input.operation,
|
|
782
|
+
effects: effects(),
|
|
783
|
+
authorityRequired,
|
|
784
|
+
ownerActionRequired: authorityRequired,
|
|
785
|
+
nextAction: authorityRequired
|
|
786
|
+
? 'The owner must inspect current schedule custody and submit one exact fresh command.'
|
|
787
|
+
: 'Correct the bounded measurement request before retrying.',
|
|
788
|
+
recovery: problem,
|
|
789
|
+
error: Object.freeze({
|
|
790
|
+
code,
|
|
791
|
+
problem,
|
|
792
|
+
}),
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
/** Internal packet-recovery read; never projects Assignment bytes outside this process. */
|
|
797
|
+
async readAssignmentState(assignmentId, cycleId) {
|
|
798
|
+
const runtime = await this.requiredRuntime();
|
|
799
|
+
const assignment = state(runtime).assignments.find((candidate) => candidate.assignmentId === assignmentId && candidate.cycleId === cycleId);
|
|
800
|
+
return assignment ? String(assignment.state) : null;
|
|
801
|
+
}
|
|
802
|
+
/** Run the protocol-owned schema/semantic preflight against exact persisted custody. */
|
|
803
|
+
async preflightAssignmentResult(assignmentId, contentBytes) {
|
|
804
|
+
const runtime = await this.requiredRuntime();
|
|
805
|
+
return preflightOperatingAssignmentResultV2({ assignmentId, contentBytes }, {
|
|
806
|
+
initialState: state(runtime),
|
|
807
|
+
artifactStore: governedArtifactStore(runtime),
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Read the deterministic runtime-owned identities needed to construct one
|
|
812
|
+
* live-evidence ingestion. This is pre-effect: it does not resolve a
|
|
813
|
+
* credential, call a provider, stage bytes, or mutate the Operate Store.
|
|
814
|
+
*/
|
|
815
|
+
async prepareLiveEvidenceSubmission(input) {
|
|
816
|
+
const runtime = await this.requiredRuntime();
|
|
817
|
+
return liveEvidenceSubmissionPreparation(runtime, input);
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Accept an already redacted ingestion through the normal Assignment
|
|
821
|
+
* transaction and resolve its operate-artifact candidate in the same durable
|
|
822
|
+
* Store generation. Connector code never receives Store or Event authority.
|
|
823
|
+
*/
|
|
824
|
+
async acceptLiveEvidenceSubmission(request) {
|
|
825
|
+
return await retryReplaySafeGenerationConflict(`live-evidence-submit:${sha256Jcs({
|
|
826
|
+
assignmentId: request.assignmentId,
|
|
827
|
+
submissionId: request.submissionId,
|
|
828
|
+
preparationHash: request.preparationHash,
|
|
829
|
+
contentHash: `sha256:${createHash('sha256')
|
|
830
|
+
.update(Buffer.from(request.contentBase64, 'base64'))
|
|
831
|
+
.digest('hex')}`,
|
|
832
|
+
})}`, () => withOperateMutationLane(this.root, async () => {
|
|
833
|
+
const runtime = await this.requiredRuntime();
|
|
834
|
+
const preparation = liveEvidenceSubmissionPreparation(runtime, request);
|
|
835
|
+
if (preparation.preparationHash !== request.preparationHash) {
|
|
836
|
+
throw new OperateClientError('CONCURRENT_MODIFICATION', 'The live-evidence Assignment preparation changed before acceptance.', true, { assignmentId: request.assignmentId, submissionId: request.submissionId });
|
|
837
|
+
}
|
|
838
|
+
const ingestion = parseLiveEvidenceIngestion(request.contentBase64);
|
|
839
|
+
const candidate = Array.isArray(ingestion.evidenceCandidates)
|
|
840
|
+
? ingestion.evidenceCandidates[0]
|
|
841
|
+
: null;
|
|
842
|
+
const submission = record(ingestion.submission);
|
|
843
|
+
if (ingestion.ingestionId !== preparation.ingestionId ||
|
|
844
|
+
!Array.isArray(ingestion.evidenceCandidates) ||
|
|
845
|
+
ingestion.evidenceCandidates.length !== 1 ||
|
|
846
|
+
!candidate ||
|
|
847
|
+
typeof candidate !== 'object' ||
|
|
848
|
+
Array.isArray(candidate) ||
|
|
849
|
+
candidate.candidateId !== preparation.candidateId ||
|
|
850
|
+
submission.submissionId !== preparation.submissionId ||
|
|
851
|
+
submission.artifactId !== preparation.artifactId ||
|
|
852
|
+
submission.evidenceRefId !== preparation.evidenceRefId ||
|
|
853
|
+
submission.submittedEventId !== preparation.acceptanceEventIds.submitted ||
|
|
854
|
+
submission.artifactCreatedEventId !== preparation.acceptanceEventIds.artifactCreated ||
|
|
855
|
+
submission.validatedEventId !== preparation.acceptanceEventIds.validated) {
|
|
856
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'Live-evidence ingestion changed a runtime-owned submission or evidence identity.', false, { assignmentId: request.assignmentId, submissionId: request.submissionId });
|
|
857
|
+
}
|
|
858
|
+
const custody = request.custody;
|
|
859
|
+
assertOperatingLiveEvidenceIngestionV2(ingestion, {
|
|
860
|
+
assignment: preparation.assignment,
|
|
861
|
+
liveProviderRegistration: custody.liveProviderRegistration,
|
|
862
|
+
baseEvidenceProvider: custody.baseEvidenceProvider,
|
|
863
|
+
baseResolver: custody.baseResolver,
|
|
864
|
+
consentRecord: custody.consentRecord,
|
|
865
|
+
connectorCheckpoint: custody.connectorCheckpoint,
|
|
866
|
+
});
|
|
867
|
+
const sourceTiming = record(ingestion.sourceTiming);
|
|
868
|
+
if (typeof sourceTiming.capturedAt !== 'string' ||
|
|
869
|
+
!Number.isFinite(Date.parse(sourceTiming.capturedAt))) {
|
|
870
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'Live-evidence ingestion must bind one valid capture time.', false);
|
|
871
|
+
}
|
|
872
|
+
const composition = await this.composition();
|
|
873
|
+
const artifacts = new Map(runtime.artifacts);
|
|
874
|
+
const accepted = composition.acceptSubmission({
|
|
875
|
+
assignmentId: request.assignmentId,
|
|
876
|
+
submissionId: request.submissionId,
|
|
877
|
+
actor: request.actor,
|
|
878
|
+
mediaType: 'application/json',
|
|
879
|
+
encoding: 'utf-8',
|
|
880
|
+
contentBase64: request.contentBase64,
|
|
881
|
+
}, {
|
|
882
|
+
artifactId: preparation.artifactId,
|
|
883
|
+
artifactType: 'live-evidence-ingestion',
|
|
884
|
+
storageClass: 'machine-local',
|
|
885
|
+
sensitivity: ingestion.classification,
|
|
886
|
+
retentionClass: 'project',
|
|
887
|
+
inputArtifactIds: preparation.assignment.inputArtifactIds ?? [],
|
|
888
|
+
timestamp: sourceTiming.capturedAt,
|
|
889
|
+
validatorVersion: 'openplanr-live-evidence-v2',
|
|
890
|
+
correlationId: preparation.correlationId,
|
|
891
|
+
eventIds: preparation.acceptanceEventIds,
|
|
892
|
+
}, runtime.state, artifacts);
|
|
893
|
+
const eventPool = [...runtime.events, ...accepted.events];
|
|
894
|
+
const requiredEvent = (eventId) => {
|
|
895
|
+
const event = eventPool.find((candidateEvent) => candidateEvent.eventId === eventId);
|
|
896
|
+
if (!event) {
|
|
897
|
+
throw new OperateClientError('OPERATE_STORE_INCOMPATIBLE', 'Accepted live-evidence custody is missing one immutable Event body.', false, { eventId });
|
|
898
|
+
}
|
|
899
|
+
return event;
|
|
900
|
+
};
|
|
901
|
+
const submittedEvent = requiredEvent(preparation.acceptanceEventIds.submitted);
|
|
902
|
+
const artifactCreatedEvent = requiredEvent(preparation.acceptanceEventIds.artifactCreated);
|
|
903
|
+
const validatedEvent = requiredEvent(preparation.acceptanceEventIds.validated);
|
|
904
|
+
const sourceCustody = {
|
|
905
|
+
issuedAssignment: preparation.assignment,
|
|
906
|
+
liveProviderRegistration: custody.liveProviderRegistration,
|
|
907
|
+
baseEvidenceProvider: custody.baseEvidenceProvider,
|
|
908
|
+
baseResolver: custody.baseResolver,
|
|
909
|
+
consentRecord: custody.consentRecord,
|
|
910
|
+
connectorCheckpoint: custody.connectorCheckpoint,
|
|
911
|
+
submittedEvent,
|
|
912
|
+
artifactCreatedEvent,
|
|
913
|
+
validatedEvent,
|
|
914
|
+
};
|
|
915
|
+
const links = Array.isArray(ingestion.evidenceClaimLinks)
|
|
916
|
+
? ingestion.evidenceClaimLinks.map((value) => {
|
|
917
|
+
const link = record(value);
|
|
918
|
+
return {
|
|
919
|
+
sourceArtifactId: link.sourceArtifactId,
|
|
920
|
+
localClaimId: link.localClaimId,
|
|
921
|
+
relation: link.relation,
|
|
922
|
+
confidence: link.confidence,
|
|
923
|
+
};
|
|
924
|
+
})
|
|
925
|
+
: [];
|
|
926
|
+
const materialized = composition.materializeLiveEvidence({ candidate: candidate, claimLinks: links }, {
|
|
927
|
+
resolutionId: preparation.evidenceResolutionId,
|
|
928
|
+
eventId: preparation.resolutionEventId,
|
|
929
|
+
timestamp: sourceTiming.capturedAt,
|
|
930
|
+
correlationId: preparation.correlationId,
|
|
931
|
+
evidenceRefId: preparation.evidenceRefId,
|
|
932
|
+
evidenceArtifactId: preparation.evidenceArtifactId,
|
|
933
|
+
}, accepted.state, artifacts, preparation.artifactId, sourceCustody);
|
|
934
|
+
const evidenceRef = record(materialized.evidenceRef);
|
|
935
|
+
const evidenceArtifact = record(materialized.evidenceArtifact);
|
|
936
|
+
const evidenceResolution = record(materialized.resolution);
|
|
937
|
+
assertAcceptedLiveEvidenceBridgeV2(ingestion, {
|
|
938
|
+
...sourceCustody,
|
|
939
|
+
assignment: preparation.assignment,
|
|
940
|
+
artifact: accepted.artifact,
|
|
941
|
+
evidenceRef,
|
|
942
|
+
evidenceArtifact,
|
|
943
|
+
evidenceResolution,
|
|
944
|
+
resultCheckpoint: custody.resultCheckpoint,
|
|
945
|
+
checkpointHistory: [...(custody.checkpointHistory ?? [])],
|
|
946
|
+
});
|
|
947
|
+
if (!accepted.replayed || !materialized.replayed) {
|
|
948
|
+
await this.store.commit({
|
|
949
|
+
baseState: runtime.baseState,
|
|
950
|
+
state: materialized.state,
|
|
951
|
+
events: [
|
|
952
|
+
...runtime.events,
|
|
953
|
+
...accepted.events,
|
|
954
|
+
...materialized.events,
|
|
955
|
+
],
|
|
956
|
+
artifacts,
|
|
957
|
+
preferences: runtime.preferences,
|
|
958
|
+
}, runtime.generation);
|
|
959
|
+
}
|
|
960
|
+
return Object.freeze({
|
|
961
|
+
assignmentId: request.assignmentId,
|
|
962
|
+
submissionId: request.submissionId,
|
|
963
|
+
artifactId: String(accepted.artifact.artifactId),
|
|
964
|
+
artifactHash: String(accepted.artifact.canonicalHash),
|
|
965
|
+
evidenceRefId: String(evidenceRef.evidenceRefId),
|
|
966
|
+
evidenceArtifactId: String(evidenceArtifact.artifactId),
|
|
967
|
+
resolutionId: String(evidenceResolution.resolutionId),
|
|
968
|
+
replayed: Boolean(accepted.replayed && materialized.replayed),
|
|
969
|
+
});
|
|
970
|
+
}));
|
|
971
|
+
}
|
|
972
|
+
/** Build the closed access-safe Cycle DTO before data crosses into browser state. */
|
|
973
|
+
async readCycleWorkspace(cycleId, actor) {
|
|
974
|
+
try {
|
|
975
|
+
return await readOperateCycleWorkspace({
|
|
976
|
+
cycleId,
|
|
977
|
+
actor,
|
|
978
|
+
readExperience: async (request) => await this.experience(request),
|
|
979
|
+
readCycle: async (requestedCycleId) => await this.get(requestedCycleId, 'operate.cycle.get'),
|
|
980
|
+
refuse: (code, message) => {
|
|
981
|
+
throw new OperateClientError(code, message, false);
|
|
982
|
+
},
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
catch (cause) {
|
|
986
|
+
return this.failure('operate.cycle.get', cause);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
/** Build the closed access-safe Action DTO before data crosses into browser state. */
|
|
990
|
+
async readActionWorkspace(actionId, cycleId, actor) {
|
|
991
|
+
try {
|
|
992
|
+
return await readOperateActionWorkspace({
|
|
993
|
+
actionId,
|
|
994
|
+
cycleId,
|
|
995
|
+
actor,
|
|
996
|
+
readExperience: async (request) => await this.experience(request),
|
|
997
|
+
refuse: (code, message) => {
|
|
998
|
+
throw new OperateClientError(code, message, false);
|
|
999
|
+
},
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
catch (cause) {
|
|
1003
|
+
return this.failure('operate.experience.get', cause);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
/** Build the closed access-safe recovery DTO before data crosses into browser state. */
|
|
1007
|
+
async readRecoveryDisplay(cycleId, actor) {
|
|
1008
|
+
try {
|
|
1009
|
+
return await readOperateRecoveryDisplay({
|
|
1010
|
+
cycleId,
|
|
1011
|
+
actor,
|
|
1012
|
+
readExperience: async (request) => await this.experience(request),
|
|
1013
|
+
inspectRecovery: async () => await this.dispatch({ operation: 'operate.recovery.inspect', request: {} }),
|
|
1014
|
+
refuse: (code, message) => {
|
|
1015
|
+
throw new OperateClientError(code, message, false);
|
|
1016
|
+
},
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
catch (cause) {
|
|
1020
|
+
return this.failure('operate.recovery.inspect', cause);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
/** Build the closed access-safe executive board DTO before data crosses into browser state. */
|
|
1024
|
+
async readExecutiveBoardDisplay(cycleId, actor) {
|
|
1025
|
+
try {
|
|
1026
|
+
return await readOperateExecutiveBoardDisplay({
|
|
1027
|
+
cycleId,
|
|
1028
|
+
actor,
|
|
1029
|
+
readExperience: async (request) => await this.experience(request),
|
|
1030
|
+
refuse: (code, message) => {
|
|
1031
|
+
throw new OperateClientError(code, message, false);
|
|
1032
|
+
},
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
catch (cause) {
|
|
1036
|
+
return this.failure('operate.cycle.get', cause);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
/** Build one owner-selected, browser-verifiable read-only audit display. */
|
|
1040
|
+
async readAuditDisplay(request) {
|
|
1041
|
+
try {
|
|
1042
|
+
const auditSurfaces = new Set([
|
|
1043
|
+
'evidence',
|
|
1044
|
+
'outcomes',
|
|
1045
|
+
'outcome',
|
|
1046
|
+
'history',
|
|
1047
|
+
'search',
|
|
1048
|
+
'export',
|
|
1049
|
+
]);
|
|
1050
|
+
if (!exactAuditDisplayRequest(request) ||
|
|
1051
|
+
!isOperatePublicId(request.cycleId) ||
|
|
1052
|
+
!request.actor ||
|
|
1053
|
+
typeof request.actor.actorId !== 'string' ||
|
|
1054
|
+
!auditSurfaces.has(request.surface)) {
|
|
1055
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The operating audit display request is invalid.', false);
|
|
1056
|
+
}
|
|
1057
|
+
const subjectId = request.subjectId ?? null;
|
|
1058
|
+
const query = request.surface === 'search' ? (request.query ?? '') : null;
|
|
1059
|
+
const format = request.surface === 'export' ? (request.format ?? 'json') : null;
|
|
1060
|
+
if ((request.surface === 'outcome' && subjectId === null) ||
|
|
1061
|
+
(!['evidence', 'outcome'].includes(request.surface) && subjectId !== null) ||
|
|
1062
|
+
(request.surface !== 'search' && request.query !== undefined) ||
|
|
1063
|
+
(request.surface !== 'export' && request.format !== undefined) ||
|
|
1064
|
+
(typeof query === 'string' && query.length > 512)) {
|
|
1065
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The operating audit display selection is invalid.', false);
|
|
1066
|
+
}
|
|
1067
|
+
const experience = await this.experience({
|
|
1068
|
+
cycleId: request.cycleId,
|
|
1069
|
+
actor: request.actor,
|
|
1070
|
+
});
|
|
1071
|
+
if (!experience.ok)
|
|
1072
|
+
return experience;
|
|
1073
|
+
const view = record(experience.data);
|
|
1074
|
+
const owner = await loadOperateExperienceReaderOwner((code, message) => {
|
|
1075
|
+
throw new OperateClientError(code, message, false);
|
|
1076
|
+
});
|
|
1077
|
+
return owner.selectOperateExperienceAuditDisplaySurface(view, {
|
|
1078
|
+
surface: request.surface,
|
|
1079
|
+
binding: {
|
|
1080
|
+
actorId: String(view.actorId),
|
|
1081
|
+
scopeId: String(view.scopeId),
|
|
1082
|
+
domainId: String(view.domainId),
|
|
1083
|
+
domainVersion: String(view.domainVersion),
|
|
1084
|
+
cycleId: request.cycleId,
|
|
1085
|
+
subjectId,
|
|
1086
|
+
surface: request.surface,
|
|
1087
|
+
query,
|
|
1088
|
+
format,
|
|
1089
|
+
generatedAt: String(view.generatedAt),
|
|
1090
|
+
eventHead: record(view.eventHead),
|
|
1091
|
+
viewHash: String(view.viewHash),
|
|
1092
|
+
},
|
|
1093
|
+
subjectId,
|
|
1094
|
+
cycleId: request.cycleId,
|
|
1095
|
+
query,
|
|
1096
|
+
format,
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
catch (cause) {
|
|
1100
|
+
return this.failure('operate.experience.get', cause);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
/** Compose one exact command preview through the installed projection owner. */
|
|
1104
|
+
async createExperiencePreview(input) {
|
|
1105
|
+
const runtime = await this.requiredRuntime();
|
|
1106
|
+
const snapshot = state(runtime);
|
|
1107
|
+
const cycle = findBy(snapshot.cycles, 'cycleId', input.stateCycleId);
|
|
1108
|
+
if (!cycle) {
|
|
1109
|
+
throw new OperateClientError('CYCLE_NOT_FOUND', 'The requested cycle does not exist.', false);
|
|
1110
|
+
}
|
|
1111
|
+
if (String(input.view.actorId) !== input.actor.actorId) {
|
|
1112
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'The preview actor does not match the exact current view.', false);
|
|
1113
|
+
}
|
|
1114
|
+
return (await this.composition()).preview({
|
|
1115
|
+
state: snapshot,
|
|
1116
|
+
scope: {
|
|
1117
|
+
scopeId: String(cycle.scopeId),
|
|
1118
|
+
domainId: String(cycle.domainId),
|
|
1119
|
+
domainVersion: String(cycle.domainVersion),
|
|
1120
|
+
},
|
|
1121
|
+
view: input.view,
|
|
1122
|
+
actionDigest: input.actionDigest,
|
|
1123
|
+
authority: input.authority,
|
|
1124
|
+
reasonCodes: input.reasonCodes,
|
|
1125
|
+
issuedAt: input.issuedAt,
|
|
1126
|
+
expiresAt: input.expiresAt,
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
/** Read an immutable terminal Review receipt without replaying its mutation. */
|
|
1130
|
+
async readCommittedReviewReceipt(request) {
|
|
1131
|
+
try {
|
|
1132
|
+
const runtime = await this.requiredRuntime();
|
|
1133
|
+
return readCommittedOperateReviewReceipt(runtime, request);
|
|
1134
|
+
}
|
|
1135
|
+
catch (cause) {
|
|
1136
|
+
return this.failure('operate.review.submit', cause);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Reconstruct one access-screened experience at an immutable historical
|
|
1141
|
+
* Event head. This is read-only and never exposes Store or replay internals.
|
|
1142
|
+
*/
|
|
1143
|
+
async readExperienceAtEventHead(request, expectedEventHead) {
|
|
1144
|
+
try {
|
|
1145
|
+
const current = await this.requiredRuntime();
|
|
1146
|
+
const historical = await this.runtimeAtEventHead(current, expectedEventHead);
|
|
1147
|
+
return (await this.experience(request, historical));
|
|
1148
|
+
}
|
|
1149
|
+
catch (cause) {
|
|
1150
|
+
return this.failure('operate.experience.get', cause);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
/** Commit one exact owner-bound Review choice through the additive facade. */
|
|
1154
|
+
async submitBoundReview(submission) {
|
|
1155
|
+
try {
|
|
1156
|
+
return (await submitBoundOperateReview({
|
|
1157
|
+
root: this.root,
|
|
1158
|
+
submission,
|
|
1159
|
+
issueFactory: replaySafeIssueFactory,
|
|
1160
|
+
requiredRuntime: async () => await this.requiredRuntime(),
|
|
1161
|
+
commit: async (runtime, nextState, events) => await this.commit(runtime, nextState, events),
|
|
1162
|
+
}));
|
|
1163
|
+
}
|
|
1164
|
+
catch (cause) {
|
|
1165
|
+
return this.failure('operate.review.submit', cause);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
async dispatch(input) {
|
|
1169
|
+
try {
|
|
1170
|
+
switch (input.operation) {
|
|
1171
|
+
case 'operate.cycle.start':
|
|
1172
|
+
return await this.start(input.request);
|
|
1173
|
+
case 'operate.cycle.get':
|
|
1174
|
+
return await this.get(input.request.cycleId, input.operation);
|
|
1175
|
+
case 'operate.cycle.resume':
|
|
1176
|
+
return await this.get(input.request.cycleId, input.operation);
|
|
1177
|
+
case 'operate.assignment.claim':
|
|
1178
|
+
return await this.claim(input.request);
|
|
1179
|
+
case 'operate.assignment.submit':
|
|
1180
|
+
return await this.submit(input.request);
|
|
1181
|
+
case 'operate.review.get':
|
|
1182
|
+
return await this.review(input.request);
|
|
1183
|
+
case 'operate.review.submit':
|
|
1184
|
+
return await this.submitReview(input.request);
|
|
1185
|
+
case 'operate.action.approve':
|
|
1186
|
+
return await this.approveAction(input.request);
|
|
1187
|
+
case 'operate.action.execute':
|
|
1188
|
+
return await this.executeAction(input.request);
|
|
1189
|
+
case 'operate.action.rollback':
|
|
1190
|
+
return await this.rollbackAction(input.request);
|
|
1191
|
+
case 'operate.artifact.get':
|
|
1192
|
+
return await this.artifact(input.request);
|
|
1193
|
+
case 'operate.experience.get':
|
|
1194
|
+
return await this.experience(input.request);
|
|
1195
|
+
case 'operate.planning.preview':
|
|
1196
|
+
return await this.planningPreview(input.request.actionId, input.request.actor, input.request.framing);
|
|
1197
|
+
case 'operate.planning.create-spec':
|
|
1198
|
+
return await this.planningCreateSpec(input.request.proposalId, input.request.confirmDigest, input.request.actor);
|
|
1199
|
+
case 'operate.planning.ingest-delivery':
|
|
1200
|
+
return await this.planningIngestDelivery(input.request);
|
|
1201
|
+
case 'operate.recovery.inspect':
|
|
1202
|
+
return await this.inspectRecovery();
|
|
1203
|
+
case 'operate.recovery.restore':
|
|
1204
|
+
return await this.restore(input.request.generation);
|
|
1205
|
+
case 'operate.recovery.clear-stale-lock':
|
|
1206
|
+
return await this.clearStaleLock();
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
catch (cause) {
|
|
1210
|
+
return this.failure(input.operation, cause);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
assertMeasurementActor(actor, expectedOwnerActorId) {
|
|
1214
|
+
if (actor.kind !== 'human' ||
|
|
1215
|
+
actor.runtime !== 'openplanr' ||
|
|
1216
|
+
!actor.actorId ||
|
|
1217
|
+
(expectedOwnerActorId !== undefined && actor.actorId !== expectedOwnerActorId)) {
|
|
1218
|
+
throw new MeasurementScheduleError('E_MEASUREMENT_OWNER_REQUIRED', 'Measurement custody requires the exact named human owner.');
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
async assertCurrentMeasurementOwner(actor, expectedOwnerActorId) {
|
|
1222
|
+
this.assertMeasurementActor(actor, expectedOwnerActorId);
|
|
1223
|
+
const runtime = await this.requiredRuntime();
|
|
1224
|
+
if (runtime.preferences.actorMemberships[actor.actorId]?.role !== 'owner') {
|
|
1225
|
+
throw new MeasurementScheduleError('E_MEASUREMENT_OWNER_REQUIRED', 'Measurement custody requires a current durable Operate owner.');
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
async measurementService() {
|
|
1229
|
+
this.measurementPromise ??= this.composition().then((composition) => createProjectMeasurementScheduleService(this.projectDir, composition));
|
|
1230
|
+
return await this.measurementPromise;
|
|
1231
|
+
}
|
|
1232
|
+
async composition() {
|
|
1233
|
+
this.compositionPromise ??= createOperateComposition();
|
|
1234
|
+
return await this.compositionPromise;
|
|
1235
|
+
}
|
|
1236
|
+
async planningPreview(actionId, actor, framing) {
|
|
1237
|
+
const runtime = await this.requiredRuntime();
|
|
1238
|
+
const proposal = await previewOperatingPlanningSpec({
|
|
1239
|
+
projectDir: this.projectDir,
|
|
1240
|
+
runtimeRoot: this.root,
|
|
1241
|
+
runtime,
|
|
1242
|
+
actionId,
|
|
1243
|
+
actor: actor,
|
|
1244
|
+
framing,
|
|
1245
|
+
});
|
|
1246
|
+
return this.success('operate.planning.preview', proposal);
|
|
1247
|
+
}
|
|
1248
|
+
async planningCreateSpec(proposalId, confirmDigest, actor) {
|
|
1249
|
+
const runtime = await this.requiredRuntime();
|
|
1250
|
+
const receipt = await createSpecForOperatingPlanning({
|
|
1251
|
+
projectDir: this.projectDir,
|
|
1252
|
+
runtimeRoot: this.root,
|
|
1253
|
+
runtime,
|
|
1254
|
+
proposalId,
|
|
1255
|
+
confirmDigest,
|
|
1256
|
+
actor: actor,
|
|
1257
|
+
});
|
|
1258
|
+
return this.success('operate.planning.create-spec', receipt);
|
|
1259
|
+
}
|
|
1260
|
+
async planningIngestDelivery(evidence) {
|
|
1261
|
+
const runtime = await this.requiredRuntime();
|
|
1262
|
+
const composition = await this.composition();
|
|
1263
|
+
const result = await ingestPlanningDeliveryEvidence({
|
|
1264
|
+
projectDir: this.projectDir,
|
|
1265
|
+
runtime,
|
|
1266
|
+
composition,
|
|
1267
|
+
evidence,
|
|
1268
|
+
});
|
|
1269
|
+
const committed = result.replayed
|
|
1270
|
+
? runtime
|
|
1271
|
+
: await this.store.commit({
|
|
1272
|
+
baseState: runtime.baseState,
|
|
1273
|
+
state: result.runtime.state,
|
|
1274
|
+
events: result.runtime.events,
|
|
1275
|
+
artifacts: result.runtime.artifacts,
|
|
1276
|
+
preferences: runtime.preferences,
|
|
1277
|
+
}, runtime.generation);
|
|
1278
|
+
return this.success('operate.planning.ingest-delivery', {
|
|
1279
|
+
deliveryEvidence: result.deliveryEvidence,
|
|
1280
|
+
evidenceRef: result.evidenceRef,
|
|
1281
|
+
assignment: result.assignment,
|
|
1282
|
+
eventHead: committed.state.eventHead,
|
|
1283
|
+
replayed: result.replayed,
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
async load() {
|
|
1287
|
+
await ensureOperateStorageLayout(this.projectDir);
|
|
1288
|
+
const composition = await this.composition();
|
|
1289
|
+
return await this.store.load(async ({ baseState, events, artifacts }) => composition.replay(baseState, events, artifacts));
|
|
1290
|
+
}
|
|
1291
|
+
async event(runtime, input) {
|
|
1292
|
+
return (await this.composition()).createEvent({
|
|
1293
|
+
eventId: id('evt'),
|
|
1294
|
+
timestamp: input.timestamp ?? timestamp(),
|
|
1295
|
+
cycleId: input.cycleId,
|
|
1296
|
+
type: input.type,
|
|
1297
|
+
entityId: input.entityId,
|
|
1298
|
+
actor: input.actor ?? { kind: 'engine', id: 'openplanr' },
|
|
1299
|
+
causationId: input.causationId ?? runtime.events.at(-1)?.eventId ?? null,
|
|
1300
|
+
correlationId: input.correlationId,
|
|
1301
|
+
...(input.requestHash === undefined ? {} : { requestHash: input.requestHash }),
|
|
1302
|
+
payload: input.payload,
|
|
1303
|
+
}, previousEvent(runtime));
|
|
1304
|
+
}
|
|
1305
|
+
async start(request) {
|
|
1306
|
+
return (await startOperateCycle({
|
|
1307
|
+
request,
|
|
1308
|
+
projectDir: this.projectDir,
|
|
1309
|
+
composition: async () => await this.composition(),
|
|
1310
|
+
load: async () => await this.load(),
|
|
1311
|
+
createEvent: async (runtime, eventInput) => await this.event(runtime, eventInput),
|
|
1312
|
+
commit: async (next, expectedGeneration) => await this.store.commit(next, expectedGeneration),
|
|
1313
|
+
id,
|
|
1314
|
+
timestamp,
|
|
1315
|
+
cycleEnvelope: canonicalCycleEnvelope,
|
|
1316
|
+
}));
|
|
1317
|
+
}
|
|
1318
|
+
async get(cycleId, operation) {
|
|
1319
|
+
const runtime = await this.requiredRuntime();
|
|
1320
|
+
return canonicalCycleEnvelope(runtime, cycleId, operation);
|
|
1321
|
+
}
|
|
1322
|
+
async claim(request) {
|
|
1323
|
+
return (await claimOperateAssignment({
|
|
1324
|
+
root: this.root,
|
|
1325
|
+
request,
|
|
1326
|
+
issueFactory: replaySafeIssueFactory,
|
|
1327
|
+
requiredRuntime: async () => await this.requiredRuntime(),
|
|
1328
|
+
composition: async () => await this.composition(),
|
|
1329
|
+
commit: async (runtime, nextState, events) => await this.commit(runtime, nextState, events),
|
|
1330
|
+
refuse: (code, message, context = {}) => {
|
|
1331
|
+
throw new OperateClientError(code, message, false, context);
|
|
1332
|
+
},
|
|
1333
|
+
}));
|
|
1334
|
+
}
|
|
1335
|
+
async submit(request) {
|
|
1336
|
+
const issue = replaySafeIssueFactory();
|
|
1337
|
+
return await retryReplaySafeGenerationConflict(`submit:${sha256Jcs(request)}`, () => withOperateMutationLane(this.root, () => this.submitAttempt(request, issue())));
|
|
1338
|
+
}
|
|
1339
|
+
async submitAttempt(request, issue) {
|
|
1340
|
+
const runtime = await this.requiredRuntime();
|
|
1341
|
+
const snapshot = state(runtime);
|
|
1342
|
+
const requestedAssignment = snapshot.assignments.find((candidate) => candidate.assignmentId === request.assignmentId);
|
|
1343
|
+
if (isLiveEvidenceAssignment(requestedAssignment)) {
|
|
1344
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'Live-evidence ingestion requires the governed connector bridge and exact local consent custody.', false, { assignmentId: request.assignmentId, submissionId: request.submissionId });
|
|
1345
|
+
}
|
|
1346
|
+
const composition = await this.composition();
|
|
1347
|
+
const artifacts = new Map(runtime.artifacts);
|
|
1348
|
+
const { assignment, accepted } = stageRuntimeAssignmentSubmission({
|
|
1349
|
+
composition,
|
|
1350
|
+
request,
|
|
1351
|
+
runtimeState: runtime.state,
|
|
1352
|
+
artifactBytes: artifacts,
|
|
1353
|
+
assignmentArtifactIds: runtime.preferences.assignmentArtifactIds,
|
|
1354
|
+
issue,
|
|
1355
|
+
refuse: (code, message, context = {}) => {
|
|
1356
|
+
throw new OperateClientError(code, message, false, context);
|
|
1357
|
+
},
|
|
1358
|
+
});
|
|
1359
|
+
if (accepted.replayed) {
|
|
1360
|
+
return this.success('operate.assignment.submit', accepted.response, cycleReadActions(String(assignment.cycleId), request.actor));
|
|
1361
|
+
}
|
|
1362
|
+
if (assignment.assignmentKind === 'verification') {
|
|
1363
|
+
const submission = snapshot.submissions.find((candidate) => candidate.assignmentId === assignment.assignmentId &&
|
|
1364
|
+
candidate.submissionId === request.submissionId &&
|
|
1365
|
+
candidate.state === 'issued');
|
|
1366
|
+
const operation = snapshot.governedOperations.find((candidate) => candidate.operationId === assignment.governedOperationId);
|
|
1367
|
+
const actionId = operation ? String(record(operation.action).actionId) : '';
|
|
1368
|
+
const action = snapshot.actions.find((candidate) => candidate.actionId === actionId);
|
|
1369
|
+
if (!submission || !operation || !action) {
|
|
1370
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'The terminal verification Assignment lost its exact operation or Submission binding.', false, { assignmentId: String(assignment.assignmentId) });
|
|
1371
|
+
}
|
|
1372
|
+
const recordingRuntime = { ...runtime, artifacts };
|
|
1373
|
+
const recorded = recordOperatingTerminalVerificationInsufficientEvidenceV2({
|
|
1374
|
+
cycleId: String(assignment.cycleId),
|
|
1375
|
+
actionId,
|
|
1376
|
+
verificationPlanId: String(action.verificationPlanId),
|
|
1377
|
+
assignmentId: String(assignment.assignmentId),
|
|
1378
|
+
submissionId: String(submission.submissionId),
|
|
1379
|
+
}, {
|
|
1380
|
+
eventIds: {
|
|
1381
|
+
outcome: issue.stableId('evt', `verification-outcome:${submission.submissionId}`),
|
|
1382
|
+
learning: issue.stableId('evt', `verification-learning:${submission.submissionId}`),
|
|
1383
|
+
},
|
|
1384
|
+
timestamp: String(submission.issuedAt),
|
|
1385
|
+
correlationId: issue.stableId('corr', `verification-outcome:${submission.submissionId}`),
|
|
1386
|
+
}, {
|
|
1387
|
+
initialState: accepted.state,
|
|
1388
|
+
artifactStore: governedArtifactStore(recordingRuntime),
|
|
1389
|
+
});
|
|
1390
|
+
await this.store.commit({
|
|
1391
|
+
baseState: runtime.baseState,
|
|
1392
|
+
state: recorded.state,
|
|
1393
|
+
events: [
|
|
1394
|
+
...runtime.events,
|
|
1395
|
+
...accepted.events,
|
|
1396
|
+
...recorded.events,
|
|
1397
|
+
],
|
|
1398
|
+
artifacts,
|
|
1399
|
+
preferences: runtime.preferences,
|
|
1400
|
+
}, runtime.generation);
|
|
1401
|
+
return this.success('operate.assignment.submit', accepted.response, cycleReadActions(String(assignment.cycleId), request.actor));
|
|
1402
|
+
}
|
|
1403
|
+
if (assignment.assignmentKind !== 'chair') {
|
|
1404
|
+
await this.store.commit({
|
|
1405
|
+
baseState: runtime.baseState,
|
|
1406
|
+
state: accepted.state,
|
|
1407
|
+
events: [...runtime.events, ...accepted.events],
|
|
1408
|
+
artifacts,
|
|
1409
|
+
preferences: runtime.preferences,
|
|
1410
|
+
}, runtime.generation);
|
|
1411
|
+
return this.success('operate.assignment.submit', accepted.response, cycleReadActions(String(assignment.cycleId), request.actor));
|
|
1412
|
+
}
|
|
1413
|
+
const planId = runtime.preferences.cycleIntelligencePlanIds[String(assignment.cycleId)];
|
|
1414
|
+
const plan = state({ ...runtime, state: accepted.state }).intelligencePlans.find((entry) => entry.planId === planId);
|
|
1415
|
+
if (!plan) {
|
|
1416
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'The Chair Assignment is missing its canonical intelligence plan.', false);
|
|
1417
|
+
}
|
|
1418
|
+
const roleAssignments = runtime.preferences.cycleRoleAssignments[String(assignment.cycleId)] ?? {};
|
|
1419
|
+
const artifactForRole = (roleId) => {
|
|
1420
|
+
const assignmentId = roleAssignments[roleId];
|
|
1421
|
+
return assignmentId
|
|
1422
|
+
? (accepted.state.artifacts.find((entry) => entry.assignmentId === assignmentId) ?? null)
|
|
1423
|
+
: null;
|
|
1424
|
+
};
|
|
1425
|
+
const selectedRoles = Array.isArray(plan.selectedRoles)
|
|
1426
|
+
? plan.selectedRoles
|
|
1427
|
+
: [];
|
|
1428
|
+
const advisorRoleIds = selectedRoles
|
|
1429
|
+
.filter((role) => role.roleKind === 'advisor')
|
|
1430
|
+
.map((role) => String(role.roleId))
|
|
1431
|
+
.sort((left, right) => left.localeCompare(right));
|
|
1432
|
+
const challengerRoleId = String(selectedRoles.find((role) => role.roleKind === 'challenger')?.roleId ?? 'challenger');
|
|
1433
|
+
const advisorArtifacts = advisorRoleIds
|
|
1434
|
+
.map((roleId) => artifactForRole(roleId))
|
|
1435
|
+
.filter((artifact) => artifact !== null);
|
|
1436
|
+
if (advisorArtifacts.length !== advisorRoleIds.length || advisorArtifacts.length === 0) {
|
|
1437
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'The Chair Assignment has no accepted canonical advisor Artifact.', false);
|
|
1438
|
+
}
|
|
1439
|
+
const advisorArtifact = advisorArtifacts[0];
|
|
1440
|
+
const challengerArtifact = artifactForRole(challengerRoleId);
|
|
1441
|
+
const acceptedRoleBody = (artifact, subject) => {
|
|
1442
|
+
const artifactId = String(artifact.artifactId);
|
|
1443
|
+
const rawBytes = artifacts.get(artifactId);
|
|
1444
|
+
if (!rawBytes) {
|
|
1445
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', `${subject} accepted Artifact bytes are unavailable.`, false, { artifactId });
|
|
1446
|
+
}
|
|
1447
|
+
try {
|
|
1448
|
+
return record(JSON.parse(Buffer.from(rawBytes).toString('utf8')));
|
|
1449
|
+
}
|
|
1450
|
+
catch {
|
|
1451
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', `${subject} accepted Artifact bytes are not valid JSON.`, false, { artifactId });
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
const advisorBodies = advisorArtifacts.map((artifact) => acceptedRoleBody(artifact, 'Advisor'));
|
|
1455
|
+
const challengerBody = challengerArtifact
|
|
1456
|
+
? acceptedRoleBody(challengerArtifact, 'Challenger')
|
|
1457
|
+
: null;
|
|
1458
|
+
const chairBody = record(JSON.parse(Buffer.from(accepted.stagedRawBytes).toString('utf8')));
|
|
1459
|
+
const ledgerDecisions = Array.isArray(chairBody.decisions) ? chairBody.decisions : [];
|
|
1460
|
+
const advisorClaims = advisorBodies.flatMap((body) => Array.isArray(body.claims) ? body.claims : []);
|
|
1461
|
+
const advisorRisks = advisorBodies.flatMap((body) => Array.isArray(body.risks) ? body.risks : []);
|
|
1462
|
+
const challengerFindings = challengerBody && Array.isArray(challengerBody.findings) ? challengerBody.findings : [];
|
|
1463
|
+
const snapshotId = String(plan.snapshotId);
|
|
1464
|
+
const acceptedSnapshot = accepted.state;
|
|
1465
|
+
const operatingSnapshot = acceptedSnapshot.operatingSnapshots.find((entry) => entry.snapshotId === snapshotId);
|
|
1466
|
+
if (!operatingSnapshot) {
|
|
1467
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'The intelligence plan snapshot is unavailable.', false);
|
|
1468
|
+
}
|
|
1469
|
+
const materialized = composition.materializeDecisionLedger({
|
|
1470
|
+
cycleId: assignment.cycleId,
|
|
1471
|
+
snapshotId,
|
|
1472
|
+
stateId: operatingSnapshot.stateId,
|
|
1473
|
+
intelligencePlanId: plan.planId,
|
|
1474
|
+
advisorArtifactIds: advisorArtifacts.map((artifact) => String(artifact.artifactId)),
|
|
1475
|
+
challengerArtifactId: challengerArtifact?.artifactId ?? null,
|
|
1476
|
+
chairArtifactId: accepted.artifact.artifactId,
|
|
1477
|
+
}, {
|
|
1478
|
+
eventId: issue.id('evt'),
|
|
1479
|
+
claimEventIds: advisorClaims.map(() => issue.id('evt')),
|
|
1480
|
+
riskEventIds: advisorRisks.map(() => issue.id('evt')),
|
|
1481
|
+
findingEventIds: challengerFindings.map(() => issue.id('evt')),
|
|
1482
|
+
decisionEventIds: ledgerDecisions.map(() => issue.id('evt')),
|
|
1483
|
+
timestamp: issue.timestamp(),
|
|
1484
|
+
correlationId: issue.id('corr'),
|
|
1485
|
+
}, accepted.state, artifacts);
|
|
1486
|
+
const completeHypotheses = materialized.actionHypotheses.filter((hypothesis) => typeof hypothesis.objectiveId === 'string' &&
|
|
1487
|
+
typeof hypothesis.metricId === 'string' &&
|
|
1488
|
+
typeof hypothesis.baseline === 'number' &&
|
|
1489
|
+
typeof hypothesis.target === 'number' &&
|
|
1490
|
+
Array.isArray(hypothesis.sourceFindingIds) &&
|
|
1491
|
+
hypothesis.sourceFindingIds.length > 0);
|
|
1492
|
+
const actionVerification = completeHypotheses.length === 0
|
|
1493
|
+
? { state: materialized.state, events: [] }
|
|
1494
|
+
: composition.materializeActionVerification({
|
|
1495
|
+
cycleId: assignment.cycleId,
|
|
1496
|
+
snapshotId,
|
|
1497
|
+
stateId: operatingSnapshot.stateId,
|
|
1498
|
+
ledgerId: materialized.ledger.ledgerId,
|
|
1499
|
+
}, {
|
|
1500
|
+
eventIds: completeHypotheses.map(() => issue.id('evt')),
|
|
1501
|
+
timestamp: issue.timestamp(),
|
|
1502
|
+
correlationId: issue.id('corr'),
|
|
1503
|
+
}, materialized.state, artifacts);
|
|
1504
|
+
const acceptedEvents = [
|
|
1505
|
+
...accepted.events,
|
|
1506
|
+
...materialized.events,
|
|
1507
|
+
...actionVerification.events,
|
|
1508
|
+
];
|
|
1509
|
+
const reviewAt = issue.timestamp();
|
|
1510
|
+
const deliveryRoute = runtime.preferences.cycleDeliveryRoutes[String(assignment.cycleId)];
|
|
1511
|
+
const containedExecution = deliveryRoute === 'contained-execution';
|
|
1512
|
+
let authority = {
|
|
1513
|
+
actions: [],
|
|
1514
|
+
policies: [],
|
|
1515
|
+
evaluations: [],
|
|
1516
|
+
requirements: [],
|
|
1517
|
+
};
|
|
1518
|
+
let promotionState = actionVerification.state;
|
|
1519
|
+
const promotionEvents = [];
|
|
1520
|
+
const proposed = promotionState.actions.filter((action) => action.sourceCycleId === assignment.cycleId && action.state === 'proposed');
|
|
1521
|
+
for (const action of proposed) {
|
|
1522
|
+
if (!deliveryRoute) {
|
|
1523
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'Action authority promotion requires one exact cycle delivery route.', false);
|
|
1524
|
+
}
|
|
1525
|
+
const promoted = promoteOperatingActionAuthorityV2({
|
|
1526
|
+
action: action,
|
|
1527
|
+
authority: (containedExecution
|
|
1528
|
+
? containedActionAuthorityInput(action, String(advisorArtifact.artifactId), reviewAt)
|
|
1529
|
+
: deliveryActionAuthorityInput(action, deliveryRoute, String(advisorArtifact.artifactId), reviewAt)),
|
|
1530
|
+
}, {
|
|
1531
|
+
eventId: issue.id('evt'),
|
|
1532
|
+
timestamp: reviewAt,
|
|
1533
|
+
correlationId: issue.id('corr'),
|
|
1534
|
+
}, { initialState: promotionState });
|
|
1535
|
+
promotionState = promoted.state;
|
|
1536
|
+
promotionEvents.push(...promoted.events);
|
|
1537
|
+
}
|
|
1538
|
+
if (containedExecution) {
|
|
1539
|
+
authority = configureContainedActionAuthority(promotionState.actions.filter((action) => action.sourceCycleId === assignment.cycleId), runtime.preferences.reviewOwners[String(assignment.cycleId)], reviewAt);
|
|
1540
|
+
}
|
|
1541
|
+
const reviewBaseState = {
|
|
1542
|
+
...runtime.baseState,
|
|
1543
|
+
cycles: runtime.baseState.cycles.map((cycle) => cycle.cycleId === assignment.cycleId
|
|
1544
|
+
? containedExecution
|
|
1545
|
+
? {
|
|
1546
|
+
...cycle,
|
|
1547
|
+
state: 'awaiting_review',
|
|
1548
|
+
activeReviewId: null,
|
|
1549
|
+
updatedAt: reviewAt,
|
|
1550
|
+
}
|
|
1551
|
+
: cycle
|
|
1552
|
+
: cycle),
|
|
1553
|
+
...(containedExecution
|
|
1554
|
+
? {
|
|
1555
|
+
actionPolicies: mergeRecordsBy(runtime.baseState.actionPolicies, authority.policies, (policy) => `${String(policy.policyId)}@${String(policy.policyVersion)}`),
|
|
1556
|
+
policyEvaluations: runtime.baseState.policyEvaluations ?? [],
|
|
1557
|
+
approvalRequirements: mergeRecordsBy(runtime.baseState.approvalRequirements, authority.requirements, (requirement) => String(requirement.requirementId)),
|
|
1558
|
+
approvalRecords: runtime.baseState.approvalRecords ?? [],
|
|
1559
|
+
capabilityAvailability: runtime.baseState.capabilityAvailability ?? [],
|
|
1560
|
+
capabilityGrants: runtime.baseState.capabilityGrants ?? [],
|
|
1561
|
+
governedOperations: runtime.baseState.governedOperations ?? [],
|
|
1562
|
+
executionResults: runtime.baseState.executionResults ?? [],
|
|
1563
|
+
rollbackPlans: runtime.baseState.rollbackPlans ?? [],
|
|
1564
|
+
rollbackResults: runtime.baseState.rollbackResults ?? [],
|
|
1565
|
+
operationReplayIndex: runtime.baseState.operationReplayIndex ?? [],
|
|
1566
|
+
}
|
|
1567
|
+
: {}),
|
|
1568
|
+
};
|
|
1569
|
+
let current = composition.replay(reviewBaseState, [...runtime.events, ...acceptedEvents, ...promotionEvents], artifacts);
|
|
1570
|
+
let stagedRuntime = {
|
|
1571
|
+
...runtime,
|
|
1572
|
+
baseState: reviewBaseState,
|
|
1573
|
+
state: current,
|
|
1574
|
+
events: [...runtime.events, ...acceptedEvents, ...promotionEvents],
|
|
1575
|
+
artifacts,
|
|
1576
|
+
};
|
|
1577
|
+
for (const evaluation of authority.evaluations) {
|
|
1578
|
+
const evaluated = await this.event(stagedRuntime, {
|
|
1579
|
+
type: 'policy.evaluated',
|
|
1580
|
+
entityId: String(evaluation.evaluationId),
|
|
1581
|
+
cycleId: String(assignment.cycleId),
|
|
1582
|
+
correlationId: issue.id('corr'),
|
|
1583
|
+
timestamp: String(evaluation.evaluatedAt),
|
|
1584
|
+
requestHash: String(evaluation.inputHash),
|
|
1585
|
+
actor: { kind: 'runtime', id: 'openplanr' },
|
|
1586
|
+
payload: evaluation,
|
|
1587
|
+
});
|
|
1588
|
+
current = composition.reduce(current, [evaluated], artifacts);
|
|
1589
|
+
stagedRuntime = {
|
|
1590
|
+
...stagedRuntime,
|
|
1591
|
+
state: current,
|
|
1592
|
+
events: [...stagedRuntime.events, evaluated],
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
const reviews = containedExecution
|
|
1596
|
+
? authority.actions.map((action) => createOperatingActionReviewV2({
|
|
1597
|
+
reviewId: issue.id('rev'),
|
|
1598
|
+
action: action,
|
|
1599
|
+
ownerActorId: runtime.preferences.reviewOwners[String(assignment.cycleId)],
|
|
1600
|
+
timestamp: reviewAt,
|
|
1601
|
+
}))
|
|
1602
|
+
: [
|
|
1603
|
+
{
|
|
1604
|
+
kind: 'operating-review',
|
|
1605
|
+
schemaVersion: '1.0.0',
|
|
1606
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1607
|
+
reviewId: issue.id('rev'),
|
|
1608
|
+
cycleId: assignment.cycleId,
|
|
1609
|
+
subject: { type: 'cycle', cycleId: assignment.cycleId },
|
|
1610
|
+
ownerActorId: runtime.preferences.reviewOwners[String(assignment.cycleId)],
|
|
1611
|
+
state: 'pending',
|
|
1612
|
+
disposition: null,
|
|
1613
|
+
workDispositions: [],
|
|
1614
|
+
createdAt: reviewAt,
|
|
1615
|
+
updatedAt: reviewAt,
|
|
1616
|
+
},
|
|
1617
|
+
];
|
|
1618
|
+
if (!containedExecution) {
|
|
1619
|
+
const [review] = reviews;
|
|
1620
|
+
const boardReview = composition.materializeExecutiveBoardReview({
|
|
1621
|
+
cycleId: String(assignment.cycleId),
|
|
1622
|
+
planId: String(plan.planId),
|
|
1623
|
+
ledgerId: String(materialized.ledger.ledgerId),
|
|
1624
|
+
review,
|
|
1625
|
+
}, {
|
|
1626
|
+
boardEventId: issue.id('evt'),
|
|
1627
|
+
reviewEventId: issue.id('evt'),
|
|
1628
|
+
timestamp: reviewAt,
|
|
1629
|
+
correlationId: issue.id('corr'),
|
|
1630
|
+
}, current, artifacts);
|
|
1631
|
+
current = boardReview.state;
|
|
1632
|
+
stagedRuntime = {
|
|
1633
|
+
...stagedRuntime,
|
|
1634
|
+
state: current,
|
|
1635
|
+
events: [...stagedRuntime.events, ...boardReview.events],
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
else {
|
|
1639
|
+
for (const review of reviews) {
|
|
1640
|
+
const reviewCreated = await this.event(stagedRuntime, {
|
|
1641
|
+
type: 'review.created',
|
|
1642
|
+
entityId: String(review.reviewId),
|
|
1643
|
+
cycleId: String(assignment.cycleId),
|
|
1644
|
+
correlationId: issue.id('corr'),
|
|
1645
|
+
timestamp: reviewAt,
|
|
1646
|
+
payload: review,
|
|
1647
|
+
});
|
|
1648
|
+
current = composition.reduce(current, [reviewCreated], artifacts);
|
|
1649
|
+
stagedRuntime = {
|
|
1650
|
+
...stagedRuntime,
|
|
1651
|
+
state: current,
|
|
1652
|
+
events: [...stagedRuntime.events, reviewCreated],
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
await this.store.commit({
|
|
1657
|
+
baseState: reviewBaseState,
|
|
1658
|
+
state: current,
|
|
1659
|
+
events: stagedRuntime.events,
|
|
1660
|
+
artifacts,
|
|
1661
|
+
preferences: runtime.preferences,
|
|
1662
|
+
}, runtime.generation);
|
|
1663
|
+
return this.success('operate.assignment.submit', accepted.response, cycleReadActions(String(assignment.cycleId), request.actor));
|
|
1664
|
+
}
|
|
1665
|
+
async review(request) {
|
|
1666
|
+
const runtime = await this.requiredRuntime();
|
|
1667
|
+
return readOperateReview(runtime, request);
|
|
1668
|
+
}
|
|
1669
|
+
async submitReview(request) {
|
|
1670
|
+
return (await submitOperateReview({
|
|
1671
|
+
root: this.root,
|
|
1672
|
+
request,
|
|
1673
|
+
issueFactory: replaySafeIssueFactory,
|
|
1674
|
+
requiredRuntime: async () => await this.requiredRuntime(),
|
|
1675
|
+
commit: async (runtime, nextState, events) => await this.commit(runtime, nextState, events),
|
|
1676
|
+
}));
|
|
1677
|
+
}
|
|
1678
|
+
async artifact(request) {
|
|
1679
|
+
const runtime = await this.requiredRuntime();
|
|
1680
|
+
const snapshot = state(runtime);
|
|
1681
|
+
const membership = runtime.preferences.actorMemberships[request.actor.actorId];
|
|
1682
|
+
return readOperatingArtifactV2(request, {
|
|
1683
|
+
initialState: snapshot,
|
|
1684
|
+
artifactStore: governedArtifactStore(runtime),
|
|
1685
|
+
capabilities: ['operate.artifact.get'],
|
|
1686
|
+
scopeMembership: request.actor.kind === 'human' &&
|
|
1687
|
+
membership?.role === 'owner' &&
|
|
1688
|
+
membership.scopeId === request.scope.scopeId &&
|
|
1689
|
+
membership.domainId === request.scope.domainId &&
|
|
1690
|
+
membership.domainVersion === request.scope.domainVersion
|
|
1691
|
+
? {
|
|
1692
|
+
active: true,
|
|
1693
|
+
actorId: request.actor.actorId,
|
|
1694
|
+
scopeId: membership.scopeId,
|
|
1695
|
+
domainId: membership.domainId,
|
|
1696
|
+
domainVersion: membership.domainVersion,
|
|
1697
|
+
}
|
|
1698
|
+
: null,
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
async experience(request, selectedRuntime) {
|
|
1702
|
+
if (request.surface &&
|
|
1703
|
+
![
|
|
1704
|
+
'today',
|
|
1705
|
+
'inbox',
|
|
1706
|
+
'cycles',
|
|
1707
|
+
'cycle',
|
|
1708
|
+
'evidence',
|
|
1709
|
+
'outcomes',
|
|
1710
|
+
'outcome',
|
|
1711
|
+
'history',
|
|
1712
|
+
'search',
|
|
1713
|
+
'export',
|
|
1714
|
+
'actions',
|
|
1715
|
+
'action',
|
|
1716
|
+
].includes(request.surface)) {
|
|
1717
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The requested operating experience surface is unsupported.', false);
|
|
1718
|
+
}
|
|
1719
|
+
if (request.surface === 'search' && (request.query?.length ?? 0) > 512) {
|
|
1720
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The operating search query exceeds the local read limit.', false);
|
|
1721
|
+
}
|
|
1722
|
+
if (['cycle', 'outcome', 'action'].includes(request.surface ?? '') && !request.subjectId) {
|
|
1723
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'This operating experience surface requires a subject.', false);
|
|
1724
|
+
}
|
|
1725
|
+
if (request.surface === 'export' &&
|
|
1726
|
+
request.format &&
|
|
1727
|
+
!['json', 'html'].includes(request.format)) {
|
|
1728
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The requested operating export format is unsupported.', false);
|
|
1729
|
+
}
|
|
1730
|
+
const runtime = selectedRuntime ?? (await this.requiredRuntime());
|
|
1731
|
+
if (request.actionBinding &&
|
|
1732
|
+
(request.actionBinding.cycleId !== request.cycleId ||
|
|
1733
|
+
request.actionBinding.actorId !== request.actor.actorId)) {
|
|
1734
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'This emitted action is bound to a different durable operating context.', false, { cycleId: request.cycleId, bindingMismatch: true });
|
|
1735
|
+
}
|
|
1736
|
+
const snapshot = state(runtime);
|
|
1737
|
+
const cycle = findBy(snapshot.cycles, 'cycleId', request.cycleId);
|
|
1738
|
+
if (!cycle) {
|
|
1739
|
+
throw new OperateClientError('CYCLE_NOT_FOUND', 'The requested cycle does not exist.', false, {
|
|
1740
|
+
cycleId: request.cycleId,
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
if (request.actionBinding &&
|
|
1744
|
+
!isDurableCycleActor(runtime, snapshot, request.cycleId, request.actor)) {
|
|
1745
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'This emitted action is not bound to the durable operating context.', false, { cycleId: request.cycleId, bindingMismatch: true });
|
|
1746
|
+
}
|
|
1747
|
+
const review = snapshot.reviews.find((entry) => entry.cycleId === request.cycleId && entry.state === 'pending');
|
|
1748
|
+
const reviewedAction = review && record(review.subject).type === 'action'
|
|
1749
|
+
? exactAction(snapshot, {
|
|
1750
|
+
actionId: String(record(review.subject).actionId),
|
|
1751
|
+
revision: Number(record(review.subject).revision),
|
|
1752
|
+
actionHash: String(record(review.subject).actionHash),
|
|
1753
|
+
})
|
|
1754
|
+
: undefined;
|
|
1755
|
+
const composition = await this.composition();
|
|
1756
|
+
const allowedActionEntries = review
|
|
1757
|
+
? (() => {
|
|
1758
|
+
const derived = bindActorActions(composition.allowedActions({
|
|
1759
|
+
actor: request.actor,
|
|
1760
|
+
capabilities: ['operate.review.get', REVIEW_SUBMIT_CAPABILITY],
|
|
1761
|
+
cycle,
|
|
1762
|
+
review,
|
|
1763
|
+
...(reviewedAction === undefined ? {} : { action: reviewedAction }),
|
|
1764
|
+
}), request.actor, record(review.subject).type === 'action'
|
|
1765
|
+
? []
|
|
1766
|
+
: defaultWorkDispositions(snapshot, request.cycleId));
|
|
1767
|
+
if (request.actor.kind !== 'human' || review.ownerActorId !== request.actor.actorId) {
|
|
1768
|
+
return derived
|
|
1769
|
+
.filter((action) => action.tool !== 'operate.review.submit')
|
|
1770
|
+
.map((action) => ({ subjectId: String(review.reviewId), action }));
|
|
1771
|
+
}
|
|
1772
|
+
const exactRead = readOperateReview(runtime, {
|
|
1773
|
+
reviewId: String(review.reviewId),
|
|
1774
|
+
cycleId: request.cycleId,
|
|
1775
|
+
actor: request.actor,
|
|
1776
|
+
scope: {
|
|
1777
|
+
scopeId: String(cycle.scopeId),
|
|
1778
|
+
domainId: String(cycle.domainId),
|
|
1779
|
+
domainVersion: String(cycle.domainVersion),
|
|
1780
|
+
},
|
|
1781
|
+
});
|
|
1782
|
+
if (!exactRead.ok)
|
|
1783
|
+
return [];
|
|
1784
|
+
return [
|
|
1785
|
+
...derived.filter((action) => action.tool !== 'operate.review.submit'),
|
|
1786
|
+
...exactRead.allowedActions,
|
|
1787
|
+
].map((action) => ({ subjectId: String(review.reviewId), action }));
|
|
1788
|
+
})()
|
|
1789
|
+
: governedExperienceActions(runtime, snapshot, cycle, request.actor);
|
|
1790
|
+
const allowedActions = allowedActionEntries.map((entry) => entry.action);
|
|
1791
|
+
const projected = composition.experience({
|
|
1792
|
+
state: snapshot,
|
|
1793
|
+
baseState: runtime.baseState,
|
|
1794
|
+
events: runtime.events,
|
|
1795
|
+
cycleId: request.cycleId,
|
|
1796
|
+
scope: {
|
|
1797
|
+
scopeId: String(cycle.scopeId),
|
|
1798
|
+
domainId: String(cycle.domainId),
|
|
1799
|
+
domainVersion: String(cycle.domainVersion),
|
|
1800
|
+
},
|
|
1801
|
+
actor: {
|
|
1802
|
+
actorId: request.actor.actorId,
|
|
1803
|
+
accessLevel: (() => {
|
|
1804
|
+
const membership = runtime.preferences.actorMemberships[request.actor.actorId];
|
|
1805
|
+
return membership?.role === 'owner' &&
|
|
1806
|
+
membership.scopeId === cycle.scopeId &&
|
|
1807
|
+
membership.domainId === cycle.domainId &&
|
|
1808
|
+
membership.domainVersion === cycle.domainVersion
|
|
1809
|
+
? 'internal'
|
|
1810
|
+
: 'public';
|
|
1811
|
+
})(),
|
|
1812
|
+
},
|
|
1813
|
+
allowedActions: allowedActionEntries.map((entry) => ({
|
|
1814
|
+
subjectId: entry.subjectId,
|
|
1815
|
+
// Review and Assignment actions carry the exact runtime-issued actor
|
|
1816
|
+
// custody required by their frozen command contracts. Other projected
|
|
1817
|
+
// commands remain actor-neutral until an authenticated dispatch binds them.
|
|
1818
|
+
action: projectAllowedAction(entry.action),
|
|
1819
|
+
})),
|
|
1820
|
+
routes: runtime.preferences.cycleDeliveryRoutes,
|
|
1821
|
+
// Projection identity is durable-state derived. Re-reading or restarting
|
|
1822
|
+
// at the same Event head must not manufacture a new view hash.
|
|
1823
|
+
generatedAt: String(snapshot.generatedAt),
|
|
1824
|
+
});
|
|
1825
|
+
if (projected.kind !== 'operate-experience-view') {
|
|
1826
|
+
throw new OperateClientError('CONTRACT_VERSION_UNSUPPORTED', 'The durable operating state cannot be served through the current experience contract.', false, { cycleId: request.cycleId });
|
|
1827
|
+
}
|
|
1828
|
+
const owner = await loadOperateExperienceReaderOwner((code, message) => {
|
|
1829
|
+
throw new OperateClientError(code, message, false);
|
|
1830
|
+
});
|
|
1831
|
+
const view = owner.buildOperateExperienceTransportView(projected);
|
|
1832
|
+
const selected = request.surface
|
|
1833
|
+
? owner.selectOperateExperienceSurface(view, {
|
|
1834
|
+
surface: request.surface,
|
|
1835
|
+
binding: {
|
|
1836
|
+
actorId: String(view.actorId),
|
|
1837
|
+
scopeId: String(view.scopeId),
|
|
1838
|
+
domainId: String(view.domainId),
|
|
1839
|
+
domainVersion: String(view.domainVersion),
|
|
1840
|
+
},
|
|
1841
|
+
subjectId: request.subjectId ?? null,
|
|
1842
|
+
cycleId: request.cycleId,
|
|
1843
|
+
query: request.query ?? '',
|
|
1844
|
+
format: request.format ?? 'json',
|
|
1845
|
+
projectId: request.projectId ?? null,
|
|
1846
|
+
generation: request.generation ?? null,
|
|
1847
|
+
})
|
|
1848
|
+
: view;
|
|
1849
|
+
if (selected === null || (record(selected).ok === false && record(selected).status === 404)) {
|
|
1850
|
+
throw new OperateClientError('OPERATE_SUBJECT_NOT_FOUND', 'The requested operating subject does not exist in this scope.', false);
|
|
1851
|
+
}
|
|
1852
|
+
if (record(selected).ok === false) {
|
|
1853
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The requested operating experience surface could not be selected.', false);
|
|
1854
|
+
}
|
|
1855
|
+
return this.success('operate.experience.get', selected, allowedActions);
|
|
1856
|
+
}
|
|
1857
|
+
async approveAction(request) {
|
|
1858
|
+
const runtime = await this.requiredRuntime();
|
|
1859
|
+
const snapshot = state(runtime);
|
|
1860
|
+
const selected = exactAction(snapshot, request.action);
|
|
1861
|
+
const rollbackContext = request.rollback;
|
|
1862
|
+
let workingRuntime = runtime;
|
|
1863
|
+
let workingState = snapshot;
|
|
1864
|
+
const prefixEvents = [];
|
|
1865
|
+
let rollbackSourceTemplate = null;
|
|
1866
|
+
if (rollbackContext) {
|
|
1867
|
+
if (request.decision !== 'approved' || selected.state !== 'completed') {
|
|
1868
|
+
throw new OperateClientError('APPROVAL_INVALID', 'Rollback approval is available only for one completed exact Action.', false);
|
|
1869
|
+
}
|
|
1870
|
+
const { plan } = exactRollbackPlanContext(snapshot, selected, {
|
|
1871
|
+
binding: rollbackContext,
|
|
1872
|
+
});
|
|
1873
|
+
if (Date.parse(String(plan.expiresAt)) <= Date.now()) {
|
|
1874
|
+
throw new OperateClientError('ROLLBACK_NOT_ELIGIBLE', 'Rollback approval must bind the exact live plan, parent operation/result, and target precondition.', false);
|
|
1875
|
+
}
|
|
1876
|
+
rollbackSourceTemplate = exactRollbackApprovalTemplate(snapshot, selected, request.actor);
|
|
1877
|
+
const rollbackEvaluationId = stableId('pevl', `rollback:${sha256Jcs(rollbackContext)}`);
|
|
1878
|
+
const rollbackEvaluationEvents = runtime.events.filter((event) => event.type === 'policy.evaluated' && event.entityId === rollbackEvaluationId);
|
|
1879
|
+
const stagedTemplateExists = rollbackSourceTemplate.evaluation.evaluationId === rollbackEvaluationId;
|
|
1880
|
+
if (stagedTemplateExists) {
|
|
1881
|
+
if (rollbackEvaluationEvents.length !== 1 ||
|
|
1882
|
+
Date.parse(String(rollbackSourceTemplate.requirement.expiresAt)) <= Date.now()) {
|
|
1883
|
+
throw new OperateClientError('APPROVAL_INVALID', 'The exact staged rollback approval template is unavailable or expired.', false);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
else {
|
|
1887
|
+
if (rollbackEvaluationEvents.length !== 0) {
|
|
1888
|
+
throw new OperateClientError('APPROVAL_INVALID', 'The rollback approval evaluation identity already exists with different custody.', false);
|
|
1889
|
+
}
|
|
1890
|
+
const evaluatedAt = timestamp();
|
|
1891
|
+
const rollbackEvaluation = evaluateOperatingActionPolicyV2({
|
|
1892
|
+
action: selected,
|
|
1893
|
+
configuredPolicies: snapshot.actionPolicies,
|
|
1894
|
+
evaluatedAt,
|
|
1895
|
+
evaluationId: rollbackEvaluationId,
|
|
1896
|
+
});
|
|
1897
|
+
const rollbackRequirement = createOperatingApprovalRequirementV2({
|
|
1898
|
+
policyRequirementId: GOVERNED_APPROVAL_TEMPLATE_ID,
|
|
1899
|
+
evaluation: rollbackEvaluation,
|
|
1900
|
+
action: selected,
|
|
1901
|
+
parties: structuredClone(rollbackSourceTemplate.requirement.parties),
|
|
1902
|
+
threshold: Number(rollbackSourceTemplate.requirement.threshold),
|
|
1903
|
+
expiresAt: later(evaluatedAt, 10 * 60_000),
|
|
1904
|
+
consumable: true,
|
|
1905
|
+
});
|
|
1906
|
+
const stagedBase = {
|
|
1907
|
+
...runtime.baseState,
|
|
1908
|
+
approvalRequirements: mergeRecordsBy(runtime.baseState.approvalRequirements, [rollbackRequirement], (record) => String(record.requirementId)),
|
|
1909
|
+
};
|
|
1910
|
+
workingState = {
|
|
1911
|
+
...snapshot,
|
|
1912
|
+
approvalRequirements: mergeRecordsBy(snapshot.approvalRequirements, [rollbackRequirement], (record) => String(record.requirementId)),
|
|
1913
|
+
};
|
|
1914
|
+
workingRuntime = { ...runtime, baseState: stagedBase, state: workingState };
|
|
1915
|
+
const evaluated = await this.event(workingRuntime, {
|
|
1916
|
+
type: 'policy.evaluated',
|
|
1917
|
+
entityId: String(rollbackEvaluation.evaluationId),
|
|
1918
|
+
cycleId: String(selected.sourceCycleId),
|
|
1919
|
+
correlationId: stableId('corr', `rollback-approval:${sha256Jcs(rollbackContext)}`),
|
|
1920
|
+
timestamp: evaluatedAt,
|
|
1921
|
+
requestHash: String(rollbackEvaluation.inputHash),
|
|
1922
|
+
actor: { kind: 'runtime', id: 'openplanr' },
|
|
1923
|
+
payload: rollbackEvaluation,
|
|
1924
|
+
});
|
|
1925
|
+
workingState = (await this.composition()).reduce(workingState, [evaluated], runtime.artifacts);
|
|
1926
|
+
prefixEvents.push(evaluated);
|
|
1927
|
+
workingRuntime = {
|
|
1928
|
+
...workingRuntime,
|
|
1929
|
+
state: workingState,
|
|
1930
|
+
events: [...runtime.events, evaluated],
|
|
1931
|
+
};
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
const rollbackTemplate = rollbackContext
|
|
1935
|
+
? exactRollbackApprovalTemplate(workingState, selected, request.actor)
|
|
1936
|
+
: null;
|
|
1937
|
+
if (rollbackSourceTemplate &&
|
|
1938
|
+
rollbackTemplate &&
|
|
1939
|
+
(!sameCanonicalValue(rollbackTemplate.requirement.parties, rollbackSourceTemplate.requirement.parties) ||
|
|
1940
|
+
rollbackTemplate.requirement.threshold !== rollbackSourceTemplate.requirement.threshold)) {
|
|
1941
|
+
throw new OperateClientError('APPROVAL_INVALID', 'Rollback approval parties or threshold diverged from the exact source template.', false);
|
|
1942
|
+
}
|
|
1943
|
+
const evaluations = workingState.policyEvaluations
|
|
1944
|
+
.filter((candidate) => candidate.action?.actionId === selected.actionId &&
|
|
1945
|
+
candidate.action?.revision === selected.revision &&
|
|
1946
|
+
candidate.action?.actionHash === selected.actionHash)
|
|
1947
|
+
.sort((left, right) => String(left.evaluatedAt).localeCompare(String(right.evaluatedAt)) ||
|
|
1948
|
+
String(left.evaluationId).localeCompare(String(right.evaluationId)));
|
|
1949
|
+
const evaluation = rollbackTemplate?.evaluation ?? evaluations.at(-1);
|
|
1950
|
+
if (!evaluation) {
|
|
1951
|
+
throw new OperateClientError('POLICY_EVALUATION_REJECTED', 'The exact current Action has no durable policy evaluation.', false);
|
|
1952
|
+
}
|
|
1953
|
+
const requirementIds = Array.isArray(evaluation.approvalRequirementIds)
|
|
1954
|
+
? evaluation.approvalRequirementIds
|
|
1955
|
+
: [];
|
|
1956
|
+
const requirements = workingState.approvalRequirements.filter((candidate) => requirementIds.includes(candidate.requirementId));
|
|
1957
|
+
const requirement = rollbackTemplate?.requirement ??
|
|
1958
|
+
requirements.find((candidate) => Array.isArray(candidate.parties) &&
|
|
1959
|
+
candidate.parties.some((party) => party !== null &&
|
|
1960
|
+
typeof party === 'object' &&
|
|
1961
|
+
party.actorKind === 'human' &&
|
|
1962
|
+
party.actorId === request.actor.actorId));
|
|
1963
|
+
const party = rollbackTemplate?.party ??
|
|
1964
|
+
(Array.isArray(requirement?.parties)
|
|
1965
|
+
? requirement.parties.find((candidate) => candidate !== null &&
|
|
1966
|
+
typeof candidate === 'object' &&
|
|
1967
|
+
candidate.actorKind === 'human' &&
|
|
1968
|
+
candidate.actorId === request.actor.actorId)
|
|
1969
|
+
: null);
|
|
1970
|
+
if (!requirement || !party || typeof party !== 'object' || Array.isArray(party)) {
|
|
1971
|
+
throw new OperateClientError('APPROVAL_INVALID', 'The authenticated actor is not a named party for the current approval requirement.', false);
|
|
1972
|
+
}
|
|
1973
|
+
const issuedAt = timestamp();
|
|
1974
|
+
const rollbackBindingHash = rollbackContext
|
|
1975
|
+
? sha256Jcs({
|
|
1976
|
+
contract: 'openplanr-rollback-approval-v1',
|
|
1977
|
+
action: actionIdentity(selected),
|
|
1978
|
+
...rollbackContext,
|
|
1979
|
+
})
|
|
1980
|
+
: null;
|
|
1981
|
+
if (rollbackTemplate &&
|
|
1982
|
+
rollbackBindingHash &&
|
|
1983
|
+
exactRollbackApprovalRecord(workingState, selected, request.actor, rollbackTemplate, rollbackBindingHash, issuedAt)) {
|
|
1984
|
+
throw new OperateClientError('APPROVAL_INVALID', 'This exact rollback approval party has already recorded its decision.', false);
|
|
1985
|
+
}
|
|
1986
|
+
const approval = createOperatingApprovalRecordV2({
|
|
1987
|
+
approvalId: stableId('aprv', `${selected.actionHash}:${requirement.requirementId}:${party.partyId}:${request.decision}:${rollbackBindingHash ?? 'execute'}`),
|
|
1988
|
+
requirement: requirement,
|
|
1989
|
+
evaluation: evaluation,
|
|
1990
|
+
action: selected,
|
|
1991
|
+
partyId: String(party.partyId),
|
|
1992
|
+
actor: {
|
|
1993
|
+
kind: 'human',
|
|
1994
|
+
actorId: request.actor.actorId,
|
|
1995
|
+
capability: structuredClone(party.requiredCapability),
|
|
1996
|
+
},
|
|
1997
|
+
decision: request.decision,
|
|
1998
|
+
issuedAt,
|
|
1999
|
+
expiresAt: requirement.expiresAt ?? null,
|
|
2000
|
+
});
|
|
2001
|
+
const approvalEvent = await this.event(workingRuntime, {
|
|
2002
|
+
type: 'approval.recorded',
|
|
2003
|
+
entityId: approval.approvalId,
|
|
2004
|
+
cycleId: String(selected.sourceCycleId),
|
|
2005
|
+
correlationId: stableId('corr', `approval:${approval.approvalId}`),
|
|
2006
|
+
timestamp: approval.issuedAt,
|
|
2007
|
+
actor: { kind: 'human', id: request.actor.actorId },
|
|
2008
|
+
...(rollbackBindingHash ? { requestHash: rollbackBindingHash } : {}),
|
|
2009
|
+
payload: approval,
|
|
2010
|
+
});
|
|
2011
|
+
let nextState = (await this.composition()).reduce(workingState, [approvalEvent], runtime.artifacts);
|
|
2012
|
+
const approvals = [
|
|
2013
|
+
...workingState.approvalRecords.filter((candidate) => candidate.evaluationId === evaluation.evaluationId),
|
|
2014
|
+
approval,
|
|
2015
|
+
];
|
|
2016
|
+
const disposition = evaluateOperatingApprovalSetV2({
|
|
2017
|
+
evaluation: evaluation,
|
|
2018
|
+
action: selected,
|
|
2019
|
+
requirements: requirements,
|
|
2020
|
+
approvals: approvals,
|
|
2021
|
+
now: issuedAt,
|
|
2022
|
+
});
|
|
2023
|
+
const events = [...prefixEvents, approvalEvent];
|
|
2024
|
+
if (disposition.disposition !== null && !rollbackContext) {
|
|
2025
|
+
const transitionEvent = await this.event({ ...runtime, state: nextState, events: [...runtime.events, approvalEvent] }, {
|
|
2026
|
+
type: `action.${disposition.disposition}`,
|
|
2027
|
+
entityId: String(selected.actionId),
|
|
2028
|
+
cycleId: String(selected.sourceCycleId),
|
|
2029
|
+
correlationId: stableId('corr', `approval:${approval.approvalId}`),
|
|
2030
|
+
timestamp: issuedAt,
|
|
2031
|
+
actor: { kind: 'engine', id: 'openplanr' },
|
|
2032
|
+
payload: {
|
|
2033
|
+
action: structuredClone(request.action),
|
|
2034
|
+
from: selected.state,
|
|
2035
|
+
to: disposition.disposition,
|
|
2036
|
+
operationId: null,
|
|
2037
|
+
resultId: null,
|
|
2038
|
+
reasonCode: null,
|
|
2039
|
+
},
|
|
2040
|
+
});
|
|
2041
|
+
nextState = (await this.composition()).reduce(nextState, [transitionEvent], runtime.artifacts);
|
|
2042
|
+
events.push(transitionEvent);
|
|
2043
|
+
}
|
|
2044
|
+
const committed = await this.commit(workingRuntime, nextState, events.slice(prefixEvents.length));
|
|
2045
|
+
return this.success('operate.action.approve', {
|
|
2046
|
+
generation: committed.generation,
|
|
2047
|
+
actionId: selected.actionId,
|
|
2048
|
+
disposition: request.decision,
|
|
2049
|
+
complete: disposition.complete,
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
async prepareTerminalVerificationSubmission(runtime, nextState, events, assignmentId, actorId) {
|
|
2053
|
+
const composition = await this.composition();
|
|
2054
|
+
const withReservation = withVerificationArtifactReservations(runtime, nextState);
|
|
2055
|
+
const assignment = findBy(nextState.assignments, 'assignmentId', assignmentId);
|
|
2056
|
+
if (assignment?.assignmentKind !== 'verification' || assignment.state !== 'available') {
|
|
2057
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The terminal operation did not produce one available canonical verification Assignment.', false, { assignmentId });
|
|
2058
|
+
}
|
|
2059
|
+
const correlationId = stableId('corr', `verification-claim:${assignmentId}`);
|
|
2060
|
+
const submissionId = stableId('sub', `verification:${assignmentId}`);
|
|
2061
|
+
let working = {
|
|
2062
|
+
...withReservation,
|
|
2063
|
+
state: nextState,
|
|
2064
|
+
events: [...runtime.events, ...events],
|
|
2065
|
+
};
|
|
2066
|
+
const claimed = await this.event(working, {
|
|
2067
|
+
type: 'assignment.claimed',
|
|
2068
|
+
entityId: assignmentId,
|
|
2069
|
+
cycleId: String(assignment.cycleId),
|
|
2070
|
+
correlationId,
|
|
2071
|
+
actor: { kind: 'runtime', id: 'openplanr' },
|
|
2072
|
+
payload: {
|
|
2073
|
+
assignmentId,
|
|
2074
|
+
actorId,
|
|
2075
|
+
actorKind: 'agent',
|
|
2076
|
+
runtime: 'openplanr',
|
|
2077
|
+
claimId: stableId('clm', `verification:${assignmentId}`),
|
|
2078
|
+
submissionId,
|
|
2079
|
+
},
|
|
2080
|
+
});
|
|
2081
|
+
const claimedState = composition.reduce(nextState, [claimed], runtime.artifacts);
|
|
2082
|
+
working = {
|
|
2083
|
+
...working,
|
|
2084
|
+
state: claimedState,
|
|
2085
|
+
events: [...working.events, claimed],
|
|
2086
|
+
};
|
|
2087
|
+
const started = await this.event(working, {
|
|
2088
|
+
type: 'assignment.started',
|
|
2089
|
+
entityId: assignmentId,
|
|
2090
|
+
cycleId: String(assignment.cycleId),
|
|
2091
|
+
correlationId,
|
|
2092
|
+
actor: { kind: 'runtime', id: 'openplanr' },
|
|
2093
|
+
payload: { assignmentId, attempt: 1 },
|
|
2094
|
+
});
|
|
2095
|
+
const runningState = composition.reduce(claimedState, [started], runtime.artifacts);
|
|
2096
|
+
return {
|
|
2097
|
+
runtime: withReservation,
|
|
2098
|
+
state: runningState,
|
|
2099
|
+
events: [...events, claimed, started],
|
|
2100
|
+
};
|
|
2101
|
+
}
|
|
2102
|
+
async executeAction(request) {
|
|
2103
|
+
const runtime = await this.requiredRuntime();
|
|
2104
|
+
const snapshot = state(runtime);
|
|
2105
|
+
const selected = exactAction(snapshot, request.action);
|
|
2106
|
+
if (request.actor.actorId !== selected.ownerActorId) {
|
|
2107
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'Only the exact current Action owner may execute this contained Action.', false);
|
|
2108
|
+
}
|
|
2109
|
+
const payload = artifactValue(runtime, String(selected.sourceArtifactId));
|
|
2110
|
+
const executionBinding = record(selected.executionBinding);
|
|
2111
|
+
const rollbackRequired = executionBinding.rollbackRequired === true;
|
|
2112
|
+
const baselineId = rollbackRequired
|
|
2113
|
+
? selected.preconditionArtifactIds.find((artifactId) => artifactId !== selected.sourceArtifactId)
|
|
2114
|
+
: null;
|
|
2115
|
+
if (rollbackRequired && typeof baselineId !== 'string') {
|
|
2116
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'A reversible Action has no exact rollback-baseline Artifact.', false);
|
|
2117
|
+
}
|
|
2118
|
+
const baseline = typeof baselineId === 'string' ? artifactValue(runtime, baselineId) : null;
|
|
2119
|
+
const executeRequest = {
|
|
2120
|
+
actionId: selected.actionId,
|
|
2121
|
+
payload: {
|
|
2122
|
+
artifactId: payload.artifact.artifactId,
|
|
2123
|
+
contentHash: sha256Jcs(payload.value),
|
|
2124
|
+
value: payload.value,
|
|
2125
|
+
},
|
|
2126
|
+
rollbackBaseline: baseline
|
|
2127
|
+
? {
|
|
2128
|
+
artifactId: baseline.artifact.artifactId,
|
|
2129
|
+
contentHash: sha256Jcs(baseline.value),
|
|
2130
|
+
value: baseline.value,
|
|
2131
|
+
}
|
|
2132
|
+
: null,
|
|
2133
|
+
};
|
|
2134
|
+
const draft = governedDraft(selected, 'execute');
|
|
2135
|
+
let checkpoint = structuredClone(snapshot);
|
|
2136
|
+
const checkpointStore = {
|
|
2137
|
+
readSnapshot: () => structuredClone(checkpoint),
|
|
2138
|
+
compareAndSwap: ({ expectedEventHead, nextState }) => {
|
|
2139
|
+
const expected = record(expectedEventHead);
|
|
2140
|
+
const current = record(checkpoint.eventHead);
|
|
2141
|
+
const committed = expected.sequence === current.sequence && expected.hash === current.hash;
|
|
2142
|
+
if (committed)
|
|
2143
|
+
checkpoint = structuredClone(nextState);
|
|
2144
|
+
return { committed, state: structuredClone(checkpoint) };
|
|
2145
|
+
},
|
|
2146
|
+
};
|
|
2147
|
+
const actionId = String(selected.actionId);
|
|
2148
|
+
const targetAdapter = this.containedTargets.get(actionId) ??
|
|
2149
|
+
createDisposableLocalProjectTargetV2({
|
|
2150
|
+
target: selected.targetBinding,
|
|
2151
|
+
initialValue: baseline?.value ?? null,
|
|
2152
|
+
});
|
|
2153
|
+
this.containedTargets.set(actionId, targetAdapter);
|
|
2154
|
+
const governed = createOperatingGovernedExecutionRuntimeV2({
|
|
2155
|
+
initialState: snapshot,
|
|
2156
|
+
checkpointStore: checkpointStore,
|
|
2157
|
+
artifactStore: governedArtifactStore(runtime),
|
|
2158
|
+
runtimeActorId: 'openplanr',
|
|
2159
|
+
});
|
|
2160
|
+
const completed = await governed.execute(executeRequest, draft, {
|
|
2161
|
+
trustedHost: OPEN_REFERENCE_PROJECT_EXECUTOR_HOST_V2,
|
|
2162
|
+
targetAdapter,
|
|
2163
|
+
});
|
|
2164
|
+
let nextState = completed.state;
|
|
2165
|
+
const events = [...completed.events];
|
|
2166
|
+
if (rollbackRequired && baseline) {
|
|
2167
|
+
const plan = buildOperatingRollbackPlanV2({
|
|
2168
|
+
operation: completed.operation,
|
|
2169
|
+
result: completed.result,
|
|
2170
|
+
baseline: executeRequest.rollbackBaseline,
|
|
2171
|
+
expiresAt: later(String(draft.completedAt), 7 * 24 * 60 * 60_000),
|
|
2172
|
+
});
|
|
2173
|
+
const planned = recordOperatingRollbackPlanV2({
|
|
2174
|
+
state: completed.state,
|
|
2175
|
+
plan,
|
|
2176
|
+
eventId: stableId('evt', `rollback-plan:${completed.operation.operationId}`),
|
|
2177
|
+
runtimeActorId: 'openplanr',
|
|
2178
|
+
});
|
|
2179
|
+
nextState = planned.state;
|
|
2180
|
+
events.push(planned.event);
|
|
2181
|
+
}
|
|
2182
|
+
const composition = await this.composition();
|
|
2183
|
+
const verificationCreatedIndex = events.findIndex((event) => event.type === 'assignment.created' &&
|
|
2184
|
+
record(event.payload).assignmentKind === 'verification');
|
|
2185
|
+
if (verificationCreatedIndex < 0) {
|
|
2186
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'Terminal contained execution produced no verification Assignment.', false);
|
|
2187
|
+
}
|
|
2188
|
+
// The governed runtime returns the complete terminal state, including the
|
|
2189
|
+
// newly-created verification Assignment. Scheduling that creation Event
|
|
2190
|
+
// against the terminal state replays an earlier Event at a later head.
|
|
2191
|
+
// Rebuild the exact pre-creation state, then let the scheduler consume the
|
|
2192
|
+
// untouched terminal suffix and append its owner-issued release Event.
|
|
2193
|
+
const preCreationEvents = events.slice(0, verificationCreatedIndex);
|
|
2194
|
+
const schedulingBase = composition.reduce(snapshot, preCreationEvents, runtime.artifacts);
|
|
2195
|
+
const schedulingEvents = events.slice(verificationCreatedIndex);
|
|
2196
|
+
const scheduled = composition.schedule(schedulingBase, schedulingEvents);
|
|
2197
|
+
nextState = scheduled.state;
|
|
2198
|
+
events.splice(verificationCreatedIndex, events.length - verificationCreatedIndex, ...scheduled.events);
|
|
2199
|
+
const prepared = await this.prepareTerminalVerificationSubmission(runtime, nextState, events, String(record(events[verificationCreatedIndex].payload).assignmentId), request.actor.actorId);
|
|
2200
|
+
const committed = await this.commit(prepared.runtime, prepared.state, prepared.events);
|
|
2201
|
+
return this.success('operate.action.execute', {
|
|
2202
|
+
generation: committed.generation,
|
|
2203
|
+
operationId: completed.operation.operationId,
|
|
2204
|
+
resultId: completed.result.resultId,
|
|
2205
|
+
replayed: completed.replayed,
|
|
2206
|
+
effectCount: completed.effectCount,
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
async rollbackAction(request) {
|
|
2210
|
+
const runtime = await this.requiredRuntime();
|
|
2211
|
+
const snapshot = state(runtime);
|
|
2212
|
+
const selected = exactAction(snapshot, request.action);
|
|
2213
|
+
if (request.actor.actorId !== selected.ownerActorId) {
|
|
2214
|
+
throw new OperateClientError('CAPABILITY_DENIED', 'Only the exact current Action owner may roll back this contained Action.', false);
|
|
2215
|
+
}
|
|
2216
|
+
const { operation: original, plan, binding, } = exactRollbackPlanContext(snapshot, selected, {
|
|
2217
|
+
originalOperationId: request.originalOperationId,
|
|
2218
|
+
rollbackPlanId: request.rollbackPlanId,
|
|
2219
|
+
});
|
|
2220
|
+
const payload = artifactValue(runtime, String(selected.sourceArtifactId));
|
|
2221
|
+
const baseline = artifactValue(runtime, String(plan.baselineArtifactId));
|
|
2222
|
+
const rollbackRequest = {
|
|
2223
|
+
actionId: selected.actionId,
|
|
2224
|
+
originalOperationId: original.operationId,
|
|
2225
|
+
rollbackPlanId: plan.rollbackPlanId,
|
|
2226
|
+
payload: {
|
|
2227
|
+
artifactId: payload.artifact.artifactId,
|
|
2228
|
+
contentHash: sha256Jcs(payload.value),
|
|
2229
|
+
value: payload.value,
|
|
2230
|
+
},
|
|
2231
|
+
rollbackBaseline: {
|
|
2232
|
+
artifactId: baseline.artifact.artifactId,
|
|
2233
|
+
contentHash: sha256Jcs(baseline.value),
|
|
2234
|
+
value: baseline.value,
|
|
2235
|
+
},
|
|
2236
|
+
};
|
|
2237
|
+
const preparedAt = timestamp();
|
|
2238
|
+
const draft = governedDraft(selected, 'rollback', preparedAt);
|
|
2239
|
+
const replaying = snapshot.governedOperations.some((candidate) => candidate.operationId === draft.operationId &&
|
|
2240
|
+
candidate.operationKind === 'rollback' &&
|
|
2241
|
+
candidate.parentOperationId === original.operationId &&
|
|
2242
|
+
candidate.rollbackPlanId === plan.rollbackPlanId);
|
|
2243
|
+
const bindingHash = sha256Jcs({
|
|
2244
|
+
contract: 'openplanr-rollback-approval-v1',
|
|
2245
|
+
action: actionIdentity(selected),
|
|
2246
|
+
...binding,
|
|
2247
|
+
});
|
|
2248
|
+
const template = exactRollbackApprovalTemplate(snapshot, selected, request.actor);
|
|
2249
|
+
const approval = exactRollbackApprovalRecord(snapshot, selected, request.actor, template, bindingHash, preparedAt);
|
|
2250
|
+
if (!replaying &&
|
|
2251
|
+
(!approval || Date.parse(String(approval.expiresAt)) <= Date.parse(preparedAt))) {
|
|
2252
|
+
throw new OperateClientError('APPROVAL_INVALID', 'Rollback requires one distinct fresh human approval bound to the exact current plan, parent result, and target precondition.', false);
|
|
2253
|
+
}
|
|
2254
|
+
let checkpoint = structuredClone(snapshot);
|
|
2255
|
+
const checkpointStore = {
|
|
2256
|
+
readSnapshot: () => structuredClone(checkpoint),
|
|
2257
|
+
compareAndSwap: ({ expectedEventHead, nextState }) => {
|
|
2258
|
+
const expected = record(expectedEventHead);
|
|
2259
|
+
const current = record(checkpoint.eventHead);
|
|
2260
|
+
const committed = expected.sequence === current.sequence && expected.hash === current.hash;
|
|
2261
|
+
if (committed)
|
|
2262
|
+
checkpoint = structuredClone(record(nextState));
|
|
2263
|
+
return { committed, state: structuredClone(checkpoint) };
|
|
2264
|
+
},
|
|
2265
|
+
};
|
|
2266
|
+
const targetAdapter = replaying
|
|
2267
|
+
? undefined
|
|
2268
|
+
: this.containedTargets.get(String(selected.actionId));
|
|
2269
|
+
if (!replaying && !targetAdapter) {
|
|
2270
|
+
throw new OperateClientError('OPERATION_UNCERTAIN', 'The exact process-local contained target receipt is unavailable after restart; blind rollback is forbidden and recovery inspection is required.', false, { actionId: String(selected.actionId), originalOperationId: String(original.operationId) });
|
|
2271
|
+
}
|
|
2272
|
+
const governed = createOperatingGovernedRecoveryRuntimeV2({
|
|
2273
|
+
initialState: snapshot,
|
|
2274
|
+
checkpointStore: checkpointStore,
|
|
2275
|
+
artifactStore: governedArtifactStore(runtime),
|
|
2276
|
+
runtimeActorId: 'openplanr',
|
|
2277
|
+
});
|
|
2278
|
+
const completed = await governed.rollback(rollbackRequest, draft, {
|
|
2279
|
+
trustedHost: OPEN_REFERENCE_PROJECT_EXECUTOR_HOST_V2,
|
|
2280
|
+
targetAdapter: targetAdapter,
|
|
2281
|
+
});
|
|
2282
|
+
if (completed.replayed) {
|
|
2283
|
+
return this.success('operate.action.rollback', {
|
|
2284
|
+
generation: runtime.generation,
|
|
2285
|
+
operationId: completed.operation.operationId,
|
|
2286
|
+
resultId: completed.result.rollbackResultId,
|
|
2287
|
+
replayed: true,
|
|
2288
|
+
effectCount: 0,
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
const rollbackEvents = [...completed.events];
|
|
2292
|
+
const composition = await this.composition();
|
|
2293
|
+
const verificationCreatedIndex = rollbackEvents.findIndex((event) => event.type === 'assignment.created' &&
|
|
2294
|
+
record(event.payload).assignmentKind === 'verification');
|
|
2295
|
+
if (verificationCreatedIndex < 0) {
|
|
2296
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'Terminal contained rollback produced no verification Assignment.', false);
|
|
2297
|
+
}
|
|
2298
|
+
const scheduled = composition.schedule(completed.state, [
|
|
2299
|
+
rollbackEvents[verificationCreatedIndex],
|
|
2300
|
+
]);
|
|
2301
|
+
rollbackEvents.push(...scheduled.releaseEvents);
|
|
2302
|
+
const rollbackState = scheduled.state;
|
|
2303
|
+
const prepared = await this.prepareTerminalVerificationSubmission(runtime, rollbackState, rollbackEvents, String(record(rollbackEvents[verificationCreatedIndex].payload).assignmentId), request.actor.actorId);
|
|
2304
|
+
const committed = await this.commit(prepared.runtime, prepared.state, prepared.events);
|
|
2305
|
+
return this.success('operate.action.rollback', {
|
|
2306
|
+
generation: committed.generation,
|
|
2307
|
+
operationId: completed.operation.operationId,
|
|
2308
|
+
rollbackResultId: completed.result.rollbackResultId,
|
|
2309
|
+
replayed: completed.replayed,
|
|
2310
|
+
effectCount: completed.effectCount,
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2313
|
+
async inspectRecovery() {
|
|
2314
|
+
const composition = await this.composition();
|
|
2315
|
+
return (await inspectOperateRecovery({
|
|
2316
|
+
store: this.store,
|
|
2317
|
+
composition,
|
|
2318
|
+
}));
|
|
2319
|
+
}
|
|
2320
|
+
async restore(generation) {
|
|
2321
|
+
const composition = await this.composition();
|
|
2322
|
+
return (await restoreOperateGeneration({
|
|
2323
|
+
store: this.store,
|
|
2324
|
+
composition,
|
|
2325
|
+
generation,
|
|
2326
|
+
}));
|
|
2327
|
+
}
|
|
2328
|
+
async clearStaleLock() {
|
|
2329
|
+
return (await clearOperateStaleLock(this.store));
|
|
2330
|
+
}
|
|
2331
|
+
async requiredRuntime() {
|
|
2332
|
+
const runtime = await this.load();
|
|
2333
|
+
if (!runtime) {
|
|
2334
|
+
throw new OperateClientError('CYCLE_NOT_FOUND', 'No durable Operate lifecycle exists.', false);
|
|
2335
|
+
}
|
|
2336
|
+
return runtime;
|
|
2337
|
+
}
|
|
2338
|
+
async runtimeAtEventHead(runtime, expectedEventHead) {
|
|
2339
|
+
const expected = expectedEventHead;
|
|
2340
|
+
if (!Number.isSafeInteger(expected.sequence) ||
|
|
2341
|
+
expected.sequence < 0 ||
|
|
2342
|
+
(expected.sequence === 0
|
|
2343
|
+
? expected.hash !== null
|
|
2344
|
+
: !/^sha256:[a-f0-9]{64}$/u.test(String(expected.hash)))) {
|
|
2345
|
+
throw new OperateClientError('RESULT_CONTRACT_INVALID', 'The historical operating Event head is malformed.', false);
|
|
2346
|
+
}
|
|
2347
|
+
const currentHead = state(runtime).eventHead;
|
|
2348
|
+
if (expected.sequence > currentHead.sequence) {
|
|
2349
|
+
throw new OperateClientError('CONCURRENT_MODIFICATION', 'The requested historical operating Event head is not committed.', false);
|
|
2350
|
+
}
|
|
2351
|
+
if (expected.sequence === currentHead.sequence) {
|
|
2352
|
+
if (expected.hash !== currentHead.hash) {
|
|
2353
|
+
throw new OperateClientError('CONCURRENT_MODIFICATION', 'The requested historical operating Event head has divergent custody.', false);
|
|
2354
|
+
}
|
|
2355
|
+
return runtime;
|
|
2356
|
+
}
|
|
2357
|
+
const baseHead = record(runtime.baseState.eventHead);
|
|
2358
|
+
const baseSequence = Number(baseHead.sequence);
|
|
2359
|
+
if (!Number.isSafeInteger(baseSequence) ||
|
|
2360
|
+
baseSequence < 0 ||
|
|
2361
|
+
(baseSequence === 0
|
|
2362
|
+
? baseHead.hash !== null
|
|
2363
|
+
: !/^sha256:[a-f0-9]{64}$/u.test(String(baseHead.hash))) ||
|
|
2364
|
+
expected.sequence < baseSequence ||
|
|
2365
|
+
(expected.sequence === baseSequence && expected.hash !== baseHead.hash)) {
|
|
2366
|
+
throw new OperateClientError('CONTRACT_VERSION_UNSUPPORTED', 'The requested historical operating Event head predates retained replay custody.', false);
|
|
2367
|
+
}
|
|
2368
|
+
const retainedEvents = runtime.events.filter((event) => Number(event.sequence) <= expected.sequence);
|
|
2369
|
+
if (expected.sequence === baseSequence) {
|
|
2370
|
+
return {
|
|
2371
|
+
...runtime,
|
|
2372
|
+
state: structuredClone(runtime.baseState),
|
|
2373
|
+
events: [],
|
|
2374
|
+
};
|
|
2375
|
+
}
|
|
2376
|
+
const replayEvents = runtime.events.filter((event) => {
|
|
2377
|
+
const sequence = Number(event.sequence);
|
|
2378
|
+
return sequence > baseSequence && sequence <= expected.sequence;
|
|
2379
|
+
});
|
|
2380
|
+
const terminal = replayEvents.at(-1);
|
|
2381
|
+
if (replayEvents.length !== expected.sequence - baseSequence ||
|
|
2382
|
+
Number(terminal?.sequence) !== expected.sequence ||
|
|
2383
|
+
terminal?.eventHash !== expected.hash) {
|
|
2384
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'The retained Event ledger cannot reconstruct the requested historical head.', false);
|
|
2385
|
+
}
|
|
2386
|
+
const historicalState = (await this.composition()).replay(runtime.baseState, replayEvents, runtime.artifacts);
|
|
2387
|
+
if (historicalState.eventHead.sequence !== expected.sequence ||
|
|
2388
|
+
historicalState.eventHead.hash !== expected.hash) {
|
|
2389
|
+
throw new OperateClientError('OPERATE_STORE_CORRUPT', 'Historical replay did not reproduce the exact requested Event head.', false);
|
|
2390
|
+
}
|
|
2391
|
+
return {
|
|
2392
|
+
...runtime,
|
|
2393
|
+
state: historicalState,
|
|
2394
|
+
events: structuredClone(retainedEvents),
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2397
|
+
async commit(runtime, nextState, events) {
|
|
2398
|
+
return await this.store.commit({
|
|
2399
|
+
baseState: runtime.baseState,
|
|
2400
|
+
state: nextState,
|
|
2401
|
+
events: [...runtime.events, ...events],
|
|
2402
|
+
artifacts: runtime.artifacts,
|
|
2403
|
+
preferences: runtime.preferences,
|
|
2404
|
+
}, runtime.generation);
|
|
2405
|
+
}
|
|
2406
|
+
success(operation, data, allowedActions = []) {
|
|
2407
|
+
return { ok: true, operation, data, allowedActions };
|
|
2408
|
+
}
|
|
2409
|
+
failure(operation, cause) {
|
|
2410
|
+
const known = cause instanceof OperateClientError ? cause : null;
|
|
2411
|
+
const code = known?.code ?? errorCode(cause);
|
|
2412
|
+
return {
|
|
2413
|
+
ok: false,
|
|
2414
|
+
operation,
|
|
2415
|
+
error: {
|
|
2416
|
+
code,
|
|
2417
|
+
message: known?.message ??
|
|
2418
|
+
(cause instanceof Error
|
|
2419
|
+
? cause.message
|
|
2420
|
+
: 'The requested operation could not be completed.'),
|
|
2421
|
+
retryable: known?.retryable ??
|
|
2422
|
+
Boolean(cause?.details?.retryable),
|
|
2423
|
+
context: known?.context ?? errorContext(cause),
|
|
2424
|
+
},
|
|
2425
|
+
allowedActions: code.startsWith('OPERATE_STORE_') ? [recoveryAction()] : [],
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
export function createOperateClient(projectDir) {
|
|
2430
|
+
return new OperateClient(projectDir);
|
|
2431
|
+
}
|
|
2432
|
+
//# sourceMappingURL=client.js.map
|