@ouro.bot/cli 0.1.0-alpha.1469 → 0.1.0-alpha.1470
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/README.md +1 -1
- package/changelog.json +6 -2
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/desk.lock.json +8 -0
- package/dist/heart/identity.js +27 -1
- package/dist/mind/desk-section.js +33 -43
- package/dist/repertoire/desk-mcp.js +140 -0
- package/dist/repertoire/mcp-manager.js +22 -0
- package/dist/repertoire/mcp-tools.js +11 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -1
- package/vendor/desk/.claude-plugin/plugin.json +35 -0
- package/vendor/desk/.mcp.claude-codex.json +28 -0
- package/vendor/desk/.mcp.copilot.json +16 -0
- package/vendor/desk/.ouro-desk.json +6 -0
- package/vendor/desk/CHANGELOG.md +7004 -0
- package/vendor/desk/README.md +195 -0
- package/vendor/desk/activation/README.md +98 -0
- package/vendor/desk/activation/copilot-root.flattened-bundle.json +38 -0
- package/vendor/desk/activation/desk.activation.json +251 -0
- package/vendor/desk/activation/host-capability-evidence.md +46 -0
- package/vendor/desk/activation/support-matrix.json +84 -0
- package/vendor/desk/agency.json +20 -0
- package/vendor/desk/agents/observer.agent.md +26 -0
- package/vendor/desk/agents/observer.md +29 -0
- package/vendor/desk/agents/worker.agent.md +32 -0
- package/vendor/desk/agents/worker.md +40 -0
- package/vendor/desk/artifacts/tombstones/tombstone.schema.json +53 -0
- package/vendor/desk/artifacts/tombstones/tombstones.jsonl +1 -0
- package/vendor/desk/changelog.d/README.md +12 -0
- package/vendor/desk/docs/agent-files.md +104 -0
- package/vendor/desk/docs/agentic-engineering-v2-rfc.md +206 -0
- package/vendor/desk/docs/agentic-engineering-v3-rfc.md +109 -0
- package/vendor/desk/docs/browser-remote-desktops.md +69 -0
- package/vendor/desk/docs/dependency-activation-stories-and-criteria.md +500 -0
- package/vendor/desk/docs/evaluation-packet.md +363 -0
- package/vendor/desk/docs/factory-local-capture.md +651 -0
- package/vendor/desk/docs/factory-store-playbook.md +927 -0
- package/vendor/desk/docs/images/factory-site.png +0 -0
- package/vendor/desk/docs/issue-drains.md +79 -0
- package/vendor/desk/docs/lfs-inspection.md +55 -0
- package/vendor/desk/docs/preview-diagnostics.md +11 -0
- package/vendor/desk/docs/relays.md +88 -0
- package/vendor/desk/docs/schedules.md +69 -0
- package/vendor/desk/docs/search-recovery.md +22 -0
- package/vendor/desk/docs/session-labels.md +157 -0
- package/vendor/desk/docs/session-retention.md +125 -0
- package/vendor/desk/docs/sessions.md +17 -0
- package/vendor/desk/docs/stalled-nudges.md +54 -0
- package/vendor/desk/docs/webhooks.md +80 -0
- package/vendor/desk/docs/workspace-tidy.md +74 -0
- package/vendor/desk/hooks/boot-checks.cjs +7 -0
- package/vendor/desk/hooks/claude-session-start.cjs +123 -0
- package/vendor/desk/hooks/compatible-node.cjs +97 -0
- package/vendor/desk/hooks/copilot-boot-prompt.cjs +69 -0
- package/vendor/desk/hooks/copilot-durable-files.cjs +8 -0
- package/vendor/desk/hooks/copilot-hooks.json +61 -0
- package/vendor/desk/hooks/copilot-intake-context.cjs +5 -0
- package/vendor/desk/hooks/copilot-lane-model.cjs +8 -0
- package/vendor/desk/hooks/copilot-session-start.cjs +264 -0
- package/vendor/desk/hooks/copilot-skill-current.cjs +28 -0
- package/vendor/desk/hooks/factory-end.cjs +5 -0
- package/vendor/desk/hooks/factory-start.cjs +27 -0
- package/vendor/desk/hooks/hooks.json +40 -0
- package/vendor/desk/hooks/lib/boot-checks.cjs +643 -0
- package/vendor/desk/hooks/lib/child-agent.cjs +14 -0
- package/vendor/desk/hooks/lib/copilot-intake-context.cjs +73 -0
- package/vendor/desk/hooks/lib/current-release.cjs +162 -0
- package/vendor/desk/hooks/lib/delivery-stop.cjs +326 -0
- package/vendor/desk/hooks/lib/detach-worker.cjs +43 -0
- package/vendor/desk/hooks/lib/durable-files.cjs +102 -0
- package/vendor/desk/hooks/lib/factory-end.cjs +327 -0
- package/vendor/desk/hooks/lib/lane-model.cjs +82 -0
- package/vendor/desk/hooks/lib/node-required.cjs +56 -0
- package/vendor/desk/hooks/lib/orca-session-title.cjs +60 -0
- package/vendor/desk/hooks/lib/session-end.cjs +30 -0
- package/vendor/desk/hooks/lib/sync-end.cjs +89 -0
- package/vendor/desk/hooks/loop-start.cjs +105 -0
- package/vendor/desk/hooks/node-missing.sh +78 -0
- package/vendor/desk/hooks/orca-session-title.cjs +8 -0
- package/vendor/desk/hooks/session-end.cjs +8 -0
- package/vendor/desk/mcp/README.md +269 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/support-matrix.json +72 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
- package/vendor/desk/mcp/artifacts/runtime-deps/README.md +25 -0
- package/vendor/desk/mcp/bootstrap.cjs +761 -0
- package/vendor/desk/mcp/docs/private-feedback.md +13 -0
- package/vendor/desk/mcp/idle-proxy.cjs +423 -0
- package/vendor/desk/mcp/index.js +813 -0
- package/vendor/desk/mcp/package-lock.json +3717 -0
- package/vendor/desk/mcp/package.json +44 -0
- package/vendor/desk/mcp/scripts/agency-desk-channel.js +7 -0
- package/vendor/desk/mcp/scripts/build-runtime-deps-pack.js +5 -0
- package/vendor/desk/mcp/scripts/crew.js +89 -0
- package/vendor/desk/mcp/scripts/drains-launcher.mjs +329 -0
- package/vendor/desk/mcp/scripts/drains.js +5 -0
- package/vendor/desk/mcp/scripts/factory.js +657 -0
- package/vendor/desk/mcp/scripts/file-desk-problem.js +9 -0
- package/vendor/desk/mcp/scripts/finish-commit.js +7 -0
- package/vendor/desk/mcp/scripts/lfs.js +37 -0
- package/vendor/desk/mcp/scripts/local-recovery.js +363 -0
- package/vendor/desk/mcp/scripts/migrations.js +11 -0
- package/vendor/desk/mcp/scripts/private-view.js +177 -0
- package/vendor/desk/mcp/scripts/resolve-desk-root.js +106 -0
- package/vendor/desk/mcp/scripts/session-boot.js +22 -0
- package/vendor/desk/mcp/scripts/session-retention.js +5 -0
- package/vendor/desk/mcp/scripts/session-sync.js +10 -0
- package/vendor/desk/mcp/scripts/sessions.js +5 -0
- package/vendor/desk/mcp/scripts/sync-push.js +13 -0
- package/vendor/desk/mcp/scripts/tidy-status.js +8 -0
- package/vendor/desk/mcp/scripts/verify-runtime-deps-pack.js +5 -0
- package/vendor/desk/mcp/src/actions/desk-read.actions.mts +73 -0
- package/vendor/desk/mcp/src/actions/desk-session.actions.mts +42 -0
- package/vendor/desk/mcp/src/actions/desk-web.actions.mts +52 -0
- package/vendor/desk/mcp/src/actions/desk.actions.mts +5 -0
- package/vendor/desk/mcp/src/actions/generated/desk/OuroActions.swift +649 -0
- package/vendor/desk/mcp/src/actions/generated/desk/OuroActionsReins.swift +61 -0
- package/vendor/desk/mcp/src/actions/generated/desk/actions.json +280 -0
- package/vendor/desk/mcp/src/actions/generated/desk/commands.json +145 -0
- package/vendor/desk/mcp/src/actions/generated/desk/mcp.json +256 -0
- package/vendor/desk/mcp/src/actions/generated/desk/web.ts +59 -0
- package/vendor/desk/mcp/src/actions/generated/desk/webmcp.json +250 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActions.swift +241 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActionsReins.swift +25 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/actions.json +73 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/commands.json +53 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/mcp.json +83 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/web.ts +47 -0
- package/vendor/desk/mcp/src/actions/generated/desk-web/webmcp.json +81 -0
- package/vendor/desk/mcp/src/actions/served.js +5 -0
- package/vendor/desk/mcp/src/activation/admit.js +77 -0
- package/vendor/desk/mcp/src/activation/failures.js +65 -0
- package/vendor/desk/mcp/src/activation/readiness-policy.js +102 -0
- package/vendor/desk/mcp/src/activation/schema.js +17 -0
- package/vendor/desk/mcp/src/activation/superpowers-context.js +265 -0
- package/vendor/desk/mcp/src/activation/validate.js +540 -0
- package/vendor/desk/mcp/src/artifacts/tombstones.js +61 -0
- package/vendor/desk/mcp/src/crew/initiative.js +287 -0
- package/vendor/desk/mcp/src/crew/workspace.js +1259 -0
- package/vendor/desk/mcp/src/db/init.js +75 -0
- package/vendor/desk/mcp/src/db/schema.sql +83 -0
- package/vendor/desk/mcp/src/desk/active-tasks.js +408 -0
- package/vendor/desk/mcp/src/desk/card-commit-guard.js +281 -0
- package/vendor/desk/mcp/src/desk/cleanup-index.js +53 -0
- package/vendor/desk/mcp/src/desk/content-home.js +246 -0
- package/vendor/desk/mcp/src/desk/crew-config.js +102 -0
- package/vendor/desk/mcp/src/desk/crew-member.js +196 -0
- package/vendor/desk/mcp/src/desk/crew-roster.js +151 -0
- package/vendor/desk/mcp/src/desk/frontmatter-lite.js +228 -0
- package/vendor/desk/mcp/src/desk/gh-logins.js +109 -0
- package/vendor/desk/mcp/src/desk/handles.js +123 -0
- package/vendor/desk/mcp/src/desk/handoff-reference.js +35 -0
- package/vendor/desk/mcp/src/desk/improvement-authority.js +3 -0
- package/vendor/desk/mcp/src/desk/improvement-cards.js +704 -0
- package/vendor/desk/mcp/src/desk/improvement-person.js +51 -0
- package/vendor/desk/mcp/src/desk/lifecycle.js +16 -0
- package/vendor/desk/mcp/src/desk/machine-desks.js +119 -0
- package/vendor/desk/mcp/src/desk/naming.js +333 -0
- package/vendor/desk/mcp/src/desk/organization.js +592 -0
- package/vendor/desk/mcp/src/desk/resources.js +274 -0
- package/vendor/desk/mcp/src/desk/runtime-resolver.js +30 -0
- package/vendor/desk/mcp/src/desk/scratch-paths.js +44 -0
- package/vendor/desk/mcp/src/desk/step-delivery.js +140 -0
- package/vendor/desk/mcp/src/desk/steps.js +263 -0
- package/vendor/desk/mcp/src/desk/tidy.js +930 -0
- package/vendor/desk/mcp/src/desk/unsigned-deliveries.js +359 -0
- package/vendor/desk/mcp/src/factory/agent-types.js +45 -0
- package/vendor/desk/mcp/src/factory/andon-watch.js +109 -0
- package/vendor/desk/mcp/src/factory/binding.js +612 -0
- package/vendor/desk/mcp/src/factory/boot-check.js +645 -0
- package/vendor/desk/mcp/src/factory/capture-classify.js +158 -0
- package/vendor/desk/mcp/src/factory/capture-count.js +183 -0
- package/vendor/desk/mcp/src/factory/capture-flush.js +268 -0
- package/vendor/desk/mcp/src/factory/capture-publish.js +141 -0
- package/vendor/desk/mcp/src/factory/capture-schema.js +193 -0
- package/vendor/desk/mcp/src/factory/capture-sweep.js +239 -0
- package/vendor/desk/mcp/src/factory/catch-point.js +60 -0
- package/vendor/desk/mcp/src/factory/commit-resolve.js +94 -0
- package/vendor/desk/mcp/src/factory/consent-answer.js +37 -0
- package/vendor/desk/mcp/src/factory/context-capability.js +15 -0
- package/vendor/desk/mcp/src/factory/context-outbox.js +885 -0
- package/vendor/desk/mcp/src/factory/context-run.js +386 -0
- package/vendor/desk/mcp/src/factory/context-schema.js +249 -0
- package/vendor/desk/mcp/src/factory/copilot-turn-index.js +93 -0
- package/vendor/desk/mcp/src/factory/copilot-usage.js +148 -0
- package/vendor/desk/mcp/src/factory/credential.js +45 -0
- package/vendor/desk/mcp/src/factory/derive-claude.js +960 -0
- package/vendor/desk/mcp/src/factory/derive-codex.js +734 -0
- package/vendor/desk/mcp/src/factory/derive-common.js +279 -0
- package/vendor/desk/mcp/src/factory/derive-copilot.js +1057 -0
- package/vendor/desk/mcp/src/factory/derive-run.js +807 -0
- package/vendor/desk/mcp/src/factory/desk-problem-file.js +310 -0
- package/vendor/desk/mcp/src/factory/desk-problem-fingerprint.js +70 -0
- package/vendor/desk/mcp/src/factory/desk-problem-known.js +246 -0
- package/vendor/desk/mcp/src/factory/desk-problem-template.js +107 -0
- package/vendor/desk/mcp/src/factory/desk-repo.js +1223 -0
- package/vendor/desk/mcp/src/factory/desk-task-line.js +28 -0
- package/vendor/desk/mcp/src/factory/desk-visibility.js +48 -0
- package/vendor/desk/mcp/src/factory/end-hook.js +14 -0
- package/vendor/desk/mcp/src/factory/evaluate-kick.js +164 -0
- package/vendor/desk/mcp/src/factory/evaluate-run.js +678 -0
- package/vendor/desk/mcp/src/factory/evaluator-step.js +484 -0
- package/vendor/desk/mcp/src/factory/filer-launch.js +79 -0
- package/vendor/desk/mcp/src/factory/flush-health.js +26 -0
- package/vendor/desk/mcp/src/factory/flush.js +1758 -0
- package/vendor/desk/mcp/src/factory/focus.js +326 -0
- package/vendor/desk/mcp/src/factory/headless-flag.cjs +32 -0
- package/vendor/desk/mcp/src/factory/headless-flag.js +25 -0
- package/vendor/desk/mcp/src/factory/headless-ledger.js +743 -0
- package/vendor/desk/mcp/src/factory/headless.js +567 -0
- package/vendor/desk/mcp/src/factory/held-route.js +93 -0
- package/vendor/desk/mcp/src/factory/host-flags.js +36 -0
- package/vendor/desk/mcp/src/factory/improvement-verify.js +429 -0
- package/vendor/desk/mcp/src/factory/kaizen-file.js +231 -0
- package/vendor/desk/mcp/src/factory/label-binding.js +90 -0
- package/vendor/desk/mcp/src/factory/label-schema.js +426 -0
- package/vendor/desk/mcp/src/factory/local-status.js +368 -0
- package/vendor/desk/mcp/src/factory/loop-conditions.js +121 -0
- package/vendor/desk/mcp/src/factory/loop-health.js +500 -0
- package/vendor/desk/mcp/src/factory/loop-slot.js +90 -0
- package/vendor/desk/mcp/src/factory/loop-status.js +100 -0
- package/vendor/desk/mcp/src/factory/loop-switch.cjs +14 -0
- package/vendor/desk/mcp/src/factory/loop-worker-state.js +96 -0
- package/vendor/desk/mcp/src/factory/loop-worker.js +290 -0
- package/vendor/desk/mcp/src/factory/marker.js +61 -0
- package/vendor/desk/mcp/src/factory/mirror-step.js +145 -0
- package/vendor/desk/mcp/src/factory/os-protect.js +243 -0
- package/vendor/desk/mcp/src/factory/outbox.js +2231 -0
- package/vendor/desk/mcp/src/factory/outcome.js +431 -0
- package/vendor/desk/mcp/src/factory/pipeline/andon.js +319 -0
- package/vendor/desk/mcp/src/factory/pipeline/attention-rollup.js +158 -0
- package/vendor/desk/mcp/src/factory/pipeline/attention.js +146 -0
- package/vendor/desk/mcp/src/factory/pipeline/build.js +299 -0
- package/vendor/desk/mcp/src/factory/pipeline/compare.js +148 -0
- package/vendor/desk/mcp/src/factory/pipeline/formulas.js +652 -0
- package/vendor/desk/mcp/src/factory/pipeline/kaizen.js +387 -0
- package/vendor/desk/mcp/src/factory/pipeline/lifecycle-clocks.js +345 -0
- package/vendor/desk/mcp/src/factory/pipeline/normalize.js +73 -0
- package/vendor/desk/mcp/src/factory/pipeline/number-states.js +154 -0
- package/vendor/desk/mcp/src/factory/pipeline/outcomes.js +268 -0
- package/vendor/desk/mcp/src/factory/pipeline/report.js +737 -0
- package/vendor/desk/mcp/src/factory/pipeline/rollups.js +883 -0
- package/vendor/desk/mcp/src/factory/pipeline/stretches.js +523 -0
- package/vendor/desk/mcp/src/factory/pipeline/timeline.js +199 -0
- package/vendor/desk/mcp/src/factory/pipeline/validate-pr.js +238 -0
- package/vendor/desk/mcp/src/factory/pipeline/versions.js +42 -0
- package/vendor/desk/mcp/src/factory/pipeline/walk.js +1177 -0
- package/vendor/desk/mcp/src/factory/plugin-registry.js +72 -0
- package/vendor/desk/mcp/src/factory/plugin-sources.cjs +249 -0
- package/vendor/desk/mcp/src/factory/pr-green.js +77 -0
- package/vendor/desk/mcp/src/factory/process-lock.js +142 -0
- package/vendor/desk/mcp/src/factory/proof-session.js +75 -0
- package/vendor/desk/mcp/src/factory/publish.js +637 -0
- package/vendor/desk/mcp/src/factory/published-schema.js +648 -0
- package/vendor/desk/mcp/src/factory/reconcile-reasons.js +22 -0
- package/vendor/desk/mcp/src/factory/reconcile-step.js +251 -0
- package/vendor/desk/mcp/src/factory/reconcile.js +808 -0
- package/vendor/desk/mcp/src/factory/release-version.js +134 -0
- package/vendor/desk/mcp/src/factory/repo-name.js +13 -0
- package/vendor/desk/mcp/src/factory/retention.js +60 -0
- package/vendor/desk/mcp/src/factory/route-desk.js +40 -0
- package/vendor/desk/mcp/src/factory/route-issues.js +251 -0
- package/vendor/desk/mcp/src/factory/route-local.js +264 -0
- package/vendor/desk/mcp/src/factory/schema.js +957 -0
- package/vendor/desk/mcp/src/factory/session-kind.js +16 -0
- package/vendor/desk/mcp/src/factory/session-lifetime.js +56 -0
- package/vendor/desk/mcp/src/factory/session-route.js +183 -0
- package/vendor/desk/mcp/src/factory/shell-git.js +500 -0
- package/vendor/desk/mcp/src/factory/store-issues.js +143 -0
- package/vendor/desk/mcp/src/factory/store-route.js +208 -0
- package/vendor/desk/mcp/src/factory/test-state-guard.js +103 -0
- package/vendor/desk/mcp/src/factory/time.js +36 -0
- package/vendor/desk/mcp/src/factory/tool-issue-file.js +84 -0
- package/vendor/desk/mcp/src/factory/tool-kinds.js +87 -0
- package/vendor/desk/mcp/src/factory/triage-schema.js +233 -0
- package/vendor/desk/mcp/src/factory/windows-acl.js +679 -0
- package/vendor/desk/mcp/src/indexer/chunk.js +232 -0
- package/vendor/desk/mcp/src/indexer/discover.js +434 -0
- package/vendor/desk/mcp/src/indexer/exclusions.js +247 -0
- package/vendor/desk/mcp/src/indexer/index.js +167 -0
- package/vendor/desk/mcp/src/indexer/refs.js +0 -0
- package/vendor/desk/mcp/src/indexer/text-hash.js +18 -0
- package/vendor/desk/mcp/src/lib/ouro-actions/actions.claims.json +75 -0
- package/vendor/desk/mcp/src/lib/ouro-actions/dist-manifest.json +70 -0
- package/vendor/desk/mcp/src/lib/ouro-actions/ouro-actions.mts +1416 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/LICENSE +21 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-claims.ts +190 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-command.ts +1020 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/checks.ts +343 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/cli.ts +240 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/component.ts +430 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/dev-commands.ts +204 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/doctor.ts +126 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/effects.ts +68 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/exit-codes.ts +75 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/help.ts +220 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/mcp.ts +268 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/outcome.ts +265 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/output.ts +67 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/precise-copy.ts +235 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/problem.ts +124 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.kit.mts +8 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.ts +568 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/terminal.ts +245 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/voice.ts +136 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/wait.ts +226 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/work-event.ts +181 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.kit.mts +18 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.ts +2072 -0
- package/vendor/desk/mcp/src/package-metadata.js +20 -0
- package/vendor/desk/mcp/src/protected/legacy-ledger.js +55 -0
- package/vendor/desk/mcp/src/readiness/leftovers.js +75 -0
- package/vendor/desk/mcp/src/readiness/process-start.js +149 -0
- package/vendor/desk/mcp/src/runtime/admission-worker.js +194 -0
- package/vendor/desk/mcp/src/runtime/admission.js +177 -0
- package/vendor/desk/mcp/src/runtime/agency-desk-channel.js +342 -0
- package/vendor/desk/mcp/src/runtime/agents-md.js +62 -0
- package/vendor/desk/mcp/src/runtime/append-lane.js +68 -0
- package/vendor/desk/mcp/src/runtime/argv-safe-reason.js +55 -0
- package/vendor/desk/mcp/src/runtime/boot-dependencies.js +75 -0
- package/vendor/desk/mcp/src/runtime/boot-text.js +504 -0
- package/vendor/desk/mcp/src/runtime/boot.js +1677 -0
- package/vendor/desk/mcp/src/runtime/bootstrap.js +1455 -0
- package/vendor/desk/mcp/src/runtime/chunked-import.js +102 -0
- package/vendor/desk/mcp/src/runtime/copilot-commit-trailer.js +133 -0
- package/vendor/desk/mcp/src/runtime/copilot-session.js +155 -0
- package/vendor/desk/mcp/src/runtime/deliver.js +469 -0
- package/vendor/desk/mcp/src/runtime/desk-channel.js +86 -0
- package/vendor/desk/mcp/src/runtime/desk-failure.js +26 -0
- package/vendor/desk/mcp/src/runtime/desk-health.js +168 -0
- package/vendor/desk/mcp/src/runtime/desk-session.js +1451 -0
- package/vendor/desk/mcp/src/runtime/diagnostic-server.js +72 -0
- package/vendor/desk/mcp/src/runtime/diagnostics.js +241 -0
- package/vendor/desk/mcp/src/runtime/drains-cli.js +187 -0
- package/vendor/desk/mcp/src/runtime/drains.js +781 -0
- package/vendor/desk/mcp/src/runtime/elsewhere-note.js +9 -0
- package/vendor/desk/mcp/src/runtime/failure-evidence.js +21 -0
- package/vendor/desk/mcp/src/runtime/fast-refs.js +209 -0
- package/vendor/desk/mcp/src/runtime/filer-throttle.js +66 -0
- package/vendor/desk/mcp/src/runtime/focused-card.js +147 -0
- package/vendor/desk/mcp/src/runtime/front-door.js +204 -0
- package/vendor/desk/mcp/src/runtime/gate-wait.js +2 -0
- package/vendor/desk/mcp/src/runtime/git-inspection.js +201 -0
- package/vendor/desk/mcp/src/runtime/git-read-worker.js +157 -0
- package/vendor/desk/mcp/src/runtime/health.js +50 -0
- package/vendor/desk/mcp/src/runtime/hooks.js +353 -0
- package/vendor/desk/mcp/src/runtime/hosted.js +163 -0
- package/vendor/desk/mcp/src/runtime/inbox.js +102 -0
- package/vendor/desk/mcp/src/runtime/index-drift.js +118 -0
- package/vendor/desk/mcp/src/runtime/last-start.js +133 -0
- package/vendor/desk/mcp/src/runtime/lesson-section.js +92 -0
- package/vendor/desk/mcp/src/runtime/lessons-shelf.js +100 -0
- package/vendor/desk/mcp/src/runtime/lfs.js +319 -0
- package/vendor/desk/mcp/src/runtime/native-path.js +12 -0
- package/vendor/desk/mcp/src/runtime/newest-release.js +197 -0
- package/vendor/desk/mcp/src/runtime/node-selection.js +233 -0
- package/vendor/desk/mcp/src/runtime/orca-session-title.js +225 -0
- package/vendor/desk/mcp/src/runtime/other-sessions.js +183 -0
- package/vendor/desk/mcp/src/runtime/pending-migrations.js +653 -0
- package/vendor/desk/mcp/src/runtime/plugin-update.js +215 -0
- package/vendor/desk/mcp/src/runtime/pluginless-runtimes.js +34 -0
- package/vendor/desk/mcp/src/runtime/pr-publication.js +226 -0
- package/vendor/desk/mcp/src/runtime/preview-snapshot.js +23 -0
- package/vendor/desk/mcp/src/runtime/publication-mode.js +19 -0
- package/vendor/desk/mcp/src/runtime/relays.js +974 -0
- package/vendor/desk/mcp/src/runtime/release-alert.js +148 -0
- package/vendor/desk/mcp/src/runtime/remote-identity.js +140 -0
- package/vendor/desk/mcp/src/runtime/resolve-here.js +4 -0
- package/vendor/desk/mcp/src/runtime/runtime-deps-cli.js +65 -0
- package/vendor/desk/mcp/src/runtime/runtime-deps.js +1109 -0
- package/vendor/desk/mcp/src/runtime/runtime-identity.js +22 -0
- package/vendor/desk/mcp/src/runtime/runtime-swap.js +101 -0
- package/vendor/desk/mcp/src/runtime/schedules.js +235 -0
- package/vendor/desk/mcp/src/runtime/session-activity.js +190 -0
- package/vendor/desk/mcp/src/runtime/session-label.js +30 -0
- package/vendor/desk/mcp/src/runtime/session-retention.js +662 -0
- package/vendor/desk/mcp/src/runtime/session-sync.js +333 -0
- package/vendor/desk/mcp/src/runtime/session-trailer.js +126 -0
- package/vendor/desk/mcp/src/runtime/sessions-cli.js +301 -0
- package/vendor/desk/mcp/src/runtime/signoff-listed.js +81 -0
- package/vendor/desk/mcp/src/runtime/skills.js +76 -0
- package/vendor/desk/mcp/src/runtime/stale-card-lead.js +52 -0
- package/vendor/desk/mcp/src/runtime/stale-desk-refresh.js +198 -0
- package/vendor/desk/mcp/src/runtime/stale-desk.js +219 -0
- package/vendor/desk/mcp/src/runtime/stalled.js +255 -0
- package/vendor/desk/mcp/src/runtime/standing-authority.js +79 -0
- package/vendor/desk/mcp/src/runtime/startup-boot.js +341 -0
- package/vendor/desk/mcp/src/runtime/startup-resolve.js +140 -0
- package/vendor/desk/mcp/src/runtime/state-branch.js +203 -0
- package/vendor/desk/mcp/src/runtime/status-compact.js +165 -0
- package/vendor/desk/mcp/src/runtime/status-inspection-child.js +26 -0
- package/vendor/desk/mcp/src/runtime/status-inspection.js +147 -0
- package/vendor/desk/mcp/src/runtime/status-root.js +39 -0
- package/vendor/desk/mcp/src/runtime/sync-worker.js +911 -0
- package/vendor/desk/mcp/src/runtime/test-state-guard.js +107 -0
- package/vendor/desk/mcp/src/runtime/unmerged-saves.js +247 -0
- package/vendor/desk/mcp/src/runtime/workspace-claim.js +53 -0
- package/vendor/desk/mcp/src/runtime/workspace-evidence.js +96 -0
- package/vendor/desk/mcp/src/runtime/workspace-tidy.js +509 -0
- package/vendor/desk/mcp/src/search/direct-lexical.js +54 -0
- package/vendor/desk/mcp/src/search/embedder.js +108 -0
- package/vendor/desk/mcp/src/search/engine.js +406 -0
- package/vendor/desk/mcp/src/search/files-router.js +22 -0
- package/vendor/desk/mcp/src/search/old-index.js +46 -0
- package/vendor/desk/mcp/src/search/vectors.js +60 -0
- package/vendor/desk/mcp/src/server.js +389 -0
- package/vendor/desk/mcp/src/tool-names.js +73 -0
- package/vendor/desk/mcp/src/tool-refusal.cjs +35 -0
- package/vendor/desk/mcp/src/tool-schema-parts.js +12 -0
- package/vendor/desk/mcp/src/tool-schemas.js +325 -0
- package/vendor/desk/mcp/src/tools/_card-commit.js +148 -0
- package/vendor/desk/mcp/src/tools/archive-links.js +185 -0
- package/vendor/desk/mcp/src/tools/archive-move.js +18 -0
- package/vendor/desk/mcp/src/tools/archive-native-session.js +728 -0
- package/vendor/desk/mcp/src/tools/archive-state.js +513 -0
- package/vendor/desk/mcp/src/tools/delivery-gate.js +251 -0
- package/vendor/desk/mcp/src/tools/desk-save.js +444 -0
- package/vendor/desk/mcp/src/tools/doctor.js +122 -0
- package/vendor/desk/mcp/src/tools/done-evidence.js +260 -0
- package/vendor/desk/mcp/src/tools/factory-context.js +204 -0
- package/vendor/desk/mcp/src/tools/friction.js +332 -0
- package/vendor/desk/mcp/src/tools/improvement.js +156 -0
- package/vendor/desk/mcp/src/tools/lesson-lines.js +22 -0
- package/vendor/desk/mcp/src/tools/lesson-owners.js +137 -0
- package/vendor/desk/mcp/src/tools/lesson-team.js +169 -0
- package/vendor/desk/mcp/src/tools/lesson.js +254 -0
- package/vendor/desk/mcp/src/tools/local-only.js +151 -0
- package/vendor/desk/mcp/src/tools/move.js +794 -0
- package/vendor/desk/mcp/src/tools/native-stage-context.js +32 -0
- package/vendor/desk/mcp/src/tools/note.js +267 -0
- package/vendor/desk/mcp/src/tools/search.js +634 -0
- package/vendor/desk/mcp/src/tools/shared-write.js +196 -0
- package/vendor/desk/mcp/src/tools/sibling-desk.js +37 -0
- package/vendor/desk/mcp/src/tools/status.js +233 -0
- package/vendor/desk/mcp/src/tools/task-archive-due.js +9 -0
- package/vendor/desk/mcp/src/tools/task-archived-resource.js +53 -0
- package/vendor/desk/mcp/src/tools/task-body.js +141 -0
- package/vendor/desk/mcp/src/tools/task-focus.js +164 -0
- package/vendor/desk/mcp/src/tools/task-log.js +76 -0
- package/vendor/desk/mcp/src/tools/task-signoff.js +155 -0
- package/vendor/desk/mcp/src/tools/task.js +1768 -0
- package/vendor/desk/mcp/src/tools/track-row.js +89 -0
- package/vendor/desk/mcp/src/tools/track.js +240 -0
- package/vendor/desk/mcp/src/util/agency-session.cjs +29 -0
- package/vendor/desk/mcp/src/util/archive-links.js +105 -0
- package/vendor/desk/mcp/src/util/bash.js +36 -0
- package/vendor/desk/mcp/src/util/capture-record.js +73 -0
- package/vendor/desk/mcp/src/util/cas-commit.js +252 -0
- package/vendor/desk/mcp/src/util/created-dirs.js +71 -0
- package/vendor/desk/mcp/src/util/deferred-tools.js +51 -0
- package/vendor/desk/mcp/src/util/desk-owner.js +99 -0
- package/vendor/desk/mcp/src/util/env-value.js +13 -0
- package/vendor/desk/mcp/src/util/file-identity.js +40 -0
- package/vendor/desk/mcp/src/util/finish-commit.js +145 -0
- package/vendor/desk/mcp/src/util/fm.js +410 -0
- package/vendor/desk/mcp/src/util/git-config-file.js +85 -0
- package/vendor/desk/mcp/src/util/git-stage.js +440 -0
- package/vendor/desk/mcp/src/util/main-publish.js +240 -0
- package/vendor/desk/mcp/src/util/markdown-links.cjs +555 -0
- package/vendor/desk/mcp/src/util/object-input.js +59 -0
- package/vendor/desk/mcp/src/util/paths.js +647 -0
- package/vendor/desk/mcp/src/util/rank.js +189 -0
- package/vendor/desk/mcp/src/util/redact.js +92 -0
- package/vendor/desk/mcp/src/util/remove-retry.js +35 -0
- package/vendor/desk/mcp/src/util/rename-retry.js +73 -0
- package/vendor/desk/mcp/src/util/route-around.js +265 -0
- package/vendor/desk/mcp/src/util/shell-quote.js +18 -0
- package/vendor/desk/mcp/src/util/startup-direction.js +124 -0
- package/vendor/desk/mcp/src/util/state-ignore.js +33 -0
- package/vendor/desk/mcp/src/util/tool-commits.js +64 -0
- package/vendor/desk/mcp/src/util/unicode-16/LICENSE-MIT.txt +7 -0
- package/vendor/desk/mcp/src/util/unicode-16/README.md +9 -0
- package/vendor/desk/mcp/src/util/unicode-16/letter.cjs +1 -0
- package/vendor/desk/mcp/src/util/unicode-16/mark.cjs +1 -0
- package/vendor/desk/mcp/src/util/unicode-16/number.cjs +1 -0
- package/vendor/desk/mcp/web-auth.cjs +1897 -0
- package/vendor/desk/mcp/web-browser-discovery.cjs +53 -0
- package/vendor/desk/mcp/web-catalog.json +34 -0
- package/vendor/desk/mcp/web-launch.cjs +101 -0
- package/vendor/desk/mcp/web.cjs +1239 -0
- package/vendor/desk/migrations/01-move-to-ourostack-desk.md +188 -0
- package/vendor/desk/migrations/02-tidy-desk.md +87 -0
- package/vendor/desk/migrations/03-desk-release-channel.md +38 -0
- package/vendor/desk/optional/session-label/consumer.mjs +237 -0
- package/vendor/desk/optional/session-label/extension.mjs +32 -0
- package/vendor/desk/plugin.json +54 -0
- package/vendor/desk/settings.json +3 -0
- package/vendor/desk/skills/add-workspace-mcp/SKILL.md +180 -0
- package/vendor/desk/skills/adopt-inflight-work/SKILL.md +212 -0
- package/vendor/desk/skills/archive-workflow/SKILL.md +132 -0
- package/vendor/desk/skills/content-routing/SKILL.md +95 -0
- package/vendor/desk/skills/core-meeting-capture/SKILL.md +47 -0
- package/vendor/desk/skills/core-meeting-capture/references/capture-contract.md +175 -0
- package/vendor/desk/skills/curator/SKILL.md +103 -0
- package/vendor/desk/skills/delightful-decks/SKILL.md +67 -0
- package/vendor/desk/skills/desk-problem/SKILL.md +87 -0
- package/vendor/desk/skills/directory-structure/SKILL.md +169 -0
- package/vendor/desk/skills/doc-review-rigor/SKILL.md +63 -0
- package/vendor/desk/skills/draining-issues/SKILL.md +62 -0
- package/vendor/desk/skills/evaluate-release/SKILL.md +96 -0
- package/vendor/desk/skills/evidence-discipline/SKILL.md +150 -0
- package/vendor/desk/skills/factory-evaluator/SKILL.md +122 -0
- package/vendor/desk/skills/factory-task-context/SKILL.md +116 -0
- package/vendor/desk/skills/factory-work/SKILL.md +16 -0
- package/vendor/desk/skills/fast-honest-ci/SKILL.md +70 -0
- package/vendor/desk/skills/fast-honest-ci/examples.md +49 -0
- package/vendor/desk/skills/first-run-bootstrap/SKILL.md +95 -0
- package/vendor/desk/skills/friction-management/SKILL.md +98 -0
- package/vendor/desk/skills/git-hygiene/SKILL.md +253 -0
- package/vendor/desk/skills/independent-review/SKILL.md +34 -0
- package/vendor/desk/skills/interaction-style/SKILL.md +239 -0
- package/vendor/desk/skills/lesson-capture/SKILL.md +85 -0
- package/vendor/desk/skills/lesson-capture/agents-md-budget.mjs +61 -0
- package/vendor/desk/skills/online-evaluation/SKILL.md +81 -0
- package/vendor/desk/skills/operator-voice-comments/LICENSE-humanize +21 -0
- package/vendor/desk/skills/operator-voice-comments/SKILL.md +90 -0
- package/vendor/desk/skills/operator-voice-comments/human-voice.md +43 -0
- package/vendor/desk/skills/peer-pr-review/SKILL.md +104 -0
- package/vendor/desk/skills/pr-feedback-on-own-pr/SKILL.md +145 -0
- package/vendor/desk/skills/pr-review-interrogation/SKILL.md +121 -0
- package/vendor/desk/skills/pr-reviewer-audit/SKILL.md +68 -0
- package/vendor/desk/skills/pr-reviewer-audit/helpers/audit.py +335 -0
- package/vendor/desk/skills/pr-reviewer-audit/helpers/test_audit.py +486 -0
- package/vendor/desk/skills/pr-self-review/SKILL.md +86 -0
- package/vendor/desk/skills/pr-surface-hygiene/SKILL.md +105 -0
- package/vendor/desk/skills/pr-surface-hygiene/check-visual-proof.cjs +99 -0
- package/vendor/desk/skills/pr-surface-hygiene/repository-setup.md +19 -0
- package/vendor/desk/skills/pr-surface-hygiene/resources/pr-visual-proof.yml +29 -0
- package/vendor/desk/skills/pr-surface-hygiene/resources/pull-request-template.md +5 -0
- package/vendor/desk/skills/preflight-actions/SKILL.md +60 -0
- package/vendor/desk/skills/preview-feedback/SKILL.md +70 -0
- package/vendor/desk/skills/repo-handling/SKILL.md +67 -0
- package/vendor/desk/skills/rnd-lab/SKILL.md +52 -0
- package/vendor/desk/skills/runtime-symptom-investigation/SKILL.md +106 -0
- package/vendor/desk/skills/session-resumption/SKILL.md +126 -0
- package/vendor/desk/skills/session-start/SKILL.md +54 -0
- package/vendor/desk/skills/session-start/details.md +150 -0
- package/vendor/desk/skills/session-start-migrations/README.md +71 -0
- package/vendor/desk/skills/session-start-migrations/SKILL.md +108 -0
- package/vendor/desk/skills/start-task/SKILL.md +88 -0
- package/vendor/desk/skills/task-card-format/SKILL.md +198 -0
- package/vendor/desk/skills/task-lifecycle/SKILL.md +217 -0
- package/vendor/desk/skills/track-card-format/SKILL.md +90 -0
- package/vendor/desk/skills/using-desk/SKILL.md +58 -0
- package/vendor/desk/skills/using-superpowers-with-desk/SKILL.md +156 -0
- package/vendor/desk/skills/work-orchestration/SKILL.md +162 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// What each host never records, or records only in part. A reader that finds an old (`/1`) facts file lists these in `unavailable`, so a missing value is not read as a measured zero.
|
|
2
|
+
const freeze = (flags) => Object.freeze(flags.map((flag) => Object.freeze(flag)))
|
|
3
|
+
|
|
4
|
+
export const HOST_FLAGS = Object.freeze({
|
|
5
|
+
"claude-code": freeze([
|
|
6
|
+
{ field: "compaction_waits", reason: "host_does_not_record" },
|
|
7
|
+
{ field: "reasoning_tokens", reason: "host_does_not_record" },
|
|
8
|
+
{ field: "commits", reason: "host_does_not_record" },
|
|
9
|
+
{ field: "permission_waits", reason: "host_does_not_record" },
|
|
10
|
+
{ field: "prs", reason: "host_records_partly" },
|
|
11
|
+
{ field: "api_retries", reason: "host_records_partly" },
|
|
12
|
+
]),
|
|
13
|
+
"codex-cli": freeze([
|
|
14
|
+
{ field: "compaction_waits", reason: "host_does_not_record" },
|
|
15
|
+
{ field: "commits", reason: "host_does_not_record" },
|
|
16
|
+
{ field: "permission_waits", reason: "host_does_not_record" },
|
|
17
|
+
{ field: "api_retries", reason: "host_does_not_record" },
|
|
18
|
+
{ field: "prs", reason: "host_records_partly" },
|
|
19
|
+
{ field: "tool_outcomes", reason: "host_records_partly" },
|
|
20
|
+
{ field: "requests", reason: "host_records_partly" },
|
|
21
|
+
{ field: "tokens", reason: "host_records_partly" },
|
|
22
|
+
{ field: "human_turns", reason: "host_does_not_record" },
|
|
23
|
+
]),
|
|
24
|
+
"copilot-cli": freeze([
|
|
25
|
+
{ field: "prs", reason: "host_records_partly" },
|
|
26
|
+
// A `user.message` with no `source` is not proven to be typed by a human: a hook follow-up or a batched message may be logged the same way.
|
|
27
|
+
{ field: "human_turns", reason: "host_records_partly" },
|
|
28
|
+
]),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export function hostFlagsFor(host, details) {
|
|
32
|
+
if (typeof host !== "string" || !Object.hasOwn(HOST_FLAGS, host)) return []
|
|
33
|
+
const flags = HOST_FLAGS[host].map((flag) => ({ ...flag }))
|
|
34
|
+
if (host === "copilot-cli" && details?.entrypoint === "cli") flags.push({ field: "entrypoint", reason: "host_does_not_record" })
|
|
35
|
+
return flags
|
|
36
|
+
}
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
// The loop's `verify` step. It looks once a day at every improvement card that is open, claimed, shipped or
|
|
2
|
+
// verifying and decides what the evidence allows: set the version a countermeasure shipped in, close a card whose
|
|
3
|
+
// fix is confirmed (or whose source recovered), reopen a card whose fix did not work, and escalate thin data after
|
|
4
|
+
// a fixed number of checks. A person never closes a card or types a version.
|
|
5
|
+
//
|
|
6
|
+
// What decides each card.
|
|
7
|
+
// - A card with a mirror issue (`kaizen_url`): the store's verdict labels on that issue. `confirmed` closes the card
|
|
8
|
+
// (`closed_confirmed`) and the issue; `not-confirmed` reopens the card (the library counts the reopen, clears the
|
|
9
|
+
// countermeasure and version, and keeps the card's place at the front of the queue) and resets the issue's
|
|
10
|
+
// `countermeasure` and `version`; neither label is a thin check.
|
|
11
|
+
// - A card whose source has its own recovery signal reads the loop's conditions record (`conditionOf`), or for a
|
|
12
|
+
// reconcile class the reconcile summary's own streaks. `andon` and `store_build` recover at 1 clear observation;
|
|
13
|
+
// `loop_alarm`, `evaluator` and `flush_health` at 2; a reconcile class at `clear` of 2 or more (it is present again
|
|
14
|
+
// at `consecutive` of 3 or more after its version); a Desk problem 7 days after its version, when the conditions
|
|
15
|
+
// record says its issue is no longer open and the known-hit record says no machine hit it at a version at or after
|
|
16
|
+
// the fix (`closed_confirmed`; a record that could have lost a hit closes it `closed_unverified`).
|
|
17
|
+
// - A recovered `open` or `claimed` card closes `closed_unverified` with the reason `source_recovered`; a recovered
|
|
18
|
+
// `shipped` or `verifying` card closes `closed_confirmed`.
|
|
19
|
+
// - A fix nothing can measure (no plugin release mapping, or a friction note with no measure) closes
|
|
20
|
+
// `closed_unverified` once its pull request is merged with green checks.
|
|
21
|
+
// - After `THIN_CHECKS_BEFORE_ESCALATION` checks without a decision the card closes `closed_unverified` with the reason
|
|
22
|
+
// `thin_data_after_14_checks` when its pull request is merged with green checks, or when that could not be read
|
|
23
|
+
// (never `closed_confirmed`); otherwise it goes back to `open`, so it is worked and not parked.
|
|
24
|
+
// - A reading that could not be made (a failed fetch, an unreadable record) decides nothing. It is never read as
|
|
25
|
+
// "clear", "not merged" or "no release yet"; it counts as a waiting check so a permanent failure still reaches the
|
|
26
|
+
// deadline.
|
|
27
|
+
//
|
|
28
|
+
// Bounds. One check a day per card: a card checked less than `CHECK_GAP_HOURS` ago is skipped. At most
|
|
29
|
+
// `MAX_CHECKS_PER_RUN` shipped or verifying cards are checked in one run, the card checked longest ago (or never)
|
|
30
|
+
// first; the rest are counted as `deferred` and, because every checked card is stamped, go first on the next run, so
|
|
31
|
+
// none is starved. Recovered `open` or `claimed` cards are closed up to the same cap.
|
|
32
|
+
//
|
|
33
|
+
// Card writes go through `writeCardCommitted` (injected, so tests never touch Git) wrapping the card library's
|
|
34
|
+
// `updateCard`. A claimed card is patched with its own claim id read from the card. The card holds pointers only.
|
|
35
|
+
// A mirror issue gets, at most, its `countermeasure` and `version` lines changed and one fixed comment when it is
|
|
36
|
+
// closed; nothing from a card is written to the store beyond that.
|
|
37
|
+
//
|
|
38
|
+
// Result. `runVerifyStep(env, { deskRoot, personPrefix, runner, now, ...seams }) -> { ok, result, counts }`. `result`
|
|
39
|
+
// is `verified`, `nothing_to_verify`, `cards_unreadable`, `headless_session` (nothing written, nothing recorded), a
|
|
40
|
+
// code of the store access (`route_unknown`, `store_invalid`, `not_opted_in`, `no_account`, `gh_missing`,
|
|
41
|
+
// `auth_failed`) or `unexpected_error`; the last two groups have `ok: false` and change no card. `counts` is a count
|
|
42
|
+
// per code. A run is recorded through `recordStep(env, "verify", ...)`.
|
|
43
|
+
|
|
44
|
+
import * as path from "node:path"
|
|
45
|
+
|
|
46
|
+
import { readCards, updateCard } from "../desk/improvement-cards.js"
|
|
47
|
+
import { cardCommitMessage, writeCardCommitted as writeCardCommittedDefault } from "../tools/_card-commit.js"
|
|
48
|
+
import { ghRunner } from "./flush.js"
|
|
49
|
+
import { isHeadlessFactorySession } from "./headless-flag.js"
|
|
50
|
+
import { armKnownHits, knownHitsSince } from "./desk-problem-known.js"
|
|
51
|
+
import { pendingLaunchTimes } from "./filer-launch.js"
|
|
52
|
+
import { storeFor } from "./kaizen-file.js"
|
|
53
|
+
import { conditionOf } from "./loop-conditions.js"
|
|
54
|
+
import { recordStep } from "./loop-status.js"
|
|
55
|
+
import { readConsent, readStatus } from "./outbox.js"
|
|
56
|
+
import { VERDICT_LABELS } from "./pipeline/kaizen.js"
|
|
57
|
+
import { mergedWithGreenChecks } from "./pr-green.js"
|
|
58
|
+
import { githubReader, shippedVersion } from "./release-version.js"
|
|
59
|
+
import { issuesClient } from "./store-issues.js"
|
|
60
|
+
|
|
61
|
+
export const THIN_CHECKS_BEFORE_ESCALATION = 14
|
|
62
|
+
export const MAX_CHECKS_PER_RUN = 25
|
|
63
|
+
export const CHECK_GAP_HOURS = 23
|
|
64
|
+
export const DESK_PROBLEM_QUIET_DAYS = 7
|
|
65
|
+
// A "clear" or "present" reading older than this is unavailable: a collector that stopped is not a recovery.
|
|
66
|
+
export const MAX_READING_AGE_HOURS = 72
|
|
67
|
+
// A card with its own signal that reads measured present at this many verifying checks reopens then.
|
|
68
|
+
export const RECURRING_VERIFYING_CHECKS = 3
|
|
69
|
+
const RECONCILE_CLEAR_RUNS = 2
|
|
70
|
+
const RECONCILE_RECURRING_RUNS = 3
|
|
71
|
+
export const CONFIRMED_COMMENT = "Closed by the Desk loop: the check confirmed this change."
|
|
72
|
+
export const UNVERIFIED_COMMENT = "Closed by the Desk loop: this change could not be verified by this measure."
|
|
73
|
+
|
|
74
|
+
const HOUR_MS = 3600 * 1000
|
|
75
|
+
const DAY_MS = 24 * HOUR_MS
|
|
76
|
+
// Clear observations in a row that mean a source has recovered, per source.
|
|
77
|
+
const CLEAR_RUNS = { andon: 1, store_build: 1, desk_problem: 1, loop_alarm: 2, evaluator: 2, flush_health: 2 }
|
|
78
|
+
const RECOVERY_REASON = { andon: "andon_closed", store_build: "store_build_closed", reconcile_class: "reconcile_zero_twice", loop_alarm: "condition_cleared", evaluator: "condition_cleared", flush_health: "condition_cleared" }
|
|
79
|
+
const NO_MEASURE = new Set(["plugin_unmapped", "countermeasure_unparsed"])
|
|
80
|
+
const ISSUE_URL = /^https:\/\/github\.com\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)\/issues\/([1-9]\d{0,8})$/u
|
|
81
|
+
const VERSION = /^[0-9A-Za-z][0-9A-Za-z.+-]{0,63}$/u
|
|
82
|
+
|
|
83
|
+
const isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
|
|
84
|
+
const isCount = (value) => Number.isSafeInteger(value) && value >= 0
|
|
85
|
+
|
|
86
|
+
/** `githubAccess(env, { deskRoot, runner }) -> { ok: true, reader, issues(repo) } | { ok: false, code }`: the desk's store, the consenting account and its token, read the way the kaizen filer reads them. */
|
|
87
|
+
export async function githubAccess(env, { deskRoot, runner }) {
|
|
88
|
+
const store = await storeFor(env, deskRoot)
|
|
89
|
+
if (store === undefined) return { ok: false, code: "route_unknown" }
|
|
90
|
+
if (store === null) return { ok: false, code: "store_invalid" }
|
|
91
|
+
const consent = (await readConsent(env)).stores[store]
|
|
92
|
+
if (consent?.contribute !== true) return { ok: false, code: "not_opted_in" }
|
|
93
|
+
if (typeof consent.account !== "string") return { ok: false, code: "no_account" }
|
|
94
|
+
const auth = await runner(["auth", "token", "--user", consent.account])
|
|
95
|
+
if (auth.spawnError === "ENOENT") return { ok: false, code: "gh_missing" }
|
|
96
|
+
const token = auth.code === 0 ? String(auth.stdout).trim() : ""
|
|
97
|
+
if (token === "") return { ok: false, code: "auth_failed" }
|
|
98
|
+
return { ok: true, reader: githubReader({ runner, token }), issues: (repo) => issuesClient({ runner, repo, token }) }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** `withFields(body, countermeasure, version) -> string | null`: the issue body with its card block's `countermeasure` and `version` lines set (`null` writes the word null); null when the block does not hold exactly one of each. */
|
|
102
|
+
export function withFields(body, countermeasure, version) {
|
|
103
|
+
const lines = String(body).split("\n")
|
|
104
|
+
const find = (name) => lines.reduce((found, line, index) => (line.startsWith(`${name}:`) ? [...found, index] : found), [])
|
|
105
|
+
const at = [find("countermeasure"), find("version")]
|
|
106
|
+
if (at[0].length !== 1 || at[1].length !== 1) return null
|
|
107
|
+
lines[at[0][0]] = `countermeasure: ${countermeasure ?? "null"}`
|
|
108
|
+
lines[at[1][0]] = `version: ${version ?? "null"}`
|
|
109
|
+
return lines.join("\n")
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// A reading is fresh when it was observed no more than MAX_READING_AGE_HOURS ago (and not in the future).
|
|
113
|
+
function isFresh(at, now) {
|
|
114
|
+
const age = new Date(now).getTime() - (typeof at === "string" ? Date.parse(at) : Number.NaN)
|
|
115
|
+
return age >= 0 && age <= MAX_READING_AGE_HOURS * HOUR_MS
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** `reading(status, card, now) -> { kind: "recovered" | "present" | "clearing" | "unavailable" | "none" }`: what the source's own record says about a card's condition. `none` is a source without a recovery signal; a reading older than `MAX_READING_AGE_HOURS` is `unavailable`. */
|
|
119
|
+
export function reading(status, card, now) {
|
|
120
|
+
const id = card.key.slice(card.source.length + 1)
|
|
121
|
+
if (card.source === "reconcile_class") {
|
|
122
|
+
const runs = status?.reconcile?.runs
|
|
123
|
+
if (!isFresh(status?.reconcile?.at, now)) return { kind: "unavailable" }
|
|
124
|
+
const run = isObject(runs) && Object.hasOwn(runs, id) ? runs[id] : undefined
|
|
125
|
+
if (!isObject(run) || !isCount(run.clear) || !isCount(run.consecutive)) return { kind: "unavailable" }
|
|
126
|
+
if (run.clear >= RECONCILE_CLEAR_RUNS) return { kind: "recovered" }
|
|
127
|
+
return { kind: run.consecutive >= RECONCILE_RECURRING_RUNS ? "present" : "clearing" }
|
|
128
|
+
}
|
|
129
|
+
if (!Object.hasOwn(CLEAR_RUNS, card.source)) return { kind: "none" }
|
|
130
|
+
const condition = conditionOf(status, card.key)
|
|
131
|
+
if (condition.state !== "measured" || !isFresh(condition.observed_at, now)) return { kind: "unavailable" }
|
|
132
|
+
if (condition.present) return { kind: "present" }
|
|
133
|
+
return { kind: condition.clear_runs >= CLEAR_RUNS[card.source] ? "recovered" : "clearing" }
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function runVerifyStep(env, {
|
|
137
|
+
deskRoot, personPrefix = "", runner = ghRunner({ env }), now = new Date(),
|
|
138
|
+
shipped = shippedVersion, merged = mergedWithGreenChecks, access = githubAccess,
|
|
139
|
+
writeCardCommitted = writeCardCommittedDefault, readCardsImpl = readCards, readStatusImpl = readStatus,
|
|
140
|
+
armImpl = armKnownHits, recordStepImpl = recordStep,
|
|
141
|
+
}) {
|
|
142
|
+
if (typeof deskRoot !== "string" || !path.isAbsolute(deskRoot)) throw Object.assign(new TypeError("Pass deskRoot as an absolute path"), { code: "improvement_verify_pass_deskroot_as_an_absolute" })
|
|
143
|
+
const nowMs = new Date(now).getTime()
|
|
144
|
+
if (Number.isNaN(nowMs)) throw Object.assign(new TypeError("Pass now as a valid time"), { code: "improvement_verify_pass_now_as_a_valid" })
|
|
145
|
+
const nowIso = new Date(nowMs).toISOString()
|
|
146
|
+
const counts = {}
|
|
147
|
+
const count = (code, n = 1) => { counts[code] = (counts[code] ?? 0) + n }
|
|
148
|
+
if (isHeadlessFactorySession(env)) return { ok: false, result: "headless_session", counts }
|
|
149
|
+
|
|
150
|
+
const finish = async (ok, result) => {
|
|
151
|
+
try {
|
|
152
|
+
await recordStepImpl(env, "verify", { ok, result, now: new Date(nowMs) })
|
|
153
|
+
} catch {
|
|
154
|
+
// the bookkeeping must never turn a finished run into a throw
|
|
155
|
+
}
|
|
156
|
+
return { ok, result, counts }
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
let read
|
|
160
|
+
try {
|
|
161
|
+
read = await readCardsImpl({ deskRoot, personPrefix })
|
|
162
|
+
} catch {
|
|
163
|
+
return finish(false, "cards_unreadable")
|
|
164
|
+
}
|
|
165
|
+
if (read.unreadable === true) return finish(false, "cards_unreadable")
|
|
166
|
+
let status = null
|
|
167
|
+
try {
|
|
168
|
+
status = await readStatusImpl(env)
|
|
169
|
+
} catch {
|
|
170
|
+
// an unreadable status leaves every reading unavailable, which decides nothing
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const isDue = (card) => {
|
|
174
|
+
const last = card.last_check_at === null ? Number.NaN : Date.parse(card.last_check_at)
|
|
175
|
+
const elapsed = nowMs - last
|
|
176
|
+
return Number.isNaN(elapsed) || elapsed < 0 || elapsed >= CHECK_GAP_HOURS * HOUR_MS
|
|
177
|
+
}
|
|
178
|
+
const waitingKinds = read.cards.filter((card) => card.state === "shipped" || card.state === "verifying")
|
|
179
|
+
const due = waitingKinds.filter(isDue).sort((a, b) => (`${a.last_check_at ?? ""} ${a.key}` < `${b.last_check_at ?? ""} ${b.key}` ? -1 : 1))
|
|
180
|
+
const recovered = read.cards
|
|
181
|
+
.filter((card) => (card.state === "open" || card.state === "claimed") && reading(status, card, nowMs).kind === "recovered")
|
|
182
|
+
.sort((a, b) => (a.key < b.key ? -1 : 1))
|
|
183
|
+
// An open or claimed Desk problem whose own GitHub issue is closed has been dealt with: it closes at once, without the quiet days.
|
|
184
|
+
const closedIssueCandidates = read.cards
|
|
185
|
+
.filter((card) => card.source === "desk_problem" && card.kaizen_url === null && (card.state === "open" || card.state === "claimed") && !recovered.includes(card))
|
|
186
|
+
.sort((a, b) => (a.key < b.key ? -1 : 1))
|
|
187
|
+
.slice(0, MAX_CHECKS_PER_RUN)
|
|
188
|
+
const checks = due.slice(0, MAX_CHECKS_PER_RUN)
|
|
189
|
+
const closes = recovered.slice(0, MAX_CHECKS_PER_RUN)
|
|
190
|
+
if (due.length > checks.length) count("deferred", due.length - checks.length)
|
|
191
|
+
if (recovered.length > closes.length) count("deferred", recovered.length - closes.length)
|
|
192
|
+
if (checks.length + closes.length + closedIssueCandidates.length === 0) return finish(true, "nothing_to_verify")
|
|
193
|
+
|
|
194
|
+
let reader = null
|
|
195
|
+
let issues = null
|
|
196
|
+
if (checks.length > 0 || closedIssueCandidates.length > 0 || closes.some((card) => card.kaizen_url !== null)) {
|
|
197
|
+
let granted
|
|
198
|
+
try {
|
|
199
|
+
granted = await access(env, { deskRoot, runner })
|
|
200
|
+
} catch {
|
|
201
|
+
granted = { ok: false, code: "unexpected_error" }
|
|
202
|
+
}
|
|
203
|
+
if (granted.ok !== true) return finish(false, granted.code)
|
|
204
|
+
reader = granted.reader
|
|
205
|
+
issues = granted.issues
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const store = async (card, patch, okCode) => {
|
|
209
|
+
try {
|
|
210
|
+
const written = await writeCardCommitted({
|
|
211
|
+
deskRoot,
|
|
212
|
+
personPrefix,
|
|
213
|
+
write: () => updateCard({ deskRoot, personPrefix, key: card.key, claim_id: card.state === "claimed" ? card.claim.claim_id : undefined, patch, now }),
|
|
214
|
+
message: (outcome) => cardCommitMessage("verify", outcome.file_name),
|
|
215
|
+
})
|
|
216
|
+
if (written.result.result === "updated") {
|
|
217
|
+
if (okCode !== undefined) count(okCode)
|
|
218
|
+
return true
|
|
219
|
+
}
|
|
220
|
+
} catch {
|
|
221
|
+
// counted below
|
|
222
|
+
}
|
|
223
|
+
count("card_write_failed")
|
|
224
|
+
return false
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const issueOf = (card) => {
|
|
228
|
+
const [, repo, number] = ISSUE_URL.exec(card.kaizen_url)
|
|
229
|
+
return { repo, number: Number(number) }
|
|
230
|
+
}
|
|
231
|
+
const readIssue = async (card) => {
|
|
232
|
+
const { repo, number } = issueOf(card)
|
|
233
|
+
const issue = await reader.get(`repos/${repo}/issues/${number}`)
|
|
234
|
+
if (!isObject(issue) || !Array.isArray(issue.labels) || typeof issue.body !== "string") throw new Error("unexpected_answer")
|
|
235
|
+
return { ...issue, names: issue.labels.map((label) => (isObject(label) ? label.name : label)) }
|
|
236
|
+
}
|
|
237
|
+
// Closes the mirror issue, then leaves one fixed comment. The close comes first so that a retry after a failed
|
|
238
|
+
// close can never post a second comment; a missing comment is harmless. An issue already closed gets neither.
|
|
239
|
+
// False when the store refused the close.
|
|
240
|
+
const closeMirror = async (card, comment) => {
|
|
241
|
+
try {
|
|
242
|
+
const { repo, number } = issueOf(card)
|
|
243
|
+
const issue = await readIssue(card)
|
|
244
|
+
if (issue.state === "closed") return true
|
|
245
|
+
const client = issues(repo)
|
|
246
|
+
await client.updateIssue(number, { state: "closed", state_reason: comment === CONFIRMED_COMMENT ? "completed" : "not_planned" })
|
|
247
|
+
try {
|
|
248
|
+
await client.createComment(number, comment)
|
|
249
|
+
} catch {
|
|
250
|
+
count("comment_failed")
|
|
251
|
+
}
|
|
252
|
+
return true
|
|
253
|
+
} catch {
|
|
254
|
+
count("issue_failed")
|
|
255
|
+
return false
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const close = async (card, state, reason) => {
|
|
259
|
+
if (card.kaizen_url !== null && !(await closeMirror(card, state === "closed_confirmed" ? CONFIRMED_COMMENT : UNVERIFIED_COMMENT))) return
|
|
260
|
+
if (await store(card, { state, close_reason: reason })) {
|
|
261
|
+
count(state)
|
|
262
|
+
count(reason)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const reopen = async (card, note, extra = {}) => {
|
|
266
|
+
if (!(await store(card, { state: "open", ...extra }))) return false
|
|
267
|
+
count("reopened")
|
|
268
|
+
count(note)
|
|
269
|
+
if (card.kaizen_url !== null) {
|
|
270
|
+
try {
|
|
271
|
+
const { repo, number } = issueOf(card)
|
|
272
|
+
const issue = await readIssue(card)
|
|
273
|
+
const body = withFields(issue.body, null, null)
|
|
274
|
+
if (body !== null) await issues(repo).updateIssue(number, { body })
|
|
275
|
+
} catch {
|
|
276
|
+
count("issue_failed")
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return true
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// A reading that failed or is absent: the card keeps its state and its count, is stamped so it is looked at
|
|
283
|
+
// once a day, and is counted under one stable code. Only the improvement age alarm surfaces a card that stays so.
|
|
284
|
+
const stamp = async (card, result, code = "unreadable") => {
|
|
285
|
+
await store(card, { last_check_at: nowIso, last_check_result: result }, code)
|
|
286
|
+
}
|
|
287
|
+
// A measured check that decided nothing: the count goes up by one.
|
|
288
|
+
const waiting = async (card, result) => {
|
|
289
|
+
await store(card, { checks_run: card.checks_run + 1, last_check_at: nowIso, last_check_result: result }, result)
|
|
290
|
+
}
|
|
291
|
+
// At the deadline the merge state decides, and only a read one: green closes unverified, not merged reopens, and
|
|
292
|
+
// checks that are not green or not finished (or a merge state that could not be read) wait without advancing.
|
|
293
|
+
const settle = async (card, state, result) => {
|
|
294
|
+
if (state === "unavailable") return stamp(card, "waiting")
|
|
295
|
+
if (state === "merged_not_green") return stamp(card, "checks_not_green", "checks_not_green")
|
|
296
|
+
if (card.checks_run + 1 >= THIN_CHECKS_BEFORE_ESCALATION) {
|
|
297
|
+
if (state === "merged_green") return close(card, "closed_unverified", "thin_data_after_14_checks")
|
|
298
|
+
return reopen(card, "countermeasure_not_merged")
|
|
299
|
+
}
|
|
300
|
+
return waiting(card, result)
|
|
301
|
+
}
|
|
302
|
+
const mergedState = async (card) => (await merged({ countermeasure: card.countermeasure, client: reader })).state
|
|
303
|
+
|
|
304
|
+
// Sets the version on the mirror issue (and clears a stale verdict label) and then on the card.
|
|
305
|
+
const setVersion = async (card, version) => {
|
|
306
|
+
if (!VERSION.test(version)) return stamp(card, "version_unavailable")
|
|
307
|
+
if (card.kaizen_url !== null) {
|
|
308
|
+
try {
|
|
309
|
+
const { repo, number } = issueOf(card)
|
|
310
|
+
const issue = await readIssue(card)
|
|
311
|
+
const body = withFields(issue.body, card.countermeasure, version)
|
|
312
|
+
if (body === null) throw new Error("unrecognised")
|
|
313
|
+
const client = issues(repo)
|
|
314
|
+
if (body !== issue.body) await client.updateIssue(number, { body })
|
|
315
|
+
for (const label of Object.values(VERDICT_LABELS)) if (issue.names.includes(label)) await client.removeLabel(number, label)
|
|
316
|
+
} catch {
|
|
317
|
+
count("issue_failed")
|
|
318
|
+
return stamp(card, "version_unavailable")
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
// The library stamps the time the card entered verification and starts its checks again from zero.
|
|
322
|
+
if (!(await store(card, { state: "verifying", shipped_version: version, last_check_at: nowIso, last_check_result: "version_set" }))) return undefined
|
|
323
|
+
count("version_set")
|
|
324
|
+
if (card.source === "desk_problem" && (await armImpl(env, { now: () => nowMs })).armed !== true) count("known_hits_not_armed")
|
|
325
|
+
return undefined
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const lookup = async (card, immediateNoMeasure) => {
|
|
329
|
+
const found = await shipped({ plugin: card.plugin, countermeasure: card.countermeasure, client: reader })
|
|
330
|
+
if (found.state === "version") return setVersion(card, found.version)
|
|
331
|
+
if (found.state === "not_merged") return settle(card, "not_merged", "countermeasure_not_merged")
|
|
332
|
+
// Not released yet says the pull request merged, not that its checks passed: only at the deadline is the merge state read.
|
|
333
|
+
if (found.state === "not_released_yet") return card.checks_run + 1 < THIN_CHECKS_BEFORE_ESCALATION ? waiting(card, "waiting") : settle(card, await mergedState(card), "waiting")
|
|
334
|
+
if (!NO_MEASURE.has(found.reason)) return stamp(card, "version_unavailable")
|
|
335
|
+
const state = await mergedState(card)
|
|
336
|
+
if (immediateNoMeasure && state === "merged_green") return close(card, "closed_unverified", "version_unavailable")
|
|
337
|
+
return settle(card, state, state === "not_merged" ? "countermeasure_not_merged" : "waiting")
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const verdict = async (card) => {
|
|
341
|
+
let changed = false
|
|
342
|
+
let issue
|
|
343
|
+
try {
|
|
344
|
+
issue = await readIssue(card)
|
|
345
|
+
const body = withFields(issue.body, card.countermeasure, card.shipped_version)
|
|
346
|
+
if (body === null) throw new Error("unrecognised")
|
|
347
|
+
if (body !== issue.body) {
|
|
348
|
+
await issues(issueOf(card).repo).updateIssue(issueOf(card).number, { body })
|
|
349
|
+
changed = true
|
|
350
|
+
}
|
|
351
|
+
} catch {
|
|
352
|
+
count("issue_failed")
|
|
353
|
+
return stamp(card, "waiting")
|
|
354
|
+
}
|
|
355
|
+
// The store has not compared against this version yet, so any label on the issue is older than the body.
|
|
356
|
+
if (changed) return thin(card)
|
|
357
|
+
const confirmed = issue.names.includes(VERDICT_LABELS.confirmed)
|
|
358
|
+
const notConfirmed = issue.names.includes(VERDICT_LABELS.not_confirmed)
|
|
359
|
+
if (confirmed && !notConfirmed) return close(card, "closed_confirmed", "confirmed")
|
|
360
|
+
if (notConfirmed && !confirmed) {
|
|
361
|
+
const { repo, number } = issueOf(card)
|
|
362
|
+
return reopen(card, "not_confirmed", { evidence: [...new Set([...card.evidence, `issue:${repo}#${number}`])].slice(-10) })
|
|
363
|
+
}
|
|
364
|
+
return thin(card)
|
|
365
|
+
}
|
|
366
|
+
// Measured thin data: the 14th such check decides by the merge state.
|
|
367
|
+
const thin = async (card) => {
|
|
368
|
+
if (card.checks_run + 1 < THIN_CHECKS_BEFORE_ESCALATION) return waiting(card, "thin_data")
|
|
369
|
+
return settle(card, await mergedState(card), "thin_data")
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const deskProblem = async (card) => {
|
|
373
|
+
const number = Number(card.key.slice(card.source.length + 1).split("#")[1])
|
|
374
|
+
const since = new Date(nowMs - DESK_PROBLEM_QUIET_DAYS * DAY_MS)
|
|
375
|
+
const hits = knownHitsSince(status, number, card.shipped_version, { since, launches: pendingLaunchTimes(env) })
|
|
376
|
+
if (hits.state === "measured" && hits.hit) return reopen(card, "still_recurring")
|
|
377
|
+
const condition = conditionOf(status, card.key)
|
|
378
|
+
if (condition.state !== "measured" || !isFresh(condition.observed_at, nowMs)) return stamp(card, "waiting")
|
|
379
|
+
if (condition.present) return card.checks_run + 1 >= RECURRING_VERIFYING_CHECKS ? reopen(card, "still_recurring") : waiting(card, "waiting")
|
|
380
|
+
const quiet = Date.parse(card.verifying_since) <= since.getTime()
|
|
381
|
+
if (condition.clear_runs >= 1 && quiet) return close(card, hits.state === "measured" ? "closed_confirmed" : "closed_unverified", "desk_problem_quiet")
|
|
382
|
+
return waiting(card, "waiting")
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const recovery = async (card) => {
|
|
386
|
+
const seen = reading(status, card, nowMs)
|
|
387
|
+
if (seen.kind === "recovered") return close(card, "closed_confirmed", RECOVERY_REASON[card.source])
|
|
388
|
+
if (card.state === "shipped") return lookup(card, false)
|
|
389
|
+
if (seen.kind === "unavailable") return stamp(card, "waiting")
|
|
390
|
+
if (seen.kind === "present" && card.checks_run + 1 >= RECURRING_VERIFYING_CHECKS) return reopen(card, "still_recurring")
|
|
391
|
+
return waiting(card, "waiting")
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const check = async (card) => {
|
|
395
|
+
// A card with a mirror issue is decided by the store's verdict, not by its source's recovery signal.
|
|
396
|
+
if (card.kaizen_url !== null && card.state === "verifying") return verdict(card)
|
|
397
|
+
if (card.source === "desk_problem" && card.kaizen_url === null) return card.state === "verifying" ? deskProblem(card) : lookup(card, false)
|
|
398
|
+
if (Object.hasOwn(CLEAR_RUNS, card.source) || card.source === "reconcile_class") {
|
|
399
|
+
if (card.kaizen_url === null) return recovery(card)
|
|
400
|
+
return lookup(card, false)
|
|
401
|
+
}
|
|
402
|
+
if (card.source === "friction_candidate" && card.signal === null && card.kaizen_url === null) {
|
|
403
|
+
const state = await mergedState(card)
|
|
404
|
+
if (state === "merged_green") return close(card, "closed_unverified", "merged_without_signal")
|
|
405
|
+
return settle(card, state, state === "not_merged" ? "countermeasure_not_merged" : "waiting")
|
|
406
|
+
}
|
|
407
|
+
return card.state === "shipped" ? lookup(card, true) : waiting(card, "waiting")
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
for (const card of closes) await close(card, "closed_unverified", "source_recovered")
|
|
411
|
+
for (const card of closedIssueCandidates) {
|
|
412
|
+
try {
|
|
413
|
+
const pointer = card.evidence.map((item) => /^issue:([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#([1-9]\d{0,8})$/u.exec(item)).find(Boolean)
|
|
414
|
+
if (pointer === undefined) continue
|
|
415
|
+
const issue = await reader.get(`repos/${pointer[1]}/issues/${pointer[2]}`)
|
|
416
|
+
if (isObject(issue) && issue.state === "closed") await close(card, "closed_unverified", "source_recovered")
|
|
417
|
+
} catch {
|
|
418
|
+
count("issue_failed")
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
for (const card of checks) {
|
|
422
|
+
try {
|
|
423
|
+
await check(card)
|
|
424
|
+
} catch {
|
|
425
|
+
count("unexpected_error")
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return finish(true, "verified")
|
|
429
|
+
}
|