oh-my-super-agent 0.1.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/.agents/agents/advisor.md +15 -0
- package/.agents/agents/conductor.md +32 -0
- package/.agents/agents/dreamer.md +13 -0
- package/.agents/agents/executor.md +17 -0
- package/.agents/agents/grader.md +15 -0
- package/.agents/config/endurance-policy.json +8 -0
- package/.agents/config/oms-config.json +119 -0
- package/.agents/config/release-policy.json +12 -0
- package/.agents/config/secret-scan-policy.json +7 -0
- package/.agents/config/verification-plan.json +33 -0
- package/.agents/registry.json +11 -0
- package/.agents/rules/constitution.md +7 -0
- package/.agents/skills/conductor/SKILL.md +23 -0
- package/.agents/skills/dream/SKILL.md +14 -0
- package/.agents/skills/executor/SKILL.md +13 -0
- package/.agents/skills/oms/SKILL.md +52 -0
- package/.agents/skills/quota-aware/SKILL.md +12 -0
- package/.agents/skills/schedule/SKILL.md +13 -0
- package/.agents/skills/team-protocol/SKILL.md +20 -0
- package/LICENSE +21 -0
- package/README.md +146 -0
- package/dist/src/audit/run-ledger.d.ts +183 -0
- package/dist/src/audit/run-ledger.js +1655 -0
- package/dist/src/audit/run-ledger.js.map +1 -0
- package/dist/src/cli.d.ts +61 -0
- package/dist/src/cli.js +2096 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/github-queue-probe.d.ts +26 -0
- package/dist/src/commands/github-queue-probe.js +51 -0
- package/dist/src/commands/github-queue-probe.js.map +1 -0
- package/dist/src/commands/trace-fixture.d.ts +20 -0
- package/dist/src/commands/trace-fixture.js +72 -0
- package/dist/src/commands/trace-fixture.js.map +1 -0
- package/dist/src/conductor/activity.d.ts +46 -0
- package/dist/src/conductor/activity.js +224 -0
- package/dist/src/conductor/activity.js.map +1 -0
- package/dist/src/conductor/bridge.d.ts +53 -0
- package/dist/src/conductor/bridge.js +652 -0
- package/dist/src/conductor/bridge.js.map +1 -0
- package/dist/src/conductor/notifications.d.ts +59 -0
- package/dist/src/conductor/notifications.js +381 -0
- package/dist/src/conductor/notifications.js.map +1 -0
- package/dist/src/conductor/recovery.d.ts +29 -0
- package/dist/src/conductor/recovery.js +198 -0
- package/dist/src/conductor/recovery.js.map +1 -0
- package/dist/src/conductor/start.d.ts +73 -0
- package/dist/src/conductor/start.js +519 -0
- package/dist/src/conductor/start.js.map +1 -0
- package/dist/src/conductor/waiter.d.ts +88 -0
- package/dist/src/conductor/waiter.js +427 -0
- package/dist/src/conductor/waiter.js.map +1 -0
- package/dist/src/config.d.ts +9 -0
- package/dist/src/config.js +40 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/dispatch/advice-source.d.ts +61 -0
- package/dist/src/dispatch/advice-source.js +198 -0
- package/dist/src/dispatch/advice-source.js.map +1 -0
- package/dist/src/dispatch/advice-store.d.ts +41 -0
- package/dist/src/dispatch/advice-store.js +201 -0
- package/dist/src/dispatch/advice-store.js.map +1 -0
- package/dist/src/dispatch/advice.d.ts +34 -0
- package/dist/src/dispatch/advice.js +371 -0
- package/dist/src/dispatch/advice.js.map +1 -0
- package/dist/src/dispatch/authority.d.ts +124 -0
- package/dist/src/dispatch/authority.js +1202 -0
- package/dist/src/dispatch/authority.js.map +1 -0
- package/dist/src/dispatch/intent.d.ts +66 -0
- package/dist/src/dispatch/intent.js +71 -0
- package/dist/src/dispatch/intent.js.map +1 -0
- package/dist/src/dispatch/runtime-authority.d.ts +42 -0
- package/dist/src/dispatch/runtime-authority.js +52 -0
- package/dist/src/dispatch/runtime-authority.js.map +1 -0
- package/dist/src/doctor.d.ts +20 -0
- package/dist/src/doctor.js +85 -0
- package/dist/src/doctor.js.map +1 -0
- package/dist/src/domain/records.d.ts +44 -0
- package/dist/src/domain/records.js +138 -0
- package/dist/src/domain/records.js.map +1 -0
- package/dist/src/domain/role-policy.d.ts +67 -0
- package/dist/src/domain/role-policy.js +547 -0
- package/dist/src/domain/role-policy.js.map +1 -0
- package/dist/src/events/bus.d.ts +32 -0
- package/dist/src/events/bus.js +115 -0
- package/dist/src/events/bus.js.map +1 -0
- package/dist/src/events/kinds.d.ts +126 -0
- package/dist/src/events/kinds.js +14 -0
- package/dist/src/events/kinds.js.map +1 -0
- package/dist/src/evidence/immutable-file.d.ts +12 -0
- package/dist/src/evidence/immutable-file.js +141 -0
- package/dist/src/evidence/immutable-file.js.map +1 -0
- package/dist/src/evidence/store.d.ts +125 -0
- package/dist/src/evidence/store.js +1189 -0
- package/dist/src/evidence/store.js.map +1 -0
- package/dist/src/evidence/verdict.d.ts +17 -0
- package/dist/src/evidence/verdict.js +23 -0
- package/dist/src/evidence/verdict.js.map +1 -0
- package/dist/src/generation/agent.d.ts +5 -0
- package/dist/src/generation/agent.js +34 -0
- package/dist/src/generation/agent.js.map +1 -0
- package/dist/src/generation/frontmatter.d.ts +7 -0
- package/dist/src/generation/frontmatter.js +33 -0
- package/dist/src/generation/frontmatter.js.map +1 -0
- package/dist/src/github/adapter.d.ts +44 -0
- package/dist/src/github/adapter.js +592 -0
- package/dist/src/github/adapter.js.map +1 -0
- package/dist/src/github/dispatch-eligibility.d.ts +9 -0
- package/dist/src/github/dispatch-eligibility.js +94 -0
- package/dist/src/github/dispatch-eligibility.js.map +1 -0
- package/dist/src/github/projector.d.ts +23 -0
- package/dist/src/github/projector.js +181 -0
- package/dist/src/github/projector.js.map +1 -0
- package/dist/src/github/review.d.ts +39 -0
- package/dist/src/github/review.js +1450 -0
- package/dist/src/github/review.js.map +1 -0
- package/dist/src/github/sync.d.ts +21 -0
- package/dist/src/github/sync.js +518 -0
- package/dist/src/github/sync.js.map +1 -0
- package/dist/src/github/types.d.ts +134 -0
- package/dist/src/github/types.js +11 -0
- package/dist/src/github/types.js.map +1 -0
- package/dist/src/goals/artifact-store.d.ts +31 -0
- package/dist/src/goals/artifact-store.js +241 -0
- package/dist/src/goals/artifact-store.js.map +1 -0
- package/dist/src/goals/authority.d.ts +112 -0
- package/dist/src/goals/authority.js +621 -0
- package/dist/src/goals/authority.js.map +1 -0
- package/dist/src/goals/native-snapshot.d.ts +12 -0
- package/dist/src/goals/native-snapshot.js +53 -0
- package/dist/src/goals/native-snapshot.js.map +1 -0
- package/dist/src/goals/runtime-authority.d.ts +7 -0
- package/dist/src/goals/runtime-authority.js +20 -0
- package/dist/src/goals/runtime-authority.js.map +1 -0
- package/dist/src/health/release-assessment.d.ts +11 -0
- package/dist/src/health/release-assessment.js +83 -0
- package/dist/src/health/release-assessment.js.map +1 -0
- package/dist/src/health/release-policy.d.ts +16 -0
- package/dist/src/health/release-policy.js +40 -0
- package/dist/src/health/release-policy.js.map +1 -0
- package/dist/src/hooks/native.d.ts +30 -0
- package/dist/src/hooks/native.js +495 -0
- package/dist/src/hooks/native.js.map +1 -0
- package/dist/src/hooks/provider-runtime.d.ts +55 -0
- package/dist/src/hooks/provider-runtime.js +479 -0
- package/dist/src/hooks/provider-runtime.js.map +1 -0
- package/dist/src/hooks/provider.d.ts +102 -0
- package/dist/src/hooks/provider.js +358 -0
- package/dist/src/hooks/provider.js.map +1 -0
- package/dist/src/live/contact-journal.d.ts +73 -0
- package/dist/src/live/contact-journal.js +439 -0
- package/dist/src/live/contact-journal.js.map +1 -0
- package/dist/src/live-probes/gh-adapter.d.ts +28 -0
- package/dist/src/live-probes/gh-adapter.js +188 -0
- package/dist/src/live-probes/gh-adapter.js.map +1 -0
- package/dist/src/live-probes/github-queue.d.ts +1 -0
- package/dist/src/live-probes/github-queue.js +2 -0
- package/dist/src/live-probes/github-queue.js.map +1 -0
- package/dist/src/notifications/slack-request.d.ts +13 -0
- package/dist/src/notifications/slack-request.js +40 -0
- package/dist/src/notifications/slack-request.js.map +1 -0
- package/dist/src/outbox/processor.d.ts +27 -0
- package/dist/src/outbox/processor.js +63 -0
- package/dist/src/outbox/processor.js.map +1 -0
- package/dist/src/outbox/store.d.ts +158 -0
- package/dist/src/outbox/store.js +834 -0
- package/dist/src/outbox/store.js.map +1 -0
- package/dist/src/package-root.d.ts +1 -0
- package/dist/src/package-root.js +26 -0
- package/dist/src/package-root.js.map +1 -0
- package/dist/src/project.d.ts +12 -0
- package/dist/src/project.js +60 -0
- package/dist/src/project.js.map +1 -0
- package/dist/src/projection/generated-file.d.ts +15 -0
- package/dist/src/projection/generated-file.js +72 -0
- package/dist/src/projection/generated-file.js.map +1 -0
- package/dist/src/projection/project-workspace.d.ts +11 -0
- package/dist/src/projection/project-workspace.js +94 -0
- package/dist/src/projection/project-workspace.js.map +1 -0
- package/dist/src/projection/registry.d.ts +15 -0
- package/dist/src/projection/registry.js +59 -0
- package/dist/src/projection/registry.js.map +1 -0
- package/dist/src/projection/safe-path.d.ts +4 -0
- package/dist/src/projection/safe-path.js +106 -0
- package/dist/src/projection/safe-path.js.map +1 -0
- package/dist/src/providers/claude-interactive.d.ts +38 -0
- package/dist/src/providers/claude-interactive.js +287 -0
- package/dist/src/providers/claude-interactive.js.map +1 -0
- package/dist/src/providers/claude-structured-bridge.d.ts +32 -0
- package/dist/src/providers/claude-structured-bridge.js +215 -0
- package/dist/src/providers/claude-structured-bridge.js.map +1 -0
- package/dist/src/providers/claude-structured-completion.d.ts +23 -0
- package/dist/src/providers/claude-structured-completion.js +229 -0
- package/dist/src/providers/claude-structured-completion.js.map +1 -0
- package/dist/src/providers/claude-structured-pane.d.ts +23 -0
- package/dist/src/providers/claude-structured-pane.js +156 -0
- package/dist/src/providers/claude-structured-pane.js.map +1 -0
- package/dist/src/providers/claude-structured-store.d.ts +48 -0
- package/dist/src/providers/claude-structured-store.js +212 -0
- package/dist/src/providers/claude-structured-store.js.map +1 -0
- package/dist/src/providers/claude-structured.d.ts +56 -0
- package/dist/src/providers/claude-structured.js +250 -0
- package/dist/src/providers/claude-structured.js.map +1 -0
- package/dist/src/providers/codex-exec.d.ts +29 -0
- package/dist/src/providers/codex-exec.js +127 -0
- package/dist/src/providers/codex-exec.js.map +1 -0
- package/dist/src/providers/grading.d.ts +2 -0
- package/dist/src/providers/grading.js +20 -0
- package/dist/src/providers/grading.js.map +1 -0
- package/dist/src/providers/native-dispatch.d.ts +24 -0
- package/dist/src/providers/native-dispatch.js +34 -0
- package/dist/src/providers/native-dispatch.js.map +1 -0
- package/dist/src/providers/preflight.d.ts +65 -0
- package/dist/src/providers/preflight.js +256 -0
- package/dist/src/providers/preflight.js.map +1 -0
- package/dist/src/providers/process.d.ts +18 -0
- package/dist/src/providers/process.js +21 -0
- package/dist/src/providers/process.js.map +1 -0
- package/dist/src/queue/model.d.ts +37 -0
- package/dist/src/queue/model.js +51 -0
- package/dist/src/queue/model.js.map +1 -0
- package/dist/src/queue/service.d.ts +1 -0
- package/dist/src/queue/service.js +2 -0
- package/dist/src/queue/service.js.map +1 -0
- package/dist/src/reflections/store.d.ts +21 -0
- package/dist/src/reflections/store.js +60 -0
- package/dist/src/reflections/store.js.map +1 -0
- package/dist/src/reports/daily-trust.d.ts +11 -0
- package/dist/src/reports/daily-trust.js +98 -0
- package/dist/src/reports/daily-trust.js.map +1 -0
- package/dist/src/runs/controller.d.ts +187 -0
- package/dist/src/runs/controller.js +1182 -0
- package/dist/src/runs/controller.js.map +1 -0
- package/dist/src/runtime/composition.d.ts +9 -0
- package/dist/src/runtime/composition.js +35 -0
- package/dist/src/runtime/composition.js.map +1 -0
- package/dist/src/runtime/endurance-authorities.d.ts +44 -0
- package/dist/src/runtime/endurance-authorities.js +101 -0
- package/dist/src/runtime/endurance-authorities.js.map +1 -0
- package/dist/src/runtime/endurance-policy.d.ts +12 -0
- package/dist/src/runtime/endurance-policy.js +13 -0
- package/dist/src/runtime/endurance-policy.js.map +1 -0
- package/dist/src/runtime/lock.d.ts +63 -0
- package/dist/src/runtime/lock.js +577 -0
- package/dist/src/runtime/lock.js.map +1 -0
- package/dist/src/runtime/process-identity.d.ts +10 -0
- package/dist/src/runtime/process-identity.js +43 -0
- package/dist/src/runtime/process-identity.js.map +1 -0
- package/dist/src/runtime/quota.d.ts +130 -0
- package/dist/src/runtime/quota.js +590 -0
- package/dist/src/runtime/quota.js.map +1 -0
- package/dist/src/runtime/record-store.d.ts +45 -0
- package/dist/src/runtime/record-store.js +272 -0
- package/dist/src/runtime/record-store.js.map +1 -0
- package/dist/src/runtime/schema.d.ts +28 -0
- package/dist/src/runtime/schema.js +194 -0
- package/dist/src/runtime/schema.js.map +1 -0
- package/dist/src/runtime/stable-id.d.ts +3 -0
- package/dist/src/runtime/stable-id.js +27 -0
- package/dist/src/runtime/stable-id.js.map +1 -0
- package/dist/src/runtime/system-clock.d.ts +8 -0
- package/dist/src/runtime/system-clock.js +35 -0
- package/dist/src/runtime/system-clock.js.map +1 -0
- package/dist/src/schedule/service-plan.d.ts +58 -0
- package/dist/src/schedule/service-plan.js +327 -0
- package/dist/src/schedule/service-plan.js.map +1 -0
- package/dist/src/schedule/user-installation.d.ts +62 -0
- package/dist/src/schedule/user-installation.js +701 -0
- package/dist/src/schedule/user-installation.js.map +1 -0
- package/dist/src/schedule/user-plan.d.ts +47 -0
- package/dist/src/schedule/user-plan.js +286 -0
- package/dist/src/schedule/user-plan.js.map +1 -0
- package/dist/src/scheduler/minute.d.ts +31 -0
- package/dist/src/scheduler/minute.js +441 -0
- package/dist/src/scheduler/minute.js.map +1 -0
- package/dist/src/schemas/registry.d.ts +10 -0
- package/dist/src/schemas/registry.js +36 -0
- package/dist/src/schemas/registry.js.map +1 -0
- package/dist/src/security/secret-scan.d.ts +50 -0
- package/dist/src/security/secret-scan.js +384 -0
- package/dist/src/security/secret-scan.js.map +1 -0
- package/dist/src/sessions/registry.d.ts +89 -0
- package/dist/src/sessions/registry.js +443 -0
- package/dist/src/sessions/registry.js.map +1 -0
- package/dist/src/state.d.ts +27 -0
- package/dist/src/state.js +235 -0
- package/dist/src/state.js.map +1 -0
- package/dist/src/status/hud.d.ts +37 -0
- package/dist/src/status/hud.js +88 -0
- package/dist/src/status/hud.js.map +1 -0
- package/dist/src/team/plan.d.ts +31 -0
- package/dist/src/team/plan.js +184 -0
- package/dist/src/team/plan.js.map +1 -0
- package/dist/src/team/projection.d.ts +24 -0
- package/dist/src/team/projection.js +79 -0
- package/dist/src/team/projection.js.map +1 -0
- package/dist/src/tickets/admission.d.ts +34 -0
- package/dist/src/tickets/admission.js +169 -0
- package/dist/src/tickets/admission.js.map +1 -0
- package/dist/src/tickets/materializer.d.ts +1 -0
- package/dist/src/tickets/materializer.js +2 -0
- package/dist/src/tickets/materializer.js.map +1 -0
- package/dist/src/tickets/runtime-authority.d.ts +32 -0
- package/dist/src/tickets/runtime-authority.js +46 -0
- package/dist/src/tickets/runtime-authority.js.map +1 -0
- package/dist/src/tickets/store.d.ts +221 -0
- package/dist/src/tickets/store.js +2025 -0
- package/dist/src/tickets/store.js.map +1 -0
- package/dist/src/tracer/one-ticket.d.ts +58 -0
- package/dist/src/tracer/one-ticket.js +578 -0
- package/dist/src/tracer/one-ticket.js.map +1 -0
- package/dist/src/trust/assessment.d.ts +24 -0
- package/dist/src/trust/assessment.js +124 -0
- package/dist/src/trust/assessment.js.map +1 -0
- package/dist/src/trust/runs.d.ts +13 -0
- package/dist/src/trust/runs.js +46 -0
- package/dist/src/trust/runs.js.map +1 -0
- package/dist/src/types.d.ts +6 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/fs.d.ts +13 -0
- package/dist/src/utils/fs.js +188 -0
- package/dist/src/utils/fs.js.map +1 -0
- package/dist/src/verification/authority.d.ts +28 -0
- package/dist/src/verification/authority.js +153 -0
- package/dist/src/verification/authority.js.map +1 -0
- package/dist/src/verification/grade-source.d.ts +17 -0
- package/dist/src/verification/grade-source.js +30 -0
- package/dist/src/verification/grade-source.js.map +1 -0
- package/dist/src/verification/plan.d.ts +20 -0
- package/dist/src/verification/plan.js +128 -0
- package/dist/src/verification/plan.js.map +1 -0
- package/dist/src/verification/protected-runner.d.ts +50 -0
- package/dist/src/verification/protected-runner.js +171 -0
- package/dist/src/verification/protected-runner.js.map +1 -0
- package/dist/src/verification/result-gate-store.d.ts +72 -0
- package/dist/src/verification/result-gate-store.js +193 -0
- package/dist/src/verification/result-gate-store.js.map +1 -0
- package/dist/src/verification/result-gate.d.ts +41 -0
- package/dist/src/verification/result-gate.js +731 -0
- package/dist/src/verification/result-gate.js.map +1 -0
- package/dist/src/verification/runner.d.ts +38 -0
- package/dist/src/verification/runner.js +143 -0
- package/dist/src/verification/runner.js.map +1 -0
- package/dist/src/verification/sandbox.d.ts +16 -0
- package/dist/src/verification/sandbox.js +199 -0
- package/dist/src/verification/sandbox.js.map +1 -0
- package/dist/src/verify.d.ts +8 -0
- package/dist/src/verify.js +35 -0
- package/dist/src/verify.js.map +1 -0
- package/dist/src/watchdog/reconcile.d.ts +42 -0
- package/dist/src/watchdog/reconcile.js +440 -0
- package/dist/src/watchdog/reconcile.js.map +1 -0
- package/dist/src/workers/bridge.d.ts +35 -0
- package/dist/src/workers/bridge.js +426 -0
- package/dist/src/workers/bridge.js.map +1 -0
- package/dist/src/workers/delivery.d.ts +31 -0
- package/dist/src/workers/delivery.js +876 -0
- package/dist/src/workers/delivery.js.map +1 -0
- package/dist/src/workers/panes.d.ts +32 -0
- package/dist/src/workers/panes.js +212 -0
- package/dist/src/workers/panes.js.map +1 -0
- package/dist/src/workers/registry.d.ts +80 -0
- package/dist/src/workers/registry.js +351 -0
- package/dist/src/workers/registry.js.map +1 -0
- package/dist/src/workers/runtime.d.ts +44 -0
- package/dist/src/workers/runtime.js +21 -0
- package/dist/src/workers/runtime.js.map +1 -0
- package/dist/src/worktrees/manager.d.ts +35 -0
- package/dist/src/worktrees/manager.js +315 -0
- package/dist/src/worktrees/manager.js.map +1 -0
- package/docs/ARCHITECTURE.md +323 -0
- package/docs/PLAN.md +216 -0
- package/docs/REFERENCES.md +42 -0
- package/docs/ROADMAP.md +327 -0
- package/docs/SECURITY.md +242 -0
- package/docs/adr/0001-tracer-first-file-backed-certification.md +41 -0
- package/docs/adr/0002-conductor-first-typed-dispatch.md +102 -0
- package/docs/adr/0003-mandatory-pre-dispatch-advice.md +59 -0
- package/docs/compatibility/claude-code-2.1.207.md +25 -0
- package/loop/contract.md +102 -0
- package/package.json +54 -0
- package/schemas/advisor-evidence.schema.json +54 -0
- package/schemas/advisor-output.schema.json +31 -0
- package/schemas/conductor-activity-payload.schema.json +38 -0
- package/schemas/conductor-decision.schema.json +29 -0
- package/schemas/conductor-dispatch-intent.schema.json +71 -0
- package/schemas/conductor-dispatch-preparation.schema.json +46 -0
- package/schemas/conductor-dispatch-proposal.schema.json +82 -0
- package/schemas/conductor-goal-proposal.schema.json +30 -0
- package/schemas/conductor-manage-worker.schema.json +17 -0
- package/schemas/conductor-notification-payload.schema.json +39 -0
- package/schemas/conductor-process-result.schema.json +14 -0
- package/schemas/conductor-route.schema.json +51 -0
- package/schemas/conductor-start-team.schema.json +16 -0
- package/schemas/conductor-waiter-payload.schema.json +68 -0
- package/schemas/deterministic-check.schema.json +107 -0
- package/schemas/dispatch-acknowledgement.schema.json +15 -0
- package/schemas/dispatch-advice-payload.schema.json +64 -0
- package/schemas/dispatch-payload.schema.json +131 -0
- package/schemas/dispatch-result.schema.json +28 -0
- package/schemas/endurance-policy.schema.json +16 -0
- package/schemas/events/dispatch-delivery-requested.schema.json +17 -0
- package/schemas/events/github-observed.schema.json +28 -0
- package/schemas/events/native-hook-observed.schema.json +35 -0
- package/schemas/events/provider-observed.schema.json +64 -0
- package/schemas/events/run-heartbeat-due.schema.json +10 -0
- package/schemas/events/slack-notification-requested.schema.json +14 -0
- package/schemas/events/structured-role-completed.schema.json +54 -0
- package/schemas/events/ticket-resume-due.schema.json +28 -0
- package/schemas/events/watchdog-lease-expired.schema.json +14 -0
- package/schemas/events/watchdog-outbox-stalled.schema.json +12 -0
- package/schemas/events/watchdog-session-stalled.schema.json +11 -0
- package/schemas/evidence-record.schema.json +37 -0
- package/schemas/executor-result.schema.json +17 -0
- package/schemas/github-observation.schema.json +33 -0
- package/schemas/github-watermark.schema.json +66 -0
- package/schemas/goal-artifact.schema.json +19 -0
- package/schemas/goal-create-input.schema.json +14 -0
- package/schemas/goal-executor-result.schema.json +18 -0
- package/schemas/goal-payload.schema.json +95 -0
- package/schemas/grader-output.schema.json +33 -0
- package/schemas/lease-expiry.schema.json +19 -0
- package/schemas/live-disclosure.schema.json +16 -0
- package/schemas/live-outcome.schema.json +52 -0
- package/schemas/native-goal-snapshot.schema.json +27 -0
- package/schemas/provider-observed.schema.json +64 -0
- package/schemas/quota-observation.schema.json +72 -0
- package/schemas/reflection-evidence.schema.json +61 -0
- package/schemas/reflection.schema.json +13 -0
- package/schemas/regression-request.schema.json +54 -0
- package/schemas/release-assessment.schema.json +34 -0
- package/schemas/release-policy.schema.json +30 -0
- package/schemas/result-gate-payload.schema.json +244 -0
- package/schemas/review-delivery-payload.schema.json +42 -0
- package/schemas/role-policy.schema.json +111 -0
- package/schemas/run-abort-input.schema.json +11 -0
- package/schemas/run-completion-proof.schema.json +62 -0
- package/schemas/run-ledger-entry.schema.json +78 -0
- package/schemas/run-manifest.schema.json +74 -0
- package/schemas/run-start-intent.schema.json +74 -0
- package/schemas/runtime-record.schema.json +111 -0
- package/schemas/service-plan.schema.json +35 -0
- package/schemas/session-payload.schema.json +80 -0
- package/schemas/structured-role-read-request.schema.json +14 -0
- package/schemas/structured-role-request.schema.json +44 -0
- package/schemas/structured-role-result.schema.json +38 -0
- package/schemas/structured-role-submit-result.schema.json +15 -0
- package/schemas/team-checkpoint.schema.json +42 -0
- package/schemas/team-plan.schema.json +30 -0
- package/schemas/ticket-content.schema.json +38 -0
- package/schemas/ticket-queue-payload.schema.json +191 -0
- package/schemas/trust-report.schema.json +68 -0
- package/schemas/trust-run.schema.json +47 -0
- package/schemas/ultragoal-checkpoint.schema.json +49 -0
- package/schemas/user-schedule-installation-v1.schema.json +32 -0
- package/schemas/user-schedule-installation.schema.json +38 -0
- package/schemas/user-schedule-plan.schema.json +39 -0
- package/schemas/verification-plan-evidence.schema.json +37 -0
- package/schemas/worker-acknowledge-dispatch.schema.json +12 -0
- package/schemas/worker-payload.schema.json +47 -0
- package/schemas/worker-read-dispatch.schema.json +11 -0
- package/schemas/worker-record-dispatch-result.schema.json +14 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export declare const GITHUB_OBSERVATION_KINDS: readonly ["issue", "comment", "label", "branch", "pull_request", "review", "check"];
|
|
2
|
+
export type GithubObservationKind = (typeof GITHUB_OBSERVATION_KINDS)[number];
|
|
3
|
+
export declare const GITHUB_SYNC_STREAMS: readonly ["issues", "branches", "pull_requests"];
|
|
4
|
+
export type GithubSyncStream = (typeof GITHUB_SYNC_STREAMS)[number];
|
|
5
|
+
export interface GithubObservationBase<Kind extends GithubObservationKind, Snapshot extends Record<string, unknown>> {
|
|
6
|
+
readonly schema_version: 1;
|
|
7
|
+
readonly observation_key: string;
|
|
8
|
+
readonly kind: Kind;
|
|
9
|
+
readonly repository: string;
|
|
10
|
+
readonly source_id_sha256: string;
|
|
11
|
+
readonly source_version: string;
|
|
12
|
+
readonly change: "present" | "removed";
|
|
13
|
+
readonly presence_generation: number;
|
|
14
|
+
readonly observed_at: string;
|
|
15
|
+
readonly payload_sha256: string;
|
|
16
|
+
readonly snapshot: Snapshot | GithubRemovalSnapshot;
|
|
17
|
+
}
|
|
18
|
+
export interface GithubRemovalSnapshot extends Record<string, unknown> {
|
|
19
|
+
readonly removed: true;
|
|
20
|
+
readonly previous_payload_sha256: string;
|
|
21
|
+
readonly presence_generation: number;
|
|
22
|
+
}
|
|
23
|
+
export interface GithubIssueSnapshot extends Record<string, unknown> {
|
|
24
|
+
readonly number: number;
|
|
25
|
+
readonly issue_node_id: string;
|
|
26
|
+
readonly title: string;
|
|
27
|
+
readonly body: string;
|
|
28
|
+
readonly labels: readonly string[];
|
|
29
|
+
readonly url: string;
|
|
30
|
+
readonly state: "OPEN" | "CLOSED";
|
|
31
|
+
readonly updated_at: string;
|
|
32
|
+
}
|
|
33
|
+
export interface GithubCommentSnapshot extends Record<string, unknown> {
|
|
34
|
+
readonly issue_number: number;
|
|
35
|
+
readonly body: string;
|
|
36
|
+
readonly url: string;
|
|
37
|
+
readonly author: string | null;
|
|
38
|
+
readonly created_at: string;
|
|
39
|
+
readonly updated_at: string;
|
|
40
|
+
}
|
|
41
|
+
export interface GithubLabelSnapshot extends Record<string, unknown> {
|
|
42
|
+
readonly issue_number: number;
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly color: string;
|
|
45
|
+
readonly description: string | null;
|
|
46
|
+
readonly updated_at: string | null;
|
|
47
|
+
}
|
|
48
|
+
export interface GithubBranchSnapshot extends Record<string, unknown> {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly head_oid: string;
|
|
51
|
+
}
|
|
52
|
+
export interface GithubPullRequestSnapshot extends Record<string, unknown> {
|
|
53
|
+
readonly number: number;
|
|
54
|
+
readonly title: string;
|
|
55
|
+
readonly body: string;
|
|
56
|
+
readonly url: string;
|
|
57
|
+
readonly state: "OPEN" | "CLOSED" | "MERGED";
|
|
58
|
+
readonly is_draft: boolean;
|
|
59
|
+
readonly head_ref_name: string;
|
|
60
|
+
readonly head_oid: string;
|
|
61
|
+
readonly base_ref_name: string;
|
|
62
|
+
readonly updated_at: string;
|
|
63
|
+
}
|
|
64
|
+
export interface GithubReviewSnapshot extends Record<string, unknown> {
|
|
65
|
+
readonly pull_request_number: number;
|
|
66
|
+
readonly state: string;
|
|
67
|
+
readonly body: string;
|
|
68
|
+
readonly url: string;
|
|
69
|
+
readonly author: string | null;
|
|
70
|
+
readonly submitted_at: string | null;
|
|
71
|
+
readonly updated_at: string;
|
|
72
|
+
}
|
|
73
|
+
export interface GithubCheckSnapshot extends Record<string, unknown> {
|
|
74
|
+
readonly pull_request_number: number;
|
|
75
|
+
readonly commit_oid: string;
|
|
76
|
+
readonly check_type: "check_run" | "status_context";
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly status: string;
|
|
79
|
+
readonly conclusion: string | null;
|
|
80
|
+
readonly url: string | null;
|
|
81
|
+
readonly started_at: string | null;
|
|
82
|
+
readonly completed_at: string | null;
|
|
83
|
+
readonly updated_at: string | null;
|
|
84
|
+
}
|
|
85
|
+
export interface GithubSnapshotByKind {
|
|
86
|
+
readonly issue: GithubIssueSnapshot;
|
|
87
|
+
readonly comment: GithubCommentSnapshot;
|
|
88
|
+
readonly label: GithubLabelSnapshot;
|
|
89
|
+
readonly branch: GithubBranchSnapshot;
|
|
90
|
+
readonly pull_request: GithubPullRequestSnapshot;
|
|
91
|
+
readonly review: GithubReviewSnapshot;
|
|
92
|
+
readonly check: GithubCheckSnapshot;
|
|
93
|
+
}
|
|
94
|
+
export type GithubObservationFor<Kind extends GithubObservationKind> = GithubObservationBase<Kind, GithubSnapshotByKind[Kind]>;
|
|
95
|
+
export type GithubIssueObservation = GithubObservationFor<"issue">;
|
|
96
|
+
export type GithubCommentObservation = GithubObservationFor<"comment">;
|
|
97
|
+
export type GithubLabelObservation = GithubObservationFor<"label">;
|
|
98
|
+
export type GithubBranchObservation = GithubObservationFor<"branch">;
|
|
99
|
+
export type GithubPullRequestObservation = GithubObservationFor<"pull_request">;
|
|
100
|
+
export type GithubReviewObservation = GithubObservationFor<"review">;
|
|
101
|
+
export type GithubCheckObservation = GithubObservationFor<"check">;
|
|
102
|
+
export type GithubObservation = GithubIssueObservation | GithubCommentObservation | GithubLabelObservation | GithubBranchObservation | GithubPullRequestObservation | GithubReviewObservation | GithubCheckObservation;
|
|
103
|
+
export interface GithubStreamWatermark {
|
|
104
|
+
readonly page_count: number;
|
|
105
|
+
readonly terminal_cursor_sha256: string | null;
|
|
106
|
+
}
|
|
107
|
+
export interface GithubWatermark {
|
|
108
|
+
readonly schema_version: 1;
|
|
109
|
+
readonly repository: string;
|
|
110
|
+
readonly generation: number;
|
|
111
|
+
readonly completed_at: string;
|
|
112
|
+
readonly observation_count: number;
|
|
113
|
+
readonly batch_sha256: string;
|
|
114
|
+
readonly streams: Readonly<Record<GithubSyncStream, GithubStreamWatermark>>;
|
|
115
|
+
readonly inventory: readonly GithubInventoryEntry[];
|
|
116
|
+
}
|
|
117
|
+
export interface GithubInventoryEntry {
|
|
118
|
+
readonly observation_key: string;
|
|
119
|
+
readonly kind: GithubObservationKind;
|
|
120
|
+
readonly source_id_sha256: string;
|
|
121
|
+
readonly payload_sha256: string;
|
|
122
|
+
readonly presence_generation: number;
|
|
123
|
+
}
|
|
124
|
+
export interface GithubSyncBatch {
|
|
125
|
+
readonly repository: string;
|
|
126
|
+
readonly previous_watermark: GithubWatermark | null;
|
|
127
|
+
readonly proposed_watermark: GithubWatermark;
|
|
128
|
+
readonly observations: readonly GithubObservation[];
|
|
129
|
+
}
|
|
130
|
+
export interface GithubSyncResult {
|
|
131
|
+
readonly watermark: GithubWatermark;
|
|
132
|
+
readonly observations: readonly GithubObservation[];
|
|
133
|
+
readonly watermark_path: string;
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/github/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,OAAO;IACP,SAAS;IACT,OAAO;IACP,QAAQ;IACR,cAAc;IACd,QAAQ;IACR,OAAO;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,eAAe,CAAU,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type GoalArtifactKind = "native-goal-snapshot" | "regression-request" | "team-checkpoint" | "ultragoal-checkpoint";
|
|
2
|
+
export interface GoalArtifactReference {
|
|
3
|
+
readonly kind: GoalArtifactKind;
|
|
4
|
+
readonly artifact_id: string;
|
|
5
|
+
readonly sha256: string;
|
|
6
|
+
readonly file_name: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GoalArtifactRecord {
|
|
9
|
+
readonly schema_version: 1;
|
|
10
|
+
readonly artifact_id: string;
|
|
11
|
+
readonly artifact_kind: GoalArtifactKind;
|
|
12
|
+
readonly goal_id: string;
|
|
13
|
+
readonly producer: "codex-get-goal" | "oms-goal-authority" | "oms-team-projection" | "oms-ultragoal-leader";
|
|
14
|
+
readonly created_at: string;
|
|
15
|
+
readonly payload: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface GoalArtifactWriteResult {
|
|
18
|
+
readonly status: "created" | "replayed";
|
|
19
|
+
readonly ref: GoalArtifactReference;
|
|
20
|
+
readonly record: Readonly<GoalArtifactRecord>;
|
|
21
|
+
}
|
|
22
|
+
export interface GoalArtifactStore {
|
|
23
|
+
write(record: GoalArtifactRecord): GoalArtifactWriteResult;
|
|
24
|
+
read(ref: GoalArtifactReference): Readonly<GoalArtifactRecord>;
|
|
25
|
+
absolutePath(ref: GoalArtifactReference): string;
|
|
26
|
+
}
|
|
27
|
+
export declare function assertGoalArtifactStore(value: unknown): asserts value is GoalArtifactStore;
|
|
28
|
+
export declare function createGoalArtifactStore(options: {
|
|
29
|
+
artifactsRoot: string;
|
|
30
|
+
packageRoot?: string;
|
|
31
|
+
}): GoalArtifactStore;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { assertOpaqueId, assertRecordId } from "../domain/records.js";
|
|
4
|
+
import { assertFileInside, openStableDirectory, readImmutableFile, writeImmutableFile, } from "../evidence/immutable-file.js";
|
|
5
|
+
import { findPackageRoot } from "../package-root.js";
|
|
6
|
+
import { assertSchema, loadJsonSchema } from "../runtime/schema.js";
|
|
7
|
+
import { createStableId } from "../runtime/stable-id.js";
|
|
8
|
+
import { validateTeamCheckpointSemantics } from "../team/projection.js";
|
|
9
|
+
import { isRecord } from "../utils/fs.js";
|
|
10
|
+
const MAX_ARTIFACT_BYTES = 2 * 1024 * 1024;
|
|
11
|
+
const SHA256_PATTERN = /^[a-f0-9]{64}$/;
|
|
12
|
+
const ARTIFACT_STORES = new WeakSet();
|
|
13
|
+
export function assertGoalArtifactStore(value) {
|
|
14
|
+
if (typeof value !== "object" || value === null || !ARTIFACT_STORES.has(value)) {
|
|
15
|
+
throw new Error("goal operation requires a real OMS GoalArtifactStore");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function createGoalArtifactStore(options) {
|
|
19
|
+
const root = openStableDirectory(options.artifactsRoot, "goal artifacts root");
|
|
20
|
+
const packageRoot = options.packageRoot ?? findPackageRoot();
|
|
21
|
+
const envelopeSchema = loadJsonSchema(join(packageRoot, "schemas", "goal-artifact.schema.json"));
|
|
22
|
+
const contracts = new Map([
|
|
23
|
+
["native-goal-snapshot", {
|
|
24
|
+
producer: "codex-get-goal",
|
|
25
|
+
schema: loadJsonSchema(join(packageRoot, "schemas", "native-goal-snapshot.schema.json")),
|
|
26
|
+
}],
|
|
27
|
+
["regression-request", {
|
|
28
|
+
producer: "oms-goal-authority",
|
|
29
|
+
schema: loadJsonSchema(join(packageRoot, "schemas", "regression-request.schema.json")),
|
|
30
|
+
}],
|
|
31
|
+
["team-checkpoint", {
|
|
32
|
+
producer: "oms-team-projection",
|
|
33
|
+
schema: loadJsonSchema(join(packageRoot, "schemas", "team-checkpoint.schema.json")),
|
|
34
|
+
}],
|
|
35
|
+
["ultragoal-checkpoint", {
|
|
36
|
+
producer: "oms-ultragoal-leader",
|
|
37
|
+
schema: loadJsonSchema(join(packageRoot, "schemas", "ultragoal-checkpoint.schema.json")),
|
|
38
|
+
}],
|
|
39
|
+
]);
|
|
40
|
+
function validate(value) {
|
|
41
|
+
const detached = cloneJson(value, "goal artifact");
|
|
42
|
+
assertSchema(detached, envelopeSchema, "goal artifact envelope");
|
|
43
|
+
const record = detached;
|
|
44
|
+
assertOpaqueId(record.artifact_id, "goal artifact id");
|
|
45
|
+
assertRecordId(record.goal_id, "goal artifact goal id");
|
|
46
|
+
timestampEpoch(record.created_at, "goal artifact created_at");
|
|
47
|
+
const contract = contracts.get(record.artifact_kind);
|
|
48
|
+
if (!contract)
|
|
49
|
+
throw new Error(`unregistered goal artifact kind: ${String(record.artifact_kind)}`);
|
|
50
|
+
if (record.producer !== contract.producer)
|
|
51
|
+
throw new Error(`invalid producer for ${record.artifact_kind}`);
|
|
52
|
+
assertSchema(record.payload, contract.schema, `${record.artifact_kind} payload`);
|
|
53
|
+
validateArtifactSemantics(record);
|
|
54
|
+
return record;
|
|
55
|
+
}
|
|
56
|
+
function readStored(ref) {
|
|
57
|
+
validateReference(ref);
|
|
58
|
+
const path = join(root.path, ref.file_name);
|
|
59
|
+
assertFileInside(root, path);
|
|
60
|
+
const bytes = readImmutableFile(path, MAX_ARTIFACT_BYTES);
|
|
61
|
+
if (sha256(bytes) !== ref.sha256)
|
|
62
|
+
throw new Error(`goal artifact digest mismatch: ${ref.artifact_id}`);
|
|
63
|
+
const record = validate(parseJson(bytes));
|
|
64
|
+
if (record.artifact_id !== ref.artifact_id || record.artifact_kind !== ref.kind) {
|
|
65
|
+
throw new Error("stored goal artifact identity mismatch");
|
|
66
|
+
}
|
|
67
|
+
validateArtifactLinks(record, readStored);
|
|
68
|
+
return deepFreeze(record);
|
|
69
|
+
}
|
|
70
|
+
const store = {
|
|
71
|
+
write(record) {
|
|
72
|
+
const normalized = validate(record);
|
|
73
|
+
validateArtifactLinks(normalized, readStored);
|
|
74
|
+
const bytes = canonicalJson(normalized);
|
|
75
|
+
if (bytes.byteLength > MAX_ARTIFACT_BYTES)
|
|
76
|
+
throw new Error("goal artifact exceeds size limit");
|
|
77
|
+
const ref = referenceFor(normalized, bytes);
|
|
78
|
+
const path = join(root.path, ref.file_name);
|
|
79
|
+
assertFileInside(root, path);
|
|
80
|
+
const status = writeImmutableFile(path, bytes);
|
|
81
|
+
return Object.freeze({ status, ref, record: readStored(ref) });
|
|
82
|
+
},
|
|
83
|
+
read(ref) {
|
|
84
|
+
return readStored(ref);
|
|
85
|
+
},
|
|
86
|
+
absolutePath(ref) {
|
|
87
|
+
readStored(ref);
|
|
88
|
+
return join(root.path, ref.file_name);
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
Object.freeze(store);
|
|
92
|
+
ARTIFACT_STORES.add(store);
|
|
93
|
+
return store;
|
|
94
|
+
}
|
|
95
|
+
function validateArtifactSemantics(record) {
|
|
96
|
+
if (record.artifact_id !== expectedArtifactId(record)) {
|
|
97
|
+
throw new Error(`${record.artifact_kind} id does not match its deterministic identity`);
|
|
98
|
+
}
|
|
99
|
+
if (record.artifact_kind === "native-goal-snapshot") {
|
|
100
|
+
if (record.created_at !== record.payload.captured_at)
|
|
101
|
+
throw new Error("native snapshot timestamp mismatch");
|
|
102
|
+
const terminal = record.payload.status !== "active";
|
|
103
|
+
if (record.payload.terminal !== terminal)
|
|
104
|
+
throw new Error("native snapshot terminal status is inconsistent");
|
|
105
|
+
}
|
|
106
|
+
if (record.artifact_kind === "regression-request") {
|
|
107
|
+
if (record.goal_id !== record.payload.goal_id)
|
|
108
|
+
throw new Error("regression request goal id mismatch");
|
|
109
|
+
if (record.created_at !== record.payload.requested_at)
|
|
110
|
+
throw new Error("regression request timestamp mismatch");
|
|
111
|
+
const predicate = record.payload.predicate;
|
|
112
|
+
if ((record.payload.reason === "predicate-failed") !== (predicate !== null)) {
|
|
113
|
+
throw new Error("regression request predicate binding is inconsistent");
|
|
114
|
+
}
|
|
115
|
+
if (isRecord(predicate) && predicate.expected_sha256 === predicate.actual_sha256) {
|
|
116
|
+
throw new Error("regression request predicate did not fail");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (record.artifact_kind === "team-checkpoint") {
|
|
120
|
+
if (record.goal_id !== record.payload.goal_id)
|
|
121
|
+
throw new Error("Team checkpoint goal id mismatch");
|
|
122
|
+
const team = record.payload;
|
|
123
|
+
validateTeamCheckpointSemantics(team);
|
|
124
|
+
const canonicalWorkers = [...team.delivery_wave.workers]
|
|
125
|
+
.sort((left, right) => compareText(left.worker_id, right.worker_id));
|
|
126
|
+
if (team.delivery_wave.workers.some((worker, index) => worker.worker_id !== canonicalWorkers[index]?.worker_id)) {
|
|
127
|
+
throw new Error("Team checkpoint workers are not in canonical order");
|
|
128
|
+
}
|
|
129
|
+
if (record.created_at !== team.delivery_wave.completed_at)
|
|
130
|
+
throw new Error("Team checkpoint timestamp mismatch");
|
|
131
|
+
}
|
|
132
|
+
if (record.artifact_kind === "ultragoal-checkpoint") {
|
|
133
|
+
if (record.goal_id !== record.payload.goal_id)
|
|
134
|
+
throw new Error("Ultragoal checkpoint goal id mismatch");
|
|
135
|
+
if (record.created_at !== record.payload.checkpointed_at)
|
|
136
|
+
throw new Error("Ultragoal checkpoint timestamp mismatch");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function validateArtifactLinks(record, readStored) {
|
|
140
|
+
const references = record.artifact_kind === "regression-request"
|
|
141
|
+
? record.payload.source_artifacts
|
|
142
|
+
: record.artifact_kind === "ultragoal-checkpoint"
|
|
143
|
+
? [record.payload.native_snapshot, record.payload.team_checkpoint]
|
|
144
|
+
: [];
|
|
145
|
+
for (const reference of references) {
|
|
146
|
+
const linked = readStored(reference);
|
|
147
|
+
if (linked.goal_id !== record.goal_id)
|
|
148
|
+
throw new Error("goal artifact link belongs to a different goal");
|
|
149
|
+
}
|
|
150
|
+
if (record.artifact_kind === "ultragoal-checkpoint") {
|
|
151
|
+
if (references[0]?.kind !== "native-goal-snapshot" || references[1]?.kind !== "team-checkpoint") {
|
|
152
|
+
throw new Error("Ultragoal checkpoint links have the wrong artifact kinds");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function expectedArtifactId(record) {
|
|
157
|
+
if (record.artifact_kind === "native-goal-snapshot") {
|
|
158
|
+
return createStableId("native-goal", record.goal_id, String(record.payload.snapshot_version), String(record.payload.captured_at));
|
|
159
|
+
}
|
|
160
|
+
if (record.artifact_kind === "regression-request") {
|
|
161
|
+
return createStableId("regression", record.goal_id, String(record.payload.reason), String(record.payload.requested_at), JSON.stringify(record.payload.source_artifacts), JSON.stringify(record.payload.predicate));
|
|
162
|
+
}
|
|
163
|
+
if (record.artifact_kind === "team-checkpoint") {
|
|
164
|
+
const delivery = record.payload.delivery_wave;
|
|
165
|
+
return createStableId("team-check", record.goal_id, String(delivery.wave_id), String(record.payload.test_sha256));
|
|
166
|
+
}
|
|
167
|
+
const native = record.payload.native_snapshot;
|
|
168
|
+
const team = record.payload.team_checkpoint;
|
|
169
|
+
return createStableId("ultragoal", record.goal_id, native.sha256, team.sha256);
|
|
170
|
+
}
|
|
171
|
+
function referenceFor(record, bytes) {
|
|
172
|
+
return Object.freeze({
|
|
173
|
+
kind: record.artifact_kind,
|
|
174
|
+
artifact_id: record.artifact_id,
|
|
175
|
+
sha256: sha256(bytes),
|
|
176
|
+
file_name: `${record.artifact_kind}-${record.artifact_id}.json`,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function validateReference(ref) {
|
|
180
|
+
if (!isRecord(ref))
|
|
181
|
+
throw new Error("goal artifact reference must be an object");
|
|
182
|
+
const artifactId = assertOpaqueId(ref.artifact_id, "goal artifact reference id");
|
|
183
|
+
if (![
|
|
184
|
+
"native-goal-snapshot",
|
|
185
|
+
"regression-request",
|
|
186
|
+
"team-checkpoint",
|
|
187
|
+
"ultragoal-checkpoint",
|
|
188
|
+
].includes(ref.kind))
|
|
189
|
+
throw new Error("goal artifact reference kind is invalid");
|
|
190
|
+
if (typeof ref.sha256 !== "string" || !SHA256_PATTERN.test(ref.sha256)) {
|
|
191
|
+
throw new Error("goal artifact reference digest is invalid");
|
|
192
|
+
}
|
|
193
|
+
if (ref.file_name !== `${ref.kind}-${artifactId}.json`)
|
|
194
|
+
throw new Error("goal artifact reference filename is invalid");
|
|
195
|
+
}
|
|
196
|
+
function timestampEpoch(value, label) {
|
|
197
|
+
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value)) {
|
|
198
|
+
throw new Error(`${label} is invalid`);
|
|
199
|
+
}
|
|
200
|
+
const epoch = Date.parse(value);
|
|
201
|
+
const normalized = value.includes(".") ? value : value.replace("Z", ".000Z");
|
|
202
|
+
if (!Number.isFinite(epoch) || new Date(epoch).toISOString() !== normalized)
|
|
203
|
+
throw new Error(`${label} is invalid`);
|
|
204
|
+
return epoch;
|
|
205
|
+
}
|
|
206
|
+
function cloneJson(value, label) {
|
|
207
|
+
try {
|
|
208
|
+
const serialized = JSON.stringify(value);
|
|
209
|
+
if (serialized === undefined)
|
|
210
|
+
throw new Error("not JSON serializable");
|
|
211
|
+
return JSON.parse(serialized);
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
throw new Error(`${label} must be JSON serializable`, { cause: error });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function deepFreeze(value) {
|
|
218
|
+
if (typeof value !== "object" || value === null || Object.isFrozen(value))
|
|
219
|
+
return value;
|
|
220
|
+
for (const child of Object.values(value))
|
|
221
|
+
deepFreeze(child);
|
|
222
|
+
return Object.freeze(value);
|
|
223
|
+
}
|
|
224
|
+
function canonicalJson(value) {
|
|
225
|
+
return Buffer.from(`${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
226
|
+
}
|
|
227
|
+
function parseJson(bytes) {
|
|
228
|
+
try {
|
|
229
|
+
return JSON.parse(bytes.toString("utf8"));
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
throw new Error("goal artifact contains invalid JSON");
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function sha256(bytes) {
|
|
236
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
237
|
+
}
|
|
238
|
+
function compareText(left, right) {
|
|
239
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=artifact-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-store.js","sourceRoot":"","sources":["../../../src/goals/artifact-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE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7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxF,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAY,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,KAAa;IAC9C,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { type RuntimeRecord } from "../domain/records.js";
|
|
2
|
+
import { type GoalArtifactReference, type GoalArtifactStore } from "./artifact-store.js";
|
|
3
|
+
export type GoalState = "active" | "parked" | "completed";
|
|
4
|
+
export type GoalParkReason = "native-goal-mismatch" | "stale-native-snapshot" | "predicate-failed" | "ultragoal-mismatch";
|
|
5
|
+
type NativeRef = GoalArtifactReference & {
|
|
6
|
+
readonly kind: "native-goal-snapshot";
|
|
7
|
+
};
|
|
8
|
+
type TeamRef = GoalArtifactReference & {
|
|
9
|
+
readonly kind: "team-checkpoint";
|
|
10
|
+
};
|
|
11
|
+
type UltragoalRef = GoalArtifactReference & {
|
|
12
|
+
readonly kind: "ultragoal-checkpoint";
|
|
13
|
+
};
|
|
14
|
+
type RegressionRef = GoalArtifactReference & {
|
|
15
|
+
readonly kind: "regression-request";
|
|
16
|
+
};
|
|
17
|
+
export type GoalPayload = {
|
|
18
|
+
goal_id: string;
|
|
19
|
+
objective: string;
|
|
20
|
+
repository_scope: string;
|
|
21
|
+
queue_scope: string;
|
|
22
|
+
stopping_condition: string;
|
|
23
|
+
runtime_horizon: "until-empty" | "12h" | "24h";
|
|
24
|
+
budget_profile: "subscription-only";
|
|
25
|
+
policy_profile: "default";
|
|
26
|
+
creation_nonce: string;
|
|
27
|
+
created_at: string;
|
|
28
|
+
updated_at: string;
|
|
29
|
+
native_snapshot: NativeRef | null;
|
|
30
|
+
team_checkpoint: TeamRef | null;
|
|
31
|
+
ultragoal_checkpoint: UltragoalRef | null;
|
|
32
|
+
regression_request: RegressionRef | null;
|
|
33
|
+
park_reason: GoalParkReason | null;
|
|
34
|
+
} & Record<string, unknown>;
|
|
35
|
+
export type GoalRecord = RuntimeRecord<GoalState, GoalPayload>;
|
|
36
|
+
export interface GoalAuthority {
|
|
37
|
+
read(goalId: string): Readonly<GoalRecord>;
|
|
38
|
+
}
|
|
39
|
+
export interface GoalPlanGate {
|
|
40
|
+
readonly goal_id: string;
|
|
41
|
+
readonly goal_version: number;
|
|
42
|
+
readonly goal_state: "active";
|
|
43
|
+
readonly objective_sha256: string;
|
|
44
|
+
readonly stopping_condition_sha256: string;
|
|
45
|
+
readonly goal_record_path: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CreateGoalInput {
|
|
48
|
+
readonly objective: string;
|
|
49
|
+
readonly stoppingCondition: string;
|
|
50
|
+
readonly repositoryScope: string;
|
|
51
|
+
readonly queueScope?: string;
|
|
52
|
+
readonly runtimeHorizon?: "until-empty" | "12h" | "24h";
|
|
53
|
+
readonly budgetProfile?: "subscription-only";
|
|
54
|
+
readonly policyProfile?: "default";
|
|
55
|
+
readonly creationNonce?: string;
|
|
56
|
+
readonly leaderId: string;
|
|
57
|
+
readonly createdAt: string;
|
|
58
|
+
}
|
|
59
|
+
export interface CreateGoalOperationResult {
|
|
60
|
+
readonly status: "created" | "replayed";
|
|
61
|
+
readonly goal: Readonly<GoalRecord>;
|
|
62
|
+
}
|
|
63
|
+
export type GoalEvidenceOperationResult = {
|
|
64
|
+
readonly status: "attached" | "completed";
|
|
65
|
+
readonly goal: Readonly<GoalRecord>;
|
|
66
|
+
readonly artifact: GoalArtifactReference;
|
|
67
|
+
} | {
|
|
68
|
+
readonly status: "parked";
|
|
69
|
+
readonly goal: Readonly<GoalRecord>;
|
|
70
|
+
readonly regression: RegressionRef;
|
|
71
|
+
};
|
|
72
|
+
export declare function createGoalAuthority(options: {
|
|
73
|
+
recordsRoot: string;
|
|
74
|
+
locksRoot: string;
|
|
75
|
+
artifactStore: GoalArtifactStore;
|
|
76
|
+
packageRoot?: string;
|
|
77
|
+
}): GoalAuthority;
|
|
78
|
+
export declare function assertGoalAuthority(value: unknown): asserts value is GoalAuthority;
|
|
79
|
+
export declare function createGoal(authority: GoalAuthority, input: CreateGoalInput): Readonly<GoalRecord>;
|
|
80
|
+
export declare function createGoalWithReplay(authority: GoalAuthority, input: CreateGoalInput): CreateGoalOperationResult;
|
|
81
|
+
export declare function readGoal(authority: GoalAuthority, goalId: string): Readonly<GoalRecord>;
|
|
82
|
+
export declare function issueActiveGoalPlanGate(authority: GoalAuthority, goalId: string): GoalPlanGate;
|
|
83
|
+
export declare function assertGoalPlanGate(value: unknown): asserts value is GoalPlanGate;
|
|
84
|
+
export declare function assertFreshGoalPlanGate(gate: GoalPlanGate): void;
|
|
85
|
+
export declare function recordNativeGoalSnapshot(options: {
|
|
86
|
+
authority: GoalAuthority;
|
|
87
|
+
goalId: string;
|
|
88
|
+
snapshot: unknown;
|
|
89
|
+
observedAt: string;
|
|
90
|
+
}): GoalEvidenceOperationResult;
|
|
91
|
+
export declare function recordTeamCheckpoint(options: {
|
|
92
|
+
authority: GoalAuthority;
|
|
93
|
+
goalId: string;
|
|
94
|
+
teamState: unknown;
|
|
95
|
+
}): GoalEvidenceOperationResult;
|
|
96
|
+
export declare function recordBrokenGoalPredicate(options: {
|
|
97
|
+
authority: GoalAuthority;
|
|
98
|
+
goalId: string;
|
|
99
|
+
predicateId: string;
|
|
100
|
+
expectedSha256: string;
|
|
101
|
+
actualSha256: string;
|
|
102
|
+
observedAt: string;
|
|
103
|
+
}): GoalEvidenceOperationResult;
|
|
104
|
+
export declare function checkpointUltragoal(options: {
|
|
105
|
+
authority: GoalAuthority;
|
|
106
|
+
goalId: string;
|
|
107
|
+
leaderId: string;
|
|
108
|
+
nativeSnapshot: GoalArtifactReference;
|
|
109
|
+
teamCheckpoint: GoalArtifactReference;
|
|
110
|
+
checkpointedAt: string;
|
|
111
|
+
}): GoalEvidenceOperationResult;
|
|
112
|
+
export {};
|