@ouro.bot/cli 0.1.0-alpha.15 → 0.1.0-alpha.1500
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/LICENSE +21 -0
- package/README.md +281 -171
- package/RepairGuide.ouro/agent.json +5 -0
- package/RepairGuide.ouro/psyche/IDENTITY.md +19 -0
- package/RepairGuide.ouro/psyche/SOUL.md +55 -0
- package/RepairGuide.ouro/skills/diagnose-broken-remote.md +63 -0
- package/RepairGuide.ouro/skills/diagnose-stacked-typed-issues.md +35 -0
- package/RepairGuide.ouro/skills/diagnose-sync-blocked.md +54 -0
- package/RepairGuide.ouro/skills/diagnose-vault-expired.md +60 -0
- package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/agent.json +4 -2
- package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/SOUL.md +4 -4
- package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/monty.md +2 -2
- package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/the-serpent.md +1 -1
- package/assets/bluebubbles-host +264 -0
- package/assets/sanctuary-host-launcher.sh +16 -0
- package/changelog.json +9728 -0
- package/deploy/unraid/Dockerfile +85 -0
- package/deploy/unraid/INSTALL.md +64 -0
- package/deploy/unraid/README.txt +3034 -0
- package/deploy/unraid/audit-container-spec.sh +4 -0
- package/deploy/unraid/container-runtime.json +1 -0
- package/deploy/unraid/credit-gateway.md +95 -0
- package/deploy/unraid/docker-man-template-transaction.mjs +733 -0
- package/deploy/unraid/docker-man-template-xml.cjs +105 -0
- package/deploy/unraid/github_known_hosts +3 -0
- package/deploy/unraid/install.sh +274 -0
- package/deploy/unraid/migrate-sanctuary-bundle.mjs +63 -0
- package/deploy/unraid/ouro-events/bootstrap-spool.sh +92 -0
- package/deploy/unraid/ouro-events/emit-event.mjs +310 -0
- package/deploy/unraid/ouro-events/emit-usenet-event.sh +54 -0
- package/deploy/unraid/ouro-events/install-usenet-guard.sh +435 -0
- package/deploy/unraid/ouro-events/usenet-health.sh +176 -0
- package/deploy/unraid/ouro-host-lock.mjs +207 -0
- package/deploy/unraid/ouro-sync-ssh +98 -0
- package/deploy/unraid/ouro-sync.sudoers +3 -0
- package/deploy/unraid/sanctuary-acceptance-adapter.sh +43 -0
- package/deploy/unraid/sanctuary-acceptance-contract.json +198 -0
- package/deploy/unraid/sanctuary-acceptance-harness.sh +23 -0
- package/deploy/unraid/sanctuary-authority-installation.json +36 -0
- package/deploy/unraid/sanctuary-authority-service.sh +30 -0
- package/deploy/unraid/sanctuary-butler-upgrade.mjs +1604 -0
- package/deploy/unraid/sanctuary-deployment-target.mjs +710 -0
- package/deploy/unraid/sanctuary-replay-gate.mjs +2781 -0
- package/deploy/unraid/sanctuary-safe-rename.py +24 -0
- package/deploy/unraid/sanctuary-sync-cutover.sh +1039 -0
- package/deploy/unraid/sanctuary-unit16-host-broker.mjs +2088 -0
- package/deploy/unraid/sanctuary-unit16-run.sh +570 -0
- package/deploy/unraid/sanctuary-unit18-target-audit.sh +27 -0
- package/deploy/unraid/sanctuary.ouro/agent.json +73 -0
- package/deploy/unraid/sanctuary.ouro/arc/README.md +3 -0
- package/deploy/unraid/sanctuary.ouro/awaiting/house-care-sweep.md +17 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +5 -0
- package/deploy/unraid/sanctuary.ouro/habits/sanctuary-health.md +8 -0
- package/deploy/unraid/sanctuary.ouro/mcp/media-mcp.mjs +2533 -0
- package/deploy/unraid/sanctuary.ouro/product/PRODUCT.md +13 -0
- package/deploy/unraid/sanctuary.ouro/provider-readiness.json +11 -0
- package/deploy/unraid/sanctuary.ouro/psyche/ASPIRATIONS.md +5 -0
- package/deploy/unraid/sanctuary.ouro/psyche/IDENTITY.md +7 -0
- package/deploy/unraid/sanctuary.ouro/psyche/LORE.md +7 -0
- package/deploy/unraid/sanctuary.ouro/psyche/SOUL.md +15 -0
- package/deploy/unraid/sanctuary.ouro/psyche/TACIT.md +3 -0
- package/deploy/unraid/sanctuary.ouro/state/policy/steward.json +7 -0
- package/deploy/unraid/sanctuary.ouro/tool-profiles.json +274 -0
- package/deploy/unraid/sanctuary.xml +30 -0
- package/desk.lock.json +8 -0
- package/dist/a2a/approval-relay-forward.js +117 -0
- package/dist/a2a/approval-relay.js +95 -0
- package/dist/a2a/approval-request-wire.js +123 -0
- package/dist/a2a/card.js +57 -0
- package/dist/a2a/client.js +331 -0
- package/dist/a2a/config.js +50 -0
- package/dist/a2a/delegated-command-grants.js +93 -0
- package/dist/a2a/delegated-command.js +200 -0
- package/dist/a2a/delegation-stores.js +56 -0
- package/dist/a2a/did-resolution.js +205 -0
- package/dist/a2a/escalation-grants.js +84 -0
- package/dist/a2a/escalation-wiring.js +60 -0
- package/dist/a2a/identity.js +258 -0
- package/dist/a2a/inbound-share.js +131 -0
- package/dist/a2a/mission-result-wire.js +265 -0
- package/dist/a2a/onboarding.js +133 -0
- package/dist/a2a/operator-trust.js +399 -0
- package/dist/a2a/outbox-client.js +59 -0
- package/dist/a2a/outbox-store.js +245 -0
- package/dist/a2a/outbox-wire.js +106 -0
- package/dist/a2a/pin-store.js +167 -0
- package/dist/a2a/refusals.js +55 -0
- package/dist/a2a/relay-client.js +106 -0
- package/dist/a2a/relay-config-vault.js +64 -0
- package/dist/a2a/relay-contacts.js +120 -0
- package/dist/a2a/relay-inbox.js +360 -0
- package/dist/a2a/relay-retirements.js +89 -0
- package/dist/a2a/replay-grant-holders.js +33 -0
- package/dist/a2a/replay-harness.js +188 -0
- package/dist/a2a/resolution-proof.js +53 -0
- package/dist/a2a/sealed-chat.js +142 -0
- package/dist/a2a/seen-ledger.js +216 -0
- package/dist/a2a/server.js +1088 -0
- package/dist/a2a/task-store.js +69 -0
- package/dist/a2a/transport.js +100 -0
- package/dist/a2a/trust-commands.js +203 -0
- package/dist/a2a/trusted-files.js +185 -0
- package/dist/a2a/types.js +3 -0
- package/dist/actions/generated/mailbox/actions.json +41 -0
- package/dist/actions/generated/mailbox/commands.json +15 -0
- package/dist/actions/generated/mailbox/mcp.json +46 -0
- package/dist/actions/generated/mailbox-tools/tools.json +35 -0
- package/dist/arc/attention-types.js +8 -0
- package/dist/arc/cares.js +360 -0
- package/dist/arc/episodes.js +118 -0
- package/dist/arc/evolution.js +490 -0
- package/dist/arc/flight-recorder.js +1030 -0
- package/dist/arc/intentions.js +134 -0
- package/dist/arc/json-store.js +117 -0
- package/dist/arc/obligations.js +386 -0
- package/dist/arc/packets.js +336 -0
- package/dist/arc/presence.js +185 -0
- package/dist/arc/task-lifecycle.js +57 -0
- package/dist/commerce/store.js +755 -0
- package/dist/commerce/types.js +3 -0
- package/dist/eval/assertions/index.js +378 -0
- package/dist/eval/budget.js +135 -0
- package/dist/eval/domain/case.js +115 -0
- package/dist/eval/domain/stats.js +19 -0
- package/dist/eval/guest-entry.js +18 -0
- package/dist/eval/h-guest-entry.js +19 -0
- package/dist/eval/interview-entry.js +169 -0
- package/dist/eval/interview-grade-entry.js +36 -0
- package/dist/eval/interview-guest-entry.js +19 -0
- package/dist/eval/interviews/allocation.js +90 -0
- package/dist/eval/interviews/final.js +133 -0
- package/dist/eval/interviews/grader.js +196 -0
- package/dist/eval/interviews/guest/arms.js +173 -0
- package/dist/eval/interviews/guest/ax/ax-command.js +792 -0
- package/dist/eval/interviews/guest/ax/effects.js +51 -0
- package/dist/eval/interviews/guest/ax/exit-codes.js +51 -0
- package/dist/eval/interviews/guest/ax/help.js +181 -0
- package/dist/eval/interviews/guest/ax/mcp.js +246 -0
- package/dist/eval/interviews/guest/ax/outcome.js +211 -0
- package/dist/eval/interviews/guest/ax/output.js +53 -0
- package/dist/eval/interviews/guest/ax/precise-copy.js +200 -0
- package/dist/eval/interviews/guest/ax/problem.js +95 -0
- package/dist/eval/interviews/guest/ax/voice.js +83 -0
- package/dist/eval/interviews/guest/ax/wait.js +158 -0
- package/dist/eval/interviews/guest/books-core.js +54 -0
- package/dist/eval/interviews/guest/cli-shell.js +267 -0
- package/dist/eval/interviews/guest/h/run.js +60 -0
- package/dist/eval/interviews/guest/loop.js +87 -0
- package/dist/eval/interviews/guest/operations.js +108 -0
- package/dist/eval/interviews/guest/run.js +81 -0
- package/dist/eval/interviews/guest/u/arms.js +266 -0
- package/dist/eval/interviews/latch.js +134 -0
- package/dist/eval/interviews/protocol.js +77 -0
- package/dist/eval/interviews/rewrite.js +49 -0
- package/dist/eval/interviews/runner.js +340 -0
- package/dist/eval/interviews/u/kit.js +83 -0
- package/dist/eval/readback/hedges.js +39 -0
- package/dist/eval/remote-entry.js +32 -0
- package/dist/eval/report.js +85 -0
- package/dist/eval/run-command.js +161 -0
- package/dist/eval/run-entry.js +89 -0
- package/dist/eval/sandbox/agent-profile.js +74 -0
- package/dist/eval/sandbox/declared-gaps.js +17 -0
- package/dist/eval/sandbox/docker.js +353 -0
- package/dist/eval/sandbox/guest.js +55 -0
- package/dist/eval/sandbox/host-lock.js +62 -0
- package/dist/eval/sandbox/images.js +39 -0
- package/dist/eval/sandbox/oracle.js +32 -0
- package/dist/eval/sandbox/projection.js +127 -0
- package/dist/eval/sandbox/readback.js +137 -0
- package/dist/eval/sandbox/remote.js +102 -0
- package/dist/eval/self-test.js +84 -0
- package/dist/eval/targets/index.js +127 -0
- package/dist/eval/transport/provider-proxy.js +262 -0
- package/dist/eval/transport/synthetic-sanctuary.js +111 -0
- package/dist/eval/transport/telegram-turn.js +241 -0
- package/dist/eval/watch/cli.js +55 -0
- package/dist/eval/watch/guarded-fs.js +254 -0
- package/dist/eval/watch/log-reader.js +99 -0
- package/dist/eval/watch/rows.js +143 -0
- package/dist/eval/watch/run-watch.js +160 -0
- package/dist/eval/watch-entry.js +26 -0
- package/dist/gateway/keys.js +117 -0
- package/dist/gateway/server.js +429 -0
- package/dist/heart/active-work.js +1009 -0
- package/dist/heart/agent-entry.js +255 -4
- package/dist/heart/approval-files.js +94 -0
- package/dist/heart/approval-store.js +1000 -0
- package/dist/heart/atomic-file.js +115 -0
- package/dist/heart/attachments/downloaded-store.js +89 -0
- package/dist/heart/attachments/image-normalize.js +201 -0
- package/dist/heart/attachments/materialize.js +97 -0
- package/dist/heart/attachments/originals.js +102 -0
- package/dist/heart/attachments/render.js +29 -0
- package/dist/heart/attachments/sources/bluebubbles.js +155 -0
- package/dist/heart/attachments/sources/cli-local-file.js +78 -0
- package/dist/heart/attachments/sources/downloaded.js +76 -0
- package/dist/heart/attachments/sources/index.js +19 -0
- package/dist/heart/attachments/store.js +132 -0
- package/dist/heart/attachments/transcribe-audio.js +231 -0
- package/dist/heart/attachments/types.js +93 -0
- package/dist/heart/attachments/understand.js +195 -0
- package/dist/heart/auth/auth-flow.js +590 -0
- package/dist/heart/auth/github-device-login.js +104 -0
- package/dist/heart/autonomy-budget.js +478 -0
- package/dist/heart/awaiting/a2a-await-delivery.js +109 -0
- package/dist/heart/awaiting/await-alert.js +152 -0
- package/dist/heart/awaiting/await-expiry.js +143 -0
- package/dist/heart/awaiting/await-loader.js +91 -0
- package/dist/heart/awaiting/await-parser.js +152 -0
- package/dist/heart/awaiting/await-runtime-state.js +130 -0
- package/dist/heart/awaiting/await-scheduler.js +462 -0
- package/dist/heart/background-operations.js +281 -0
- package/dist/heart/bluebubbles-host-account.js +78 -0
- package/dist/heart/bridges/manager.js +478 -0
- package/dist/heart/bridges/state-machine.js +135 -0
- package/dist/heart/bridges/store.js +135 -0
- package/dist/heart/bundle-state.js +168 -0
- package/dist/heart/chat-interaction.js +69 -0
- package/dist/heart/commitments.js +135 -0
- package/dist/heart/config-registry.js +340 -0
- package/dist/heart/config.js +240 -144
- package/dist/heart/context-loss-gauntlet.js +387 -0
- package/dist/heart/context-loss-sentinel.js +1200 -0
- package/dist/heart/core.js +2960 -343
- package/dist/heart/cross-chat-delivery.js +153 -0
- package/dist/heart/daemon/agent-config-check.js +494 -0
- package/dist/heart/daemon/agent-discovery.js +382 -0
- package/dist/heart/daemon/agent-home.js +409 -0
- package/dist/heart/daemon/agent-service.js +542 -0
- package/dist/heart/daemon/agentic-repair.js +548 -0
- package/dist/heart/daemon/await-private-wake.js +59 -0
- package/dist/heart/daemon/bluebubbles-cli-integration.js +71 -0
- package/dist/heart/daemon/bluebubbles-health-diagnostics.js +122 -0
- package/dist/heart/daemon/bluebubbles-host-protocol.js +433 -0
- package/dist/heart/daemon/bluebubbles-host.js +273 -0
- package/dist/heart/daemon/boot-sync-probe.js +223 -0
- package/dist/heart/daemon/cadence.js +180 -0
- package/dist/heart/daemon/cli-arg-redaction.js +26 -0
- package/dist/heart/daemon/cli-commands/a2a.js +26 -0
- package/dist/heart/daemon/cli-commands/cards.js +68 -0
- package/dist/heart/daemon/cli-commands/coding-tools.js +13 -0
- package/dist/heart/daemon/cli-commands/desk.js +43 -0
- package/dist/heart/daemon/cli-commands/dns.js +13 -0
- package/dist/heart/daemon/cli-commands/entry-points.js +176 -0
- package/dist/heart/daemon/cli-commands/failure-code.js +11 -0
- package/dist/heart/daemon/cli-commands/friends.js +18 -0
- package/dist/heart/daemon/cli-commands/habits.js +15 -0
- package/dist/heart/daemon/cli-commands/lifecycle.js +42 -0
- package/dist/heart/daemon/cli-commands/mail.js +11 -0
- package/dist/heart/daemon/cli-commands/mind.js +25 -0
- package/dist/heart/daemon/cli-commands/presence.js +28 -0
- package/dist/heart/daemon/cli-commands/providers.js +20 -0
- package/dist/heart/daemon/cli-commands/rsvp.js +20 -0
- package/dist/heart/daemon/cli-commands/shepherd.js +17 -0
- package/dist/heart/daemon/cli-commands/vault.js +23 -0
- package/dist/heart/daemon/cli-defaults.js +997 -0
- package/dist/heart/daemon/cli-desk.js +346 -0
- package/dist/heart/daemon/cli-exec.js +9672 -0
- package/dist/heart/daemon/cli-gate.js +198 -0
- package/dist/heart/daemon/cli-help.js +800 -0
- package/dist/heart/daemon/cli-manifest.js +115 -0
- package/dist/heart/daemon/cli-parse.js +3623 -0
- package/dist/heart/daemon/cli-render-doctor.js +57 -0
- package/dist/heart/daemon/cli-render.js +816 -0
- package/dist/heart/daemon/cli-types.js +8 -0
- package/dist/heart/daemon/compile-cache.js +69 -0
- package/dist/heart/daemon/connect-bay.js +323 -0
- package/dist/heart/daemon/container-credential-bootstrap.js +273 -0
- package/dist/heart/daemon/container-healthcheck.js +123 -0
- package/dist/heart/daemon/container-runtime.js +97 -0
- package/dist/heart/daemon/container-spec-auditor-main.js +187 -0
- package/dist/heart/daemon/container-spec-auditor.js +261 -0
- package/dist/heart/daemon/daemon-bootstrap-startup.js +115 -0
- package/dist/heart/daemon/daemon-cli.js +30 -1050
- package/dist/heart/daemon/daemon-entry.js +1166 -12
- package/dist/heart/daemon/daemon-health.js +186 -0
- package/dist/heart/daemon/daemon-rollup.js +57 -0
- package/dist/heart/daemon/daemon-runtime-sync.js +346 -0
- package/dist/heart/daemon/daemon-tombstone.js +236 -0
- package/dist/heart/daemon/daemon.js +2253 -40
- package/dist/heart/daemon/desk-admin.js +420 -0
- package/dist/heart/daemon/dns-workflow.js +394 -0
- package/dist/heart/daemon/doctor-types.js +8 -0
- package/dist/heart/daemon/doctor.js +1890 -0
- package/dist/heart/daemon/freshness.js +345 -0
- package/dist/heart/daemon/habit-private-wake.js +61 -0
- package/dist/heart/daemon/health-monitor.js +209 -12
- package/dist/heart/daemon/home-filesystem.js +93 -0
- package/dist/heart/daemon/hook-post-tool-use.js +149 -0
- package/dist/heart/daemon/hooks/agent-config-v2.js +33 -0
- package/dist/heart/daemon/hooks/bundle-meta.js +226 -0
- package/dist/heart/daemon/http-health-probe.js +80 -0
- package/dist/heart/daemon/human-command-screens.js +234 -0
- package/dist/heart/daemon/human-readiness.js +114 -0
- package/dist/heart/daemon/inner-status.js +78 -0
- package/dist/heart/daemon/interactive-repair.js +394 -0
- package/dist/heart/daemon/launchd.js +191 -0
- package/dist/heart/daemon/linux-service.js +382 -0
- package/dist/heart/daemon/log-tailer.js +82 -12
- package/dist/heart/daemon/logs-prune.js +132 -0
- package/dist/heart/daemon/mcp-canary.js +525 -0
- package/dist/heart/daemon/message-router.js +80 -11
- package/dist/heart/daemon/migrate-to-desk.js +848 -0
- package/dist/heart/daemon/os-cron-deps.js +139 -0
- package/dist/heart/daemon/os-cron.js +45 -15
- package/dist/heart/daemon/ouro-bot-entry.js +8 -3
- package/dist/heart/daemon/ouro-cli-main.js +50 -0
- package/dist/heart/daemon/ouro-entry.js +43 -20
- package/dist/heart/daemon/plugin-cli.js +432 -0
- package/dist/heart/daemon/portable-git-install.js +265 -0
- package/dist/heart/daemon/portable-git.js +179 -0
- package/dist/heart/daemon/presence-daemon.js +265 -0
- package/dist/heart/daemon/presence-roster.js +259 -0
- package/dist/heart/daemon/presence.js +462 -0
- package/dist/heart/daemon/process-manager.js +847 -53
- package/dist/heart/daemon/process-tree.js +109 -0
- package/dist/heart/daemon/provider-discovery.js +171 -0
- package/dist/heart/daemon/provider-ping-progress.js +83 -0
- package/dist/heart/daemon/prunable-bundle.js +144 -0
- package/dist/heart/daemon/pulse.js +511 -0
- package/dist/heart/daemon/readiness-repair.js +365 -0
- package/dist/heart/daemon/run-hooks.js +39 -0
- package/dist/heart/daemon/runtime-logging.js +99 -16
- package/dist/heart/daemon/runtime-metadata.js +191 -0
- package/dist/{repertoire/tasks/lifecycle.js → heart/daemon/runtime-mode.js} +37 -39
- package/dist/heart/daemon/runtime-replacement-handoff.js +207 -0
- package/dist/heart/daemon/safe-mode.js +161 -0
- package/dist/heart/daemon/sanctuary-acceptance-adapter.js +2659 -0
- package/dist/heart/daemon/sanctuary-acceptance-harness.js +1832 -0
- package/dist/heart/daemon/sanctuary-acceptance-marker.js +267 -0
- package/dist/heart/daemon/sanctuary-acceptance-scenarios.js +956 -0
- package/dist/heart/daemon/sanctuary-authority-codec.js +86 -0
- package/dist/heart/daemon/sanctuary-authority-epoch.js +291 -0
- package/dist/heart/daemon/sanctuary-authority-installation.js +161 -0
- package/dist/heart/daemon/sanctuary-authority-ledger.js +241 -0
- package/dist/heart/daemon/sanctuary-authority-root-lifecycle.js +1370 -0
- package/dist/heart/daemon/sanctuary-authority-vault-migration.js +79 -0
- package/dist/heart/daemon/sanctuary-bundle-migration.js +974 -0
- package/dist/heart/daemon/sanctuary-host-authority.js +1008 -0
- package/dist/heart/daemon/sanctuary-host-detached-supervisor.js +493 -0
- package/dist/heart/daemon/sanctuary-host-executor.js +670 -0
- package/dist/heart/daemon/sanctuary-host-linux-kernel.js +334 -0
- package/dist/heart/daemon/sanctuary-host-supervisor-entry.js +210 -0
- package/dist/heart/daemon/sanctuary-host-supervisor.js +95 -0
- package/dist/heart/daemon/sanctuary-package-management.js +113 -0
- package/dist/heart/daemon/sanctuary-scheduler-liveness.js +227 -0
- package/dist/heart/daemon/sanctuary-scheduler-origin.js +132 -0
- package/dist/heart/daemon/sanctuary-telegram-authority-entry.js +481 -0
- package/dist/heart/daemon/sanctuary-telegram-authority-gateway.js +614 -0
- package/dist/heart/daemon/sanctuary-telegram-authority-service.js +763 -0
- package/dist/heart/daemon/sanctuary-telegram-test-driver-entry.js +97 -0
- package/dist/heart/daemon/sanctuary-telegram-test-driver.js +294 -0
- package/dist/heart/daemon/sense-manager.js +1108 -49
- package/dist/heart/daemon/session-id-resolver.js +131 -0
- package/dist/heart/daemon/skill-management-installer.js +94 -0
- package/dist/heart/daemon/socket-client.js +370 -0
- package/dist/heart/daemon/stale-bundle-prune.js +113 -0
- package/dist/heart/daemon/startup-tui.js +339 -0
- package/dist/heart/daemon/state-retention.js +222 -0
- package/dist/heart/daemon/supercronic-supervisor.js +282 -0
- package/dist/heart/daemon/task-scheduler.js +117 -39
- package/dist/heart/daemon/terminal-ui.js +503 -0
- package/dist/heart/daemon/thoughts.js +591 -0
- package/dist/heart/daemon/up-progress.js +366 -0
- package/dist/heart/daemon/vault-items.js +56 -0
- package/dist/heart/daemon/vault-outage.js +74 -0
- package/dist/heart/delegated-work-report.js +115 -0
- package/dist/heart/delegation.js +59 -0
- package/dist/heart/external-events/router.js +1556 -0
- package/dist/heart/failure-reports.js +398 -0
- package/dist/heart/file-lock.js +109 -0
- package/dist/heart/frontend-approval-runtime.js +506 -0
- package/dist/heart/frontend-journal.js +215 -0
- package/dist/heart/frontend-session-service.js +330 -0
- package/dist/heart/frontend-socket-client.js +173 -0
- package/dist/heart/frontend-socket.js +434 -0
- package/dist/heart/frontend-turn-errors.js +20 -0
- package/dist/heart/habits/habit-cancel.js +810 -0
- package/dist/heart/habits/habit-lifecycle.js +1324 -0
- package/dist/heart/habits/habit-migration.js +194 -0
- package/dist/heart/habits/habit-parser.js +278 -0
- package/dist/heart/habits/habit-runtime-state.js +93 -0
- package/dist/heart/habits/habit-scheduler.js +667 -0
- package/dist/heart/habits/habit-session-summary.js +318 -0
- package/dist/heart/habits/habit-session.js +643 -0
- package/dist/heart/{daemon → hatch}/hatch-animation.js +10 -3
- package/dist/heart/{daemon → hatch}/hatch-flow.js +70 -129
- package/dist/heart/{daemon → hatch}/hatch-specialist.js +6 -8
- package/dist/heart/{daemon → hatch}/specialist-orchestrator.js +2 -2
- package/dist/heart/{daemon → hatch}/specialist-prompt.js +18 -11
- package/dist/heart/hatch/specialist-tools.js +395 -0
- package/dist/heart/identity.js +441 -69
- package/dist/heart/kept-notes.js +289 -0
- package/dist/heart/kicks.js +2 -20
- package/dist/heart/letters/doors-tools.js +31 -0
- package/dist/heart/letters/doors.js +226 -0
- package/dist/heart/machine-identity.js +175 -0
- package/dist/heart/mail-import-discovery.js +356 -0
- package/dist/heart/mcp/mcp-server.js +893 -0
- package/dist/heart/migrate-config.js +100 -0
- package/dist/heart/model-capabilities.js +130 -0
- package/dist/heart/model-limits.js +49 -0
- package/dist/heart/optional-packages.js +77 -0
- package/dist/heart/orientation-frame.js +393 -0
- package/dist/heart/platform.js +81 -0
- package/dist/heart/primitives.js +1 -1
- package/dist/heart/private-runtime/decision-renderer.js +158 -0
- package/dist/heart/private-runtime/index.js +18 -0
- package/dist/heart/private-runtime/ledger.js +212 -0
- package/dist/heart/private-runtime/policy.js +303 -0
- package/dist/heart/private-runtime/types.js +2 -0
- package/dist/heart/progress-story.js +42 -0
- package/dist/heart/provider-attempt.js +137 -0
- package/dist/heart/provider-binding-resolver.js +273 -0
- package/dist/heart/provider-credentials.js +449 -0
- package/dist/heart/provider-failover.js +311 -0
- package/dist/heart/provider-fallback.js +228 -0
- package/dist/heart/provider-models.js +96 -0
- package/dist/heart/provider-ping-child.js +125 -0
- package/dist/heart/provider-ping-entry.js +8 -0
- package/dist/heart/provider-ping.js +298 -0
- package/dist/heart/provider-readiness-cache.js +119 -0
- package/dist/heart/provider-visibility.js +188 -0
- package/dist/heart/providers/account-pool.js +717 -0
- package/dist/heart/providers/anthropic-token.js +131 -0
- package/dist/heart/providers/anthropic.js +431 -75
- package/dist/heart/providers/azure.js +107 -13
- package/dist/heart/providers/error-classification.js +129 -0
- package/dist/heart/providers/github-copilot.js +252 -0
- package/dist/heart/providers/minimax-vlm.js +189 -0
- package/dist/heart/providers/minimax.js +29 -7
- package/dist/heart/providers/openai-codex-token.js +349 -0
- package/dist/heart/providers/openai-codex.js +63 -39
- package/dist/heart/providers/openai-compatible.js +177 -0
- package/dist/heart/quota/fleet-readings.js +222 -0
- package/dist/heart/quota/tranche.js +59 -0
- package/dist/heart/reach-channel.js +85 -0
- package/dist/heart/reply-style.js +52 -0
- package/dist/heart/run-ledger.js +247 -0
- package/dist/heart/runtime-capability-check.js +170 -0
- package/dist/heart/runtime-credentials.js +647 -0
- package/dist/heart/runtime-cwd.js +87 -0
- package/dist/heart/sense-truth.js +26 -4
- package/dist/heart/sent-message-ledger.js +98 -0
- package/dist/heart/session-activity.js +239 -0
- package/dist/heart/session-events.js +1602 -0
- package/dist/heart/session-playback-cli-main.js +10 -0
- package/dist/heart/session-playback-cli.js +36 -0
- package/dist/heart/session-playback.js +231 -0
- package/dist/heart/session-redaction-repair-cli-main.js +34 -0
- package/dist/heart/session-redaction-repair.js +552 -0
- package/dist/heart/session-stats-cli-main.js +10 -0
- package/dist/heart/session-stats.js +183 -0
- package/dist/heart/session-transcript.js +133 -0
- package/dist/heart/shelf-claims.js +136 -0
- package/dist/heart/shepherd/custody-types.js +2 -0
- package/dist/heart/shepherd/mandates.js +352 -0
- package/dist/heart/shepherd/operation-commands.js +19 -0
- package/dist/heart/shepherd/operations.js +139 -0
- package/dist/heart/shepherd/supervision-read.js +131 -0
- package/dist/heart/shepherd/supervision.js +114 -0
- package/dist/heart/shepherd/types.js +2 -0
- package/dist/heart/shepherd-config.js +113 -0
- package/dist/heart/source-grounding.js +313 -0
- package/dist/heart/sqlite.js +18 -0
- package/dist/heart/start-of-turn-packet.js +372 -0
- package/dist/heart/steward-policy.js +656 -0
- package/dist/heart/streaming.js +724 -207
- package/dist/heart/structured-output.js +196 -0
- package/dist/heart/sync-classification.js +176 -0
- package/dist/heart/sync-health.js +152 -0
- package/dist/heart/sync-lock.js +431 -0
- package/dist/heart/sync.js +1580 -0
- package/dist/heart/target-resolution.js +127 -0
- package/dist/heart/tempo.js +93 -0
- package/dist/heart/temporal-view.js +41 -0
- package/dist/heart/termination-guard.js +27 -0
- package/dist/heart/timeouts.js +101 -0
- package/dist/heart/tool-activity-callbacks.js +59 -0
- package/dist/heart/tool-approval.js +382 -0
- package/dist/heart/tool-description.js +155 -0
- package/dist/heart/tool-friction.js +55 -0
- package/dist/heart/tool-images.js +42 -0
- package/dist/heart/tool-loop.js +206 -0
- package/dist/heart/tool-output-budget.js +41 -0
- package/dist/heart/turn-context.js +503 -0
- package/dist/heart/turn-coordinator.js +28 -0
- package/dist/heart/turn-execution-lease.js +78 -0
- package/dist/heart/turn-summary.js +216 -0
- package/dist/heart/versioning/host-self-update.js +118 -0
- package/dist/heart/versioning/ouro-bot-global-installer.js +129 -0
- package/dist/heart/{daemon → versioning}/ouro-bot-wrapper.js +3 -2
- package/dist/heart/versioning/ouro-path-installer.js +432 -0
- package/dist/heart/versioning/ouro-recovery-launcher.js +98 -0
- package/dist/heart/versioning/ouro-version-manager.js +432 -0
- package/dist/heart/versioning/release-sources.js +185 -0
- package/dist/heart/versioning/self-update-defaults.js +443 -0
- package/dist/heart/versioning/self-update.js +270 -0
- package/dist/heart/versioning/staged-restart.js +146 -0
- package/dist/heart/versioning/update-checker.js +88 -0
- package/dist/heart/versioning/update-hooks.js +160 -0
- package/dist/heart/versioning/update-state.js +134 -0
- package/dist/heart/versioning/updater-launchd.js +204 -0
- package/dist/heart/versioning/version-intent.js +114 -0
- package/dist/heart/versioning/wrapper-publish-guard.js +86 -0
- package/dist/heart/work-card.js +380 -0
- package/dist/mailroom/attention.js +167 -0
- package/dist/mailroom/autonomy.js +209 -0
- package/dist/mailroom/azure-sdk.js +27 -0
- package/dist/mailroom/blob-store.js +974 -0
- package/dist/mailroom/body-cache.js +61 -0
- package/dist/mailroom/cache-sync-cli.js +58 -0
- package/dist/mailroom/core.js +805 -0
- package/dist/mailroom/entry.js +169 -0
- package/dist/mailroom/file-store.js +568 -0
- package/dist/mailroom/hosted-cache-sync.js +384 -0
- package/dist/mailroom/mbox-import.js +393 -0
- package/dist/mailroom/migration.js +164 -0
- package/dist/mailroom/outbound.js +380 -0
- package/dist/mailroom/policy.js +263 -0
- package/dist/mailroom/reader.js +291 -0
- package/dist/mailroom/search-cache.js +513 -0
- package/dist/mailroom/search-relevance.js +319 -0
- package/dist/mailroom/smtp-ingress.js +176 -0
- package/dist/mailroom/source-state.js +176 -0
- package/dist/mailroom/sweep-orphans-cli.js +34 -0
- package/dist/mailroom/thread.js +109 -0
- package/dist/mailroom/travel-extract.js +89 -0
- package/dist/mind/bundle-manifest.js +37 -2
- package/dist/mind/context.js +352 -104
- package/dist/mind/desk-section.js +332 -0
- package/dist/mind/diary-integrity.js +60 -0
- package/dist/mind/{memory.js → diary.js} +90 -98
- package/dist/mind/embedding-provider.js +60 -0
- package/dist/mind/file-state.js +179 -0
- package/dist/mind/first-impressions.js +16 -2
- package/dist/mind/friend-link-codes.js +209 -0
- package/dist/mind/friend-merge.js +336 -0
- package/dist/mind/house-names.js +43 -0
- package/dist/mind/{associative-recall.js → note-search.js} +61 -60
- package/dist/mind/obligation-steering.js +227 -0
- package/dist/mind/outbound-record.js +176 -0
- package/dist/mind/pending.js +360 -10
- package/dist/mind/phrases.js +1 -0
- package/dist/mind/prompt-budget.js +511 -0
- package/dist/mind/prompt-refresh.js +3 -2
- package/dist/mind/prompt.js +1292 -189
- package/dist/mind/provenance-trust.js +26 -0
- package/dist/mind/record-paths.js +312 -0
- package/dist/mind/scrutiny.js +121 -0
- package/dist/mind/session-transaction.js +642 -0
- package/dist/mind/token-estimate.js +25 -12
- package/dist/mind/where-am-i.js +147 -0
- package/dist/nerves/cli-logging.js +22 -3
- package/dist/nerves/coverage/audit-rules.js +15 -6
- package/dist/nerves/coverage/audit.js +28 -2
- package/dist/nerves/coverage/cli-main.js +6 -1
- package/dist/nerves/coverage/cli.js +1 -1
- package/dist/nerves/coverage/contract.js +5 -5
- package/dist/nerves/coverage/file-completeness.js +153 -5
- package/dist/nerves/coverage/run-artifacts.js +56 -36
- package/dist/nerves/coverage/source-scanner.js +4 -4
- package/dist/nerves/event-buffer.js +111 -0
- package/dist/nerves/index.js +305 -9
- package/dist/nerves/observation.js +18 -0
- package/dist/nerves/redact.js +79 -0
- package/dist/nerves/review/cli-main.js +10 -0
- package/dist/nerves/review/cli.js +156 -0
- package/dist/nerves/review/core.js +159 -0
- package/dist/nerves/runtime.js +21 -2
- package/dist/repertoire/ado-client.js +17 -56
- package/dist/repertoire/ado-semantic.js +114 -40
- package/dist/repertoire/api-client.js +97 -0
- package/dist/repertoire/auth-required.js +22 -0
- package/dist/repertoire/bitwarden-native.js +458 -0
- package/dist/repertoire/bitwarden-store.js +1296 -0
- package/dist/repertoire/bundle-templates.js +71 -0
- package/dist/repertoire/bw-installer.js +268 -0
- package/dist/repertoire/coding/codex-jsonl.js +64 -0
- package/dist/repertoire/coding/context-pack.js +331 -0
- package/dist/repertoire/coding/feedback.js +302 -0
- package/dist/repertoire/coding/index.js +63 -3
- package/dist/repertoire/coding/manager.js +237 -14
- package/dist/repertoire/coding/orca-client.js +194 -0
- package/dist/repertoire/coding/orca-manager.js +460 -0
- package/dist/repertoire/coding/router.js +124 -0
- package/dist/repertoire/coding/spawner.js +61 -14
- package/dist/repertoire/coding/tools.js +340 -24
- package/dist/repertoire/coding/workbench-client.js +272 -0
- package/dist/repertoire/coding/workbench-manager.js +404 -0
- package/dist/repertoire/commerce-errors.js +109 -0
- package/dist/repertoire/commerce-self-test.js +156 -0
- package/dist/repertoire/credential-access.js +183 -0
- package/dist/repertoire/data/ado-endpoints.json +188 -0
- package/dist/repertoire/desk/classifier.js +362 -0
- package/dist/repertoire/desk-mcp.js +140 -0
- package/dist/repertoire/duffel-client.js +185 -0
- package/dist/repertoire/github-client.js +14 -55
- package/dist/repertoire/graph-client.js +11 -52
- package/dist/repertoire/guardrails.js +1394 -0
- package/dist/repertoire/house-sweep.js +471 -0
- package/dist/repertoire/in-turn-tools-door.js +54 -0
- package/dist/repertoire/mcp-client.js +307 -0
- package/dist/repertoire/mcp-declared-tools.js +156 -0
- package/dist/repertoire/mcp-manager.js +514 -0
- package/dist/repertoire/mcp-tools.js +199 -0
- package/dist/repertoire/mcp-write-guard.js +85 -0
- package/dist/repertoire/plugin-mcp.js +175 -0
- package/dist/repertoire/plugins.js +253 -0
- package/dist/repertoire/relationship-authorization.js +322 -0
- package/dist/repertoire/sanctuary-container-policy.js +50 -0
- package/dist/repertoire/shell-sessions.js +136 -0
- package/dist/repertoire/skill-search.js +177 -0
- package/dist/repertoire/skill-summaries.js +129 -0
- package/dist/repertoire/skills.js +45 -24
- package/dist/repertoire/stripe-client.js +163 -0
- package/dist/repertoire/tool-arguments.js +180 -0
- package/dist/repertoire/tool-candidates.js +50 -0
- package/dist/repertoire/tool-catalog.js +228 -0
- package/dist/repertoire/tool-error-code.js +30 -0
- package/dist/repertoire/tool-limits.js +20 -0
- package/dist/repertoire/tool-results.js +29 -0
- package/dist/repertoire/tools-a2a.js +792 -0
- package/dist/repertoire/tools-app-sessions.js +219 -0
- package/dist/repertoire/tools-attachments.js +302 -0
- package/dist/repertoire/tools-awaiting.js +934 -0
- package/dist/repertoire/tools-base.js +88 -706
- package/dist/repertoire/tools-bridge.js +153 -0
- package/dist/repertoire/tools-bundle.js +998 -0
- package/dist/repertoire/tools-chat.js +185 -0
- package/dist/repertoire/tools-commerce.js +272 -0
- package/dist/repertoire/tools-config.js +199 -0
- package/dist/repertoire/tools-continuity.js +648 -0
- package/dist/repertoire/tools-credential.js +410 -0
- package/dist/repertoire/tools-escalation.js +98 -0
- package/dist/repertoire/tools-evolution.js +560 -0
- package/dist/repertoire/tools-files.js +521 -0
- package/dist/repertoire/tools-flight.js +313 -0
- package/dist/repertoire/tools-flow.js +169 -0
- package/dist/repertoire/tools-friend-link.js +65 -0
- package/dist/repertoire/tools-github.js +12 -10
- package/dist/repertoire/tools-habits.js +111 -0
- package/dist/repertoire/tools-house-care.js +190 -0
- package/dist/repertoire/tools-mail.js +1928 -0
- package/dist/repertoire/tools-notes.js +567 -0
- package/dist/repertoire/tools-obligations.js +187 -0
- package/dist/repertoire/tools-orientation.js +36 -0
- package/dist/repertoire/tools-record.js +497 -0
- package/dist/repertoire/tools-rsvp.js +148 -0
- package/dist/repertoire/tools-runtime.js +260 -0
- package/dist/repertoire/tools-sanctuary-host.js +213 -0
- package/dist/repertoire/tools-session.js +1190 -0
- package/dist/repertoire/tools-shell.js +275 -0
- package/dist/repertoire/tools-shepherd-guidance.js +183 -0
- package/dist/repertoire/tools-shepherd.js +369 -0
- package/dist/repertoire/tools-steward-policy.js +157 -0
- package/dist/repertoire/tools-stripe.js +244 -0
- package/dist/repertoire/tools-surface.js +553 -0
- package/dist/repertoire/tools-teams.js +129 -73
- package/dist/repertoire/tools-telegram-contacts.js +41 -0
- package/dist/repertoire/tools-travel.js +142 -0
- package/dist/repertoire/tools-trip.js +1041 -0
- package/dist/repertoire/tools-unraid.js +627 -0
- package/dist/repertoire/tools-user-profile.js +166 -0
- package/dist/repertoire/tools-vault.js +46 -0
- package/dist/repertoire/tools-voice-local.js +210 -0
- package/dist/repertoire/tools-voice.js +153 -0
- package/dist/repertoire/tools-web.js +238 -0
- package/dist/repertoire/tools.js +633 -123
- package/dist/repertoire/travel-api-client.js +463 -0
- package/dist/repertoire/unraid-client.js +155 -0
- package/dist/repertoire/unraid-restart.js +342 -0
- package/dist/repertoire/user-profile.js +131 -0
- package/dist/repertoire/vault-setup.js +298 -0
- package/dist/repertoire/vault-unlock.js +816 -0
- package/dist/rsvp/aisleplanner-client.js +354 -0
- package/dist/rsvp/cli.js +936 -0
- package/dist/rsvp/config.js +327 -0
- package/dist/rsvp/cutover.js +453 -0
- package/dist/rsvp/diagnostics.js +232 -0
- package/dist/rsvp/diff-renderer.js +176 -0
- package/dist/rsvp/habit-policy.js +110 -0
- package/dist/rsvp/habit-stage.js +123 -0
- package/dist/rsvp/incident-bundle.js +97 -0
- package/dist/rsvp/migration.js +204 -0
- package/dist/rsvp/native-habit-runner.js +630 -0
- package/dist/rsvp/outbound-state.js +628 -0
- package/dist/rsvp/query.js +118 -0
- package/dist/rsvp/replay.js +233 -0
- package/dist/rsvp/snapshot.js +232 -0
- package/dist/rsvp/spend-ledger.js +175 -0
- package/dist/scripts/claude-code-hook.js +41 -0
- package/dist/scripts/claude-code-stop-hook.js +48 -0
- package/dist/senses/a2a-entry.js +145 -0
- package/dist/senses/acp-server.js +386 -0
- package/dist/senses/app-sessions/client.js +128 -0
- package/dist/senses/app-sessions/digest-cards.js +187 -0
- package/dist/senses/app-sessions/digest-push.js +108 -0
- package/dist/senses/app-sessions/digest-sources.js +204 -0
- package/dist/senses/app-sessions/digest.js +284 -0
- package/dist/senses/app-sessions/run-command.js +51 -0
- package/dist/senses/app-sessions/sense.js +242 -0
- package/dist/senses/app-sessions/shepherd-cli.js +166 -0
- package/dist/senses/app-sessions/shepherd-rows.js +67 -0
- package/dist/senses/app-sessions/store.js +149 -0
- package/dist/senses/app-sessions/waiting-prompts.js +137 -0
- package/dist/senses/app-sessions/waiting-status.js +23 -0
- package/dist/senses/app-sessions-entry.js +87 -0
- package/dist/senses/attention-queue.js +186 -0
- package/dist/senses/await-turn-message.js +65 -0
- package/dist/senses/bluebubbles/active-turns.js +241 -0
- package/dist/senses/bluebubbles/attachment-cache.js +53 -0
- package/dist/senses/bluebubbles/attachment-download.js +143 -0
- package/dist/senses/bluebubbles/client.js +874 -0
- package/dist/senses/bluebubbles/context-packet.js +207 -0
- package/dist/senses/bluebubbles/context-smoke.js +144 -0
- package/dist/senses/bluebubbles/entry.js +80 -0
- package/dist/senses/bluebubbles/host-account-verifier.js +113 -0
- package/dist/senses/bluebubbles/inbound-log.js +127 -0
- package/dist/senses/bluebubbles/index.js +4663 -0
- package/dist/senses/bluebubbles/latest-turn.js +342 -0
- package/dist/senses/bluebubbles/media.js +255 -0
- package/dist/senses/bluebubbles/model.js +383 -0
- package/dist/senses/{bluebubbles-mutation-log.js → bluebubbles/mutation-log.js} +57 -6
- package/dist/senses/bluebubbles/outbound-state.js +335 -0
- package/dist/senses/bluebubbles/processed-log.js +133 -0
- package/dist/senses/bluebubbles/reactions.js +18 -0
- package/dist/senses/bluebubbles/replay.js +284 -0
- package/dist/senses/bluebubbles/runtime-state.js +152 -0
- package/dist/senses/bluebubbles/semantic-receipts.js +2014 -0
- package/dist/senses/bluebubbles/send-file.js +20 -0
- package/dist/senses/bluebubbles/send-health.js +126 -0
- package/dist/senses/bluebubbles/session-cleanup.js +72 -0
- package/dist/senses/bluebubbles/webhook-registration.js +257 -0
- package/dist/senses/bluebubbles-meta-guard.js +39 -0
- package/dist/senses/chat-file.js +75 -0
- package/dist/senses/cli/bracketed-paste.js +82 -0
- package/dist/senses/cli/image-paste.js +287 -0
- package/dist/senses/cli/image-ref-navigation.js +75 -0
- package/dist/senses/cli/ink-app.js +156 -0
- package/dist/senses/cli/inline-diff.js +64 -0
- package/dist/senses/cli/input-keys.js +209 -0
- package/dist/senses/cli/kill-ring.js +86 -0
- package/dist/senses/cli/message-list.js +51 -0
- package/dist/senses/cli/ouro-tui.js +633 -0
- package/dist/senses/cli/spinner-imperative.js +135 -0
- package/dist/senses/cli/spinner.js +101 -0
- package/dist/senses/cli/status-line.js +60 -0
- package/dist/senses/cli/streaming-markdown.js +526 -0
- package/dist/senses/cli/tool-display.js +85 -0
- package/dist/senses/cli/tool-render.js +85 -0
- package/dist/senses/cli/tui-store.js +252 -0
- package/dist/senses/cli/virtual-list.js +35 -0
- package/dist/senses/cli-entry.js +62 -9
- package/dist/senses/cli-layout.js +187 -0
- package/dist/senses/cli.js +828 -308
- package/dist/senses/commands.js +66 -3
- package/dist/senses/context-packet-ledger.js +367 -0
- package/dist/senses/context-packets.js +154 -0
- package/dist/senses/continuity.js +94 -0
- package/dist/senses/habit-lifecycle-guard.js +24 -0
- package/dist/senses/habit-turn-message.js +160 -0
- package/dist/senses/inbound-journal.js +186 -0
- package/dist/senses/ingress-evidence.js +2 -0
- package/dist/senses/mail-entry.js +69 -0
- package/dist/senses/mail.js +524 -0
- package/dist/senses/ordinary-owner-decision.js +98 -0
- package/dist/senses/pipeline.js +1390 -0
- package/dist/senses/private-runtime-worker.js +857 -0
- package/dist/senses/private-runtime.js +1692 -0
- package/dist/senses/proactive-content-guard.js +51 -0
- package/dist/senses/program-status.js +155 -0
- package/dist/senses/repeat-while.js +36 -0
- package/dist/senses/root-host-approval-port.js +345 -0
- package/dist/senses/root-host-approval-runtime.js +393 -0
- package/dist/senses/sanctuary-authority-resident.js +102 -0
- package/dist/senses/sanctuary-download-credit-presentation.js +31 -0
- package/dist/senses/sanctuary-full-visibility-contract.js +302 -0
- package/dist/senses/sanctuary-grounding.js +118 -0
- package/dist/senses/sanctuary-health-acceptance-probe-entry.js +21 -0
- package/dist/senses/sanctuary-health-acceptance-probe.js +802 -0
- package/dist/senses/sanctuary-health-runner.js +106 -0
- package/dist/senses/sanctuary-health.js +442 -0
- package/dist/senses/sanctuary-house.js +97 -0
- package/dist/senses/sanctuary-install-state-contract.js +169 -0
- package/dist/senses/sanctuary-interactive-control.js +410 -0
- package/dist/senses/sanctuary-media-catalog-contract.js +268 -0
- package/dist/senses/sanctuary-media-optimization.js +517 -0
- package/dist/senses/sanctuary-runtime.js +392 -0
- package/dist/senses/sanctuary-sab.js +85 -0
- package/dist/senses/sanctuary-storage-optimization-contract.js +32 -0
- package/dist/senses/sense-shutdown.js +72 -0
- package/dist/senses/shared-turn.js +840 -0
- package/dist/senses/shepherd/agent-presentation.js +88 -0
- package/dist/senses/shepherd/attention-page.js +166 -0
- package/dist/senses/shepherd/attention-sidebar.js +76 -0
- package/dist/senses/shepherd/attention.js +295 -0
- package/dist/senses/shepherd/checkin-config.js +76 -0
- package/dist/senses/shepherd/checkin-store.js +383 -0
- package/dist/senses/shepherd/client.js +196 -0
- package/dist/senses/shepherd/cmux.js +483 -0
- package/dist/senses/shepherd/composer.js +336 -0
- package/dist/senses/shepherd/conversation-hold.js +78 -0
- package/dist/senses/shepherd/feedback-reply.js +108 -0
- package/dist/senses/shepherd/feedback-source.js +20 -0
- package/dist/senses/shepherd/feedback-store.js +328 -0
- package/dist/senses/shepherd/feedback-submit.js +182 -0
- package/dist/senses/shepherd/feedback-worker.js +208 -0
- package/dist/senses/shepherd/guidance.js +273 -0
- package/dist/senses/shepherd/herdr.js +427 -0
- package/dist/senses/shepherd/host.js +14 -0
- package/dist/senses/shepherd/human-decision-guard.js +29 -0
- package/dist/senses/shepherd/judge-evaluation-command.js +185 -0
- package/dist/senses/shepherd/judge-evaluation-entry.js +20 -0
- package/dist/senses/shepherd/judge-evaluation.js +144 -0
- package/dist/senses/shepherd/judge.js +210 -0
- package/dist/senses/shepherd/notice-outbox.js +254 -0
- package/dist/senses/shepherd/observation-publisher.js +320 -0
- package/dist/senses/shepherd/operations-defaults.js +86 -0
- package/dist/senses/shepherd/operations.js +159 -0
- package/dist/senses/shepherd/owner-notice.js +496 -0
- package/dist/senses/shepherd/prompt-state.js +60 -0
- package/dist/senses/shepherd/recovery.js +543 -0
- package/dist/senses/shepherd/redact.js +66 -0
- package/dist/senses/shepherd/returns.js +79 -0
- package/dist/senses/shepherd/sense.js +862 -0
- package/dist/senses/shepherd/shepherd-judge-corpus-v1.json +170 -0
- package/dist/senses/shepherd/surface.js +125 -0
- package/dist/senses/shepherd/target-binding.js +13 -0
- package/dist/senses/shepherd/terminal-process.js +147 -0
- package/dist/senses/shepherd-entry.js +98 -0
- package/dist/senses/surface-tool.js +121 -0
- package/dist/senses/teams-attachments.js +68 -0
- package/dist/senses/teams-entry.js +80 -9
- package/dist/senses/teams-image.js +128 -0
- package/dist/senses/teams-inbound.js +76 -0
- package/dist/senses/teams-off-turn.js +199 -0
- package/dist/senses/teams-outbox.js +242 -0
- package/dist/senses/teams.js +1776 -250
- package/dist/senses/telegram-admission.js +700 -0
- package/dist/senses/telegram-approval-relay.js +293 -0
- package/dist/senses/telegram-approval-runtime.js +831 -0
- package/dist/senses/telegram-attachments.js +128 -0
- package/dist/senses/telegram-audit-ledger.js +220 -0
- package/dist/senses/telegram-authority-transport.js +233 -0
- package/dist/senses/telegram-chat-actions.js +57 -0
- package/dist/senses/telegram-client.js +1896 -0
- package/dist/senses/telegram-effect-adapter.js +892 -0
- package/dist/senses/telegram-entry.js +87 -0
- package/dist/senses/telegram-handoff.js +150 -0
- package/dist/senses/telegram-identity-key.js +143 -0
- package/dist/senses/telegram-markdown.js +331 -0
- package/dist/senses/telegram-owner-route.js +129 -0
- package/dist/senses/telegram.js +2789 -0
- package/dist/senses/terminal-handoff.js +44 -0
- package/dist/senses/trust-gate.js +207 -2
- package/dist/senses/turn-attempts.js +171 -0
- package/dist/senses/turn-watch.js +268 -0
- package/dist/senses/voice/audio-playback.js +237 -0
- package/dist/senses/voice/audio-routing.js +119 -0
- package/dist/senses/voice/call-auth.js +250 -0
- package/dist/senses/voice/elevenlabs.js +202 -0
- package/dist/senses/voice/floor-control.js +431 -0
- package/dist/senses/voice/floor-controller.js +115 -0
- package/dist/senses/voice/golden-path.js +116 -0
- package/dist/senses/voice/index.js +29 -0
- package/dist/senses/voice/local-audio-control.js +344 -0
- package/dist/senses/voice/local-audio-devices.js +516 -0
- package/dist/senses/voice/local-audio-disclosure.js +174 -0
- package/dist/senses/voice/local-audio-identity.js +103 -0
- package/dist/senses/voice/local-audio-join.js +325 -0
- package/dist/senses/voice/local-audio-mute.js +199 -0
- package/dist/senses/voice/local-audio-notify.js +124 -0
- package/dist/senses/voice/local-audio-prompts.js +116 -0
- package/dist/senses/voice/local-audio-transport.js +427 -0
- package/dist/senses/voice/local-audio.js +281 -0
- package/dist/senses/voice/local-media-stream.js +145 -0
- package/dist/senses/voice/meeting.js +113 -0
- package/dist/senses/voice/outbound.js +190 -0
- package/dist/senses/voice/phone.js +33 -0
- package/dist/senses/voice/playback.js +139 -0
- package/dist/senses/voice/process-guards.js +51 -0
- package/dist/senses/voice/realtime-eval.js +496 -0
- package/dist/senses/voice/realtime-tool-schema.js +195 -0
- package/dist/senses/voice/realtime-trace.js +531 -0
- package/dist/senses/voice/realtime-utterances.js +158 -0
- package/dist/senses/voice/transcript.js +70 -0
- package/dist/senses/voice/turn.js +219 -0
- package/dist/senses/voice/twilio-phone-runtime.js +836 -0
- package/dist/senses/voice/twilio-phone.js +5660 -0
- package/dist/senses/voice/types.js +2 -0
- package/dist/senses/voice/utterances.js +207 -0
- package/dist/senses/voice/whisper.js +153 -0
- package/dist/senses/voice-entry.js +84 -0
- package/dist/senses/voice-realtime-eval-command.js +99 -0
- package/dist/senses/voice-realtime-eval-entry.js +25 -0
- package/dist/senses/voice-twilio-entry.js +88 -0
- package/dist/trips/core.js +138 -0
- package/dist/trips/store.js +265 -0
- package/dist/util/frontmatter.js +69 -0
- package/node_modules/@ouro.bot/friends/LICENSE +201 -0
- package/node_modules/@ouro.bot/friends/README.md +687 -0
- package/node_modules/@ouro.bot/friends/actions/generated/mcp.json +1105 -0
- package/node_modules/@ouro.bot/friends/changelog.json +197 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/a2a-message.d.ts +39 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/a2a-message.js +54 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/adapter.d.ts +117 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/adapter.js +202 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/agent-card.d.ts +50 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/agent-card.js +32 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-key.d.ts +38 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-key.js +120 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-verifier.d.ts +195 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-verifier.js +342 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-web.d.ts +26 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-web.js +140 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/envelope-binding.d.ts +62 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/envelope-binding.js +83 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/index.d.ts +26 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/index.js +82 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/jcs.d.ts +5 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/jcs.js +84 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/reachability.d.ts +22 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/reachability.js +17 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/roster-verify.d.ts +15 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/roster-verify.js +61 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/seal.d.ts +47 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/seal.js +95 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sealed-envelope.d.ts +58 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sealed-envelope.js +113 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sign.d.ts +42 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sign.js +87 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sodium.d.ts +5 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sodium.js +19 -0
- package/node_modules/@ouro.bot/friends/dist/account-roster.d.ts +52 -0
- package/node_modules/@ouro.bot/friends/dist/account-roster.js +108 -0
- package/node_modules/@ouro.bot/friends/dist/agent-peer.d.ts +26 -0
- package/node_modules/@ouro.bot/friends/dist/agent-peer.js +138 -0
- package/node_modules/@ouro.bot/friends/dist/audit.d.ts +42 -0
- package/node_modules/@ouro.bot/friends/dist/audit.js +86 -0
- package/node_modules/@ouro.bot/friends/dist/channel.d.ts +16 -0
- package/node_modules/@ouro.bot/friends/dist/channel.js +172 -0
- package/node_modules/@ouro.bot/friends/dist/connect-authority.d.ts +43 -0
- package/node_modules/@ouro.bot/friends/dist/connect-authority.js +84 -0
- package/node_modules/@ouro.bot/friends/dist/connect.d.ts +56 -0
- package/node_modules/@ouro.bot/friends/dist/connect.js +163 -0
- package/node_modules/@ouro.bot/friends/dist/consent.d.ts +34 -0
- package/node_modules/@ouro.bot/friends/dist/consent.js +65 -0
- package/node_modules/@ouro.bot/friends/dist/coordination.d.ts +116 -0
- package/node_modules/@ouro.bot/friends/dist/coordination.js +329 -0
- package/node_modules/@ouro.bot/friends/dist/delegation-grant.d.ts +21 -0
- package/node_modules/@ouro.bot/friends/dist/delegation-grant.js +39 -0
- package/node_modules/@ouro.bot/friends/dist/file-bundle.d.ts +17 -0
- package/node_modules/@ouro.bot/friends/dist/file-bundle.js +27 -0
- package/node_modules/@ouro.bot/friends/dist/friend-lookup.d.ts +9 -0
- package/node_modules/@ouro.bot/friends/dist/friend-lookup.js +69 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store-file.d.ts +19 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store-file.js +157 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store.js +8 -0
- package/node_modules/@ouro.bot/friends/dist/grants.d.ts +43 -0
- package/node_modules/@ouro.bot/friends/dist/grants.js +100 -0
- package/node_modules/@ouro.bot/friends/dist/group-context.d.ts +21 -0
- package/node_modules/@ouro.bot/friends/dist/group-context.js +145 -0
- package/node_modules/@ouro.bot/friends/dist/identity.d.ts +17 -0
- package/node_modules/@ouro.bot/friends/dist/identity.js +68 -0
- package/node_modules/@ouro.bot/friends/dist/index.d.ts +73 -0
- package/node_modules/@ouro.bot/friends/dist/index.js +164 -0
- package/node_modules/@ouro.bot/friends/dist/link-identity.d.ts +14 -0
- package/node_modules/@ouro.bot/friends/dist/link-identity.js +157 -0
- package/node_modules/@ouro.bot/friends/dist/mailbox/index.d.ts +105 -0
- package/node_modules/@ouro.bot/friends/dist/mailbox/index.js +205 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/bin.d.ts +2 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/bin.js +17 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/dispatch.d.ts +40 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/dispatch.js +744 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/index.d.ts +6 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/index.js +14 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/run-main.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/run-main.js +59 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/schemas.d.ts +10 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/schemas.js +23 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/server.d.ts +30 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/server.js +195 -0
- package/node_modules/@ouro.bot/friends/dist/message.d.ts +93 -0
- package/node_modules/@ouro.bot/friends/dist/message.js +129 -0
- package/node_modules/@ouro.bot/friends/dist/mission-result.d.ts +89 -0
- package/node_modules/@ouro.bot/friends/dist/mission-result.js +207 -0
- package/node_modules/@ouro.bot/friends/dist/mission-share.d.ts +94 -0
- package/node_modules/@ouro.bot/friends/dist/mission-share.js +232 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store-file.d.ts +18 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store-file.js +169 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store.d.ts +10 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store.js +9 -0
- package/node_modules/@ouro.bot/friends/dist/missions.d.ts +31 -0
- package/node_modules/@ouro.bot/friends/dist/missions.js +99 -0
- package/node_modules/@ouro.bot/friends/dist/notes.d.ts +11 -0
- package/node_modules/@ouro.bot/friends/dist/notes.js +90 -0
- package/node_modules/@ouro.bot/friends/dist/observability.d.ts +27 -0
- package/node_modules/@ouro.bot/friends/dist/observability.js +31 -0
- package/node_modules/@ouro.bot/friends/dist/outcomes.d.ts +9 -0
- package/node_modules/@ouro.bot/friends/dist/outcomes.js +51 -0
- package/node_modules/@ouro.bot/friends/dist/resolver.d.ts +59 -0
- package/node_modules/@ouro.bot/friends/dist/resolver.js +276 -0
- package/node_modules/@ouro.bot/friends/dist/results.d.ts +10 -0
- package/node_modules/@ouro.bot/friends/dist/results.js +2 -0
- package/node_modules/@ouro.bot/friends/dist/room.d.ts +22 -0
- package/node_modules/@ouro.bot/friends/dist/room.js +40 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-file.d.ts +16 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-file.js +125 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-memory.d.ts +9 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-memory.js +20 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store.d.ts +29 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store.js +9 -0
- package/node_modules/@ouro.bot/friends/dist/roster-verifier.d.ts +23 -0
- package/node_modules/@ouro.bot/friends/dist/roster-verifier.js +47 -0
- package/node_modules/@ouro.bot/friends/dist/share.d.ts +113 -0
- package/node_modules/@ouro.bot/friends/dist/share.js +314 -0
- package/node_modules/@ouro.bot/friends/dist/standing.d.ts +83 -0
- package/node_modules/@ouro.bot/friends/dist/standing.js +111 -0
- package/node_modules/@ouro.bot/friends/dist/store-file.d.ts +82 -0
- package/node_modules/@ouro.bot/friends/dist/store-file.js +1089 -0
- package/node_modules/@ouro.bot/friends/dist/store.d.ts +43 -0
- package/node_modules/@ouro.bot/friends/dist/tokens.d.ts +10 -0
- package/{dist/mind/friends → node_modules/@ouro.bot/friends/dist}/tokens.js +7 -4
- package/node_modules/@ouro.bot/friends/dist/trust-explanation.d.ts +22 -0
- package/node_modules/@ouro.bot/friends/dist/trust-explanation.js +90 -0
- package/node_modules/@ouro.bot/friends/dist/trust-mutation.d.ts +16 -0
- package/node_modules/@ouro.bot/friends/dist/trust-mutation.js +67 -0
- package/node_modules/@ouro.bot/friends/dist/types.d.ts +333 -0
- package/node_modules/@ouro.bot/friends/dist/types.js +55 -0
- package/node_modules/@ouro.bot/friends/dist/util/cap-string.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/util/cap-string.js +35 -0
- package/node_modules/@ouro.bot/friends/dist/util/safe-id.d.ts +1 -0
- package/node_modules/@ouro.bot/friends/dist/util/safe-id.js +10 -0
- package/node_modules/@ouro.bot/friends/dist/verifier.d.ts +11 -0
- package/node_modules/@ouro.bot/friends/dist/verifier.js +29 -0
- package/node_modules/@ouro.bot/friends/dist/whoami.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/whoami.js +39 -0
- package/node_modules/@ouro.bot/friends/package.json +82 -0
- package/node_modules/libsodium/LICENSE +16 -0
- package/node_modules/libsodium/README.md +281 -0
- package/node_modules/libsodium/dist/modules/libsodium.js +1 -0
- package/node_modules/libsodium/dist/modules-esm/libsodium.mjs +1 -0
- package/node_modules/libsodium/package.json +54 -0
- package/node_modules/libsodium-wrappers/LICENSE +16 -0
- package/node_modules/libsodium-wrappers/README.md +281 -0
- package/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.d.ts +2155 -0
- package/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js +1 -0
- package/node_modules/libsodium-wrappers/dist/modules-esm/libsodium-wrappers.d.mts +2743 -0
- package/node_modules/libsodium-wrappers/dist/modules-esm/libsodium-wrappers.mjs +1 -0
- package/node_modules/libsodium-wrappers/package.json +74 -0
- package/npm-shrinkwrap.json +8789 -0
- package/package.json +105 -13
- package/skills/agent-commerce.md +116 -0
- package/skills/browser-navigation.md +120 -0
- package/skills/commerce-setup-guide.md +116 -0
- package/skills/commerce-setup.md +87 -0
- package/skills/configure-dev-tools.md +99 -0
- package/skills/sense-setup.md +56 -0
- package/skills/travel-planning.md +141 -0
- 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
- package/dist/heart/daemon/ouro-path-installer.js +0 -177
- package/dist/heart/daemon/specialist-tools.js +0 -234
- package/dist/heart/daemon/subagent-installer.js +0 -134
- package/dist/mind/friends/channel.js +0 -49
- package/dist/mind/friends/resolver.js +0 -84
- package/dist/mind/friends/store-file.js +0 -171
- package/dist/mind/friends/types.js +0 -21
- package/dist/repertoire/tasks/board.js +0 -122
- package/dist/repertoire/tasks/index.js +0 -210
- package/dist/repertoire/tasks/middleware.js +0 -65
- package/dist/repertoire/tasks/parser.js +0 -173
- package/dist/repertoire/tasks/scanner.js +0 -132
- package/dist/repertoire/tasks/transitions.js +0 -145
- package/dist/senses/bluebubbles-client.js +0 -279
- package/dist/senses/bluebubbles-entry.js +0 -11
- package/dist/senses/bluebubbles-model.js +0 -253
- package/dist/senses/bluebubbles.js +0 -332
- package/dist/senses/inner-dialog-worker.js +0 -61
- package/dist/senses/inner-dialog.js +0 -231
- package/subagents/README.md +0 -73
- package/subagents/work-doer.md +0 -233
- package/subagents/work-merger.md +0 -624
- package/subagents/work-planner.md +0 -373
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/basilisk.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/jafar.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/jormungandr.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/kaa.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/medusa.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/nagini.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/ouroboros.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/python.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/quetzalcoatl.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/sir-hiss.md +0 -0
- /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/the-snake.md +0 -0
- /package/dist/{repertoire/tasks/types.js → heart/attachments/sources/adapter.js} +0 -0
- /package/dist/heart/{daemon → versioning}/ouro-uti.js +0 -0
- /package/{dist/mind/friends → node_modules/@ouro.bot/friends/dist}/store.js +0 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
# Factory local session capture
|
|
2
|
+
|
|
3
|
+
Desk records local session facts without waiting for a network service, delivers their published form to a factory store when someone runs the delivery, and provides the deterministic pipeline a store uses to validate published facts and waste labels and rebuild reports. Since Epoch 3 the factory hooks are not registered: nothing about the factory runs at session start, at the end of a turn or at session end, and the store and its commands stay for use on demand. The store's own workflows live in the store repository, and delivery to the live public store is not yet proven on installed hosts. The [end hook](../hooks/lib/factory-end.cjs), [runner](../mcp/src/factory/derive-run.js), [delivery](../mcp/src/factory/flush.js), [pipeline](../mcp/src/factory/pipeline/) and [synthetic tests](../../../tests/desk/mcp/__tests__/factory/) define this boundary.
|
|
4
|
+
|
|
5
|
+
## Working on the factory
|
|
6
|
+
|
|
7
|
+
Before you design, plan, change or review anything here, invoke the `factory-work` skill: it holds the Lean reading and the terrarium checks. One rule from it that this doc follows throughout: a field that was not measured is absent or `null`, never `0`.
|
|
8
|
+
|
|
9
|
+
## Host events
|
|
10
|
+
|
|
11
|
+
| Event | Local action | Detached action |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Claude `Stop`, Copilot `agentStop` | Refresh the protected session marker. | Run `factory.js finalize --job <job>` for each pending finalize request, at most eight. |
|
|
14
|
+
| Claude `SessionEnd`, Copilot `sessionEnd` | Refresh the marker with the end reason. | Run `factory.js derive --marker <file> --wait-quiet 30000`. |
|
|
15
|
+
|
|
16
|
+
The [end hook](../hooks/lib/factory-end.cjs) is not registered in the [host manifests](../hooks/hooks.json) or the [Copilot manifest](../hooks/copilot-hooks.json) since Epoch 3, and the session-end hook runs only the unpushed-commit check. A host that registers `hooks/factory-end.cjs` itself gets the events in the table. The handler caps stdin at 1 MiB and stops waiting for input after 150 ms. Its supervisor keeps the unchanged 1.5-second deadline outside the worker that performs synchronous metadata and OS-protection work, terminates a blocked worker and waits for its exit. Both processes print nothing. Ordinary native operation targets 500 ms; the [subprocess tests](../../../tests/desk/mcp/__tests__/factory/end_hook.test.js) allow 2 seconds for CI. The local protection helpers may invoke OS ACL utilities, but neither the hook nor derivation requests a network operation.
|
|
17
|
+
|
|
18
|
+
[`factory.js status`](../mcp/scripts/factory.js) reports an empty factory without creating its opt-in state folder. When state already exists, inspection retains permission checks, corrupt-record recovery and stale-marker pruning, so the command is not declared read-only.
|
|
19
|
+
|
|
20
|
+
Copilot log paths come from `sessionId` under `COPILOT_HOME` (otherwise `~/.copilot`), not from prompt text or `transcriptPath`. Agency plugin-session locations supply the `launcher` entrypoint. Plugin names and versions come from sibling manifests on Copilot and the installed-plugin registry on Claude. Each plugin also records its install source, the GitHub `owner/repo` it came from, or `null` when that is not known for certain. Every lookup fails closed:
|
|
21
|
+
|
|
22
|
+
- **Claude Code:** the plugin's marketplace must be a GitHub repository in `known_marketplaces.json`, and the marketplace's cached manifest (`<installLocation>/.claude-plugin/marketplace.json`) must list the plugin. The source is then the marketplace's repository for a relative path inside it, or the listing's own GitHub repository. A plugin the manifest does not list, a listing hosted anywhere but GitHub, or a name listed twice with different sources has no source.
|
|
23
|
+
- **Copilot under Agency:** the source comes from Agency's cache index. Every index entry counts, including non-GitHub ones. A plugin has a source only when the whole index was read and every cached entry at the plugin's exact name and version came from one GitHub repository. A name never matches on its own. An index with more than 256 entries, an entry whose folder cannot be read, and a scan the source budget cuts short all give no source for any plugin.
|
|
24
|
+
- **Plain Copilot:** exactly one `installedPlugins` record in `config.json` must match the plugin's name and version, and its marketplace must be a GitHub repository in `settings.json` `extraKnownMarketplaces`. Copilot keeps no marketplace manifest to check the listing against, so the marketplace's repository stands in for the plugin's.
|
|
25
|
+
|
|
26
|
+
The Stop hook gives the lookup 400 ms. After that, every source is `null` and the plugins are still recorded. Markers and local facts written before sources were recorded stay valid, and their plugins read as having no known source. The marker captures the resolved route so deleting a temporary plugin folder cannot redirect a later sweep to the default store. Every discovery cap, including Claude's records-per-key and aggregate manifest-directory limits, makes routing incomplete; only the desk's own valid declaration can override that hold. The [marker validator](../mcp/src/factory/marker.js) limits paths and metadata, while the [canonical resolver](../mcp/scripts/resolve-desk-root.js) owns desk selection. Hook-facing activation reads are regular-file-only, no-follow and capped at 64 KiB. An unresolved binding defers capture rather than guessing. `DESK_PERSON`, when set, supplies an explicit `desks/<alias>` binding prefix; no identity is inferred from content.
|
|
27
|
+
|
|
28
|
+
**A privately routed session never reaches the public store on any path, and every hold is visible.** A route is held (`store: null`, `invalid_declaration`) whenever the hook could not read the whole plugin set: a manifest or plugin folder that is missing, unreadable, linked or too large, a symlinked Copilot plugin folder, a missing or unreadable Claude Code registry, a registry that does not list the running Desk (a `claude --plugin-dir` session, whose overlays the hook cannot see), too many plugins, or a scan the deadline cut short. The unread plugin may be the overlay that declares a private store, and only it can say. Every reader reads the warned manifests again and routes to the store a manifest declares once it reads, unless that store is the public one ([store-route.js](../mcp/src/factory/store-route.js)). A reread never releases a hold to the public store, whether the manifest now declares it or an older Desk recorded it as the default: the file at that path may not be the plugin the session ran with (a Copilot plugin folder carries no version, so another plugin can take its place). Nothing infers the default store for a held session: another session's plugin scan says nothing about the plugins this one ran with (a `claude --plugin-dir` overlay, another config folder, an overlay uninstalled since), so a hold whose cause cleared without a declaration waits until the desk declares its store in `_meta/factory.json` ([held-route.js](../mcp/src/factory/held-route.js)). A registry whose Desk record is another version in the same cache folder as the running Desk (Desk updated mid-session) counts as listing it. A marker an older hook wrote with the default route and no plugins at all is read as held, because a hook that read its plugin set always lists Desk. A held marker is kept for 90 days instead of 30; the sweep counts holds in `status.json` `route_holds`, and `desk_doctor` and session start print each with its path, reason and remedy, and the number of held sessions pruned unsettled (`held_pruned`). Without a current marker, a session goes only to the store this Desk last checked positively for it, which its receipt records as `checked_route`: the flush, the derive and the sweep write it on a positive route, and nothing else does. A receipt an older Desk wrote, or none, freezes the copy on this machine. A copy kept aside while its desk folder was gone comes back once the folder resolves and the session is derived to a checked route here again.
|
|
29
|
+
|
|
30
|
+
## Optional public task explanations
|
|
31
|
+
|
|
32
|
+
Task context is a separate record, `context/<public-job>.json` with schema
|
|
33
|
+
`desk.factory.context/2`; existing `desk.factory.context/1` records remain
|
|
34
|
+
readable. Numerical facts and waste labels still reject free prose. Their
|
|
35
|
+
contribution permission does not authorize publishing explanations.
|
|
36
|
+
A compatible store advertises `{"task_context":1}` in `context.json`; that
|
|
37
|
+
declaration is maintenance, never contributor data.
|
|
38
|
+
It may additionally advertise `"loop_context":1` in that same closed object.
|
|
39
|
+
Only that capability permits the optional fixed-enum annotation-refresh state
|
|
40
|
+
inside the capture record's loop slot; it grants no permission to publish prose.
|
|
41
|
+
|
|
42
|
+
After the operator explicitly authorizes nonsensitive prose for this desk,
|
|
43
|
+
record that permission separately in `_meta/factory-context.json`:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{"schema_version":1,"stores":{"ourostack/factory":true}}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The ordinary flush prepares public-clock inputs, and the ordinary evaluator
|
|
50
|
+
uses its existing shared launch quota for generation and a separate fresh
|
|
51
|
+
privacy run. Local model JSON is checked as structured data and then
|
|
52
|
+
canonically serialized; only the checked public payload is reviewed and sent.
|
|
53
|
+
No new daemon, provider-key billing or per-task approval prompt is added.
|
|
54
|
+
Removing this prose permission stops new explanations and lets the next
|
|
55
|
+
consented flush retract the exact context this machine delivered. Turning off
|
|
56
|
+
numerical contribution stops network delivery altogether; it does not erase
|
|
57
|
+
previously published history.
|
|
58
|
+
|
|
59
|
+
Context describes the requested outcome, observed work, prerequisite-blocked
|
|
60
|
+
**Waiting**, resumption and results. A waiting explanation is not a new
|
|
61
|
+
measurement: it cannot turn uncaptured time into recorded work, installation
|
|
62
|
+
time, avoidable waste or savings. Context can cite an exact recorded interval
|
|
63
|
+
or job-share boundary, or the real end and start of sessions; paired episode
|
|
64
|
+
endpoints do not invent a `human_wait` interval or measure the whole gap as
|
|
65
|
+
waiting. Unsupported placement stays explicitly partial and unplaced.
|
|
66
|
+
|
|
67
|
+
The context record has an exact schema, a public source fingerprint for each
|
|
68
|
+
session, evidence anchors and an independent privacy verdict bound to the exact
|
|
69
|
+
payload hash. Headings are limited to 120 characters, explanations to 240,
|
|
70
|
+
waiting reasons/prerequisites/resumptions to 160 each, events to 64 and evidence
|
|
71
|
+
references to eight per event; canonical bytes are limited to 128 KiB. Partial
|
|
72
|
+
event lists state their omission count and retain the terminal observation.
|
|
73
|
+
`published`, `withheld` and `unavailable` remain distinct.
|
|
74
|
+
|
|
75
|
+
New candidate templates use `desk.factory.context/2`, which adds a closed
|
|
76
|
+
`recommendations` list to the same record. Each of at most eight recommendations
|
|
77
|
+
has a stable ID, one to eight distinct `observations` naming events in that
|
|
78
|
+
record, a `problem`, a proposed `change`, a `hypothesis`, a verification `check`
|
|
79
|
+
and `confidence`. Problem, change and check are limited to 240 characters each;
|
|
80
|
+
the hypothesis is limited to 160. All four sentences are required and follow
|
|
81
|
+
the same public-text rules. The referenced observations retain their original
|
|
82
|
+
session and source evidence; a recommendation does not turn an evidence anchor
|
|
83
|
+
into a measured phase or a causal result.
|
|
84
|
+
|
|
85
|
+
Recommendations are advice, not a work claim or permission to act. Their bytes
|
|
86
|
+
are part of the exact independently reviewed payload. A proposed change is not
|
|
87
|
+
a shipped change or a demonstrated benefit. Withheld and unavailable records
|
|
88
|
+
have no recommendations; an older context/1 record has no recommendation field,
|
|
89
|
+
which does not mean zero improvement opportunities. Generation and independent
|
|
90
|
+
privacy review use the existing ordinary evaluator and exact-payload hash.
|
|
91
|
+
Prose-free invalidations also use context/2 with an empty recommendation list.
|
|
92
|
+
Store readers must understand context/2 before the producer is upgraded; read
|
|
93
|
+
support and the compatible public reader were delivered before this emission
|
|
94
|
+
change. Existing context/1 records are not rewritten.
|
|
95
|
+
|
|
96
|
+
Preparation and publication share the same bounded two-second planning turn.
|
|
97
|
+
They alternate which goes first; that stage may use the remaining whole turn,
|
|
98
|
+
so a valid operation does not stall merely because it needs more than half.
|
|
99
|
+
The total deadline and the separate numerical-delivery reserve are unchanged.
|
|
100
|
+
|
|
101
|
+
### Explicitly requested context
|
|
102
|
+
|
|
103
|
+
Reading and retaining indexed conversation needs an additional explicit declaration in `_meta/factory-indexed-context.json`, alongside the ordinary context opt-in. It names local job IDs and the exact native sessions approved for that job; nothing is enabled by default, and model output or task prose cannot supply this declaration:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{"schema_version":1,"stores":{"example/store":{"11111111111111111111111111111111":["12345678-1234-4123-8123-123456789abc"]}}}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
When an approved Copilot source's raw log is missing, context preparation can use its native conversation index only if both local and public facts explicitly bind the entire session to one matching job. Permission-denied or unsafe raw paths do not enable an alternate read. The context-only reader opens the native database read-only, checks the native session identity and matching desk directory, and reads no other session. Numeric derivation still never reads message text. The limit is 256 rows, 2 MiB of raw text and a 256 KiB readable projection; over-limit sources are unavailable rather than silently shortened. Unreadable sources defer preparation; a runtime without native SQLite reports unsupported evidence rather than blocking ordinary context indefinitely. Indexed timestamps outside the recorded capture boundary or with unknown format are excluded and counted; retained timestamps are not action clocks and do not reach the model.
|
|
110
|
+
|
|
111
|
+
The bounded ordered request/reply projection is a small owner-only file beside the existing sealed input. The input seals its native-source digest, exact file hash and filename; the model can read the projection directly without searching a large numerical snapshot. Message parts reconstruct the exact text without separators and keep JSON lines below 500 characters, including escaped source text. Both files use the existing private context-input lifetime; deleting the native log does not create a fake replacement log. The whole-source digest includes excluded rows, so source changes or removal invalidate it, while unrelated database rows do not. Altered projection bytes are refused, not silently overwritten. A missing projection can be regenerated only from the still-current native source. Reappearing raw logs take priority. The database folder is never added to the observer's readable directories. Existing opt-in, source seals, independent privacy and publication checks govern all text.
|
|
112
|
+
|
|
113
|
+
The indexed input includes only the approved indexed sessions. Changing sibling sessions are not its evidence and cannot invalidate it. It deliberately excludes the current task card (`task_card_status: scoped_out`); this is not a claim that a card lookup completed or that no card exists. Reading current task progress would not establish what the historical conversation meant. These inputs use private state schema `desk.factory.context-state/2`, so older callers refuse them rather than silently replacing them with an unscoped input. Upgrade the consuming Factory runner before enabling this path. Public records remain context/2.
|
|
114
|
+
|
|
115
|
+
Indexed work is selected only by the explicitly requested command, never the automatic evaluator. Each model invocation gets a fresh private working directory containing only its current supplied input, approved projections, brief and output path. Retained audit directories and the canonical input directory are not granted; current task cards are staged too. Staged source bytes are checked after the model exits, and canonical source/consent is rechecked before launch and acceptance. Removing a job or session from the declaration stops new indexed capture and use; it does not erase retained private audit inputs. Retained copies need their ordinary owner-controlled cleanup. The declaration is permission to process that bounded source, not permission to publish it.
|
|
116
|
+
|
|
117
|
+
Indexed conversation can support a partial documentary explanation and proposal, not verified tool execution, exact time placement or proof of delivery. Published records using it must be partial with `not_recorded`, `unplaced` and `selected_sessions`; interval anchors and waiting events based on that source are mechanically refused. The selected-sessions reason explicitly permits only the listed current source subset in context/2. Ordinary full-source records and legacy context/1 still require the entire bound source set. Every selected fingerprint and anchor remains checked against actual store facts. Readers must keep unplaced chapters off the time grid while retaining the explanation and proposal. A privacy reviewer must reject unsupported outcome or benefit claims rather than approve the worker's reported result as fact.
|
|
118
|
+
|
|
119
|
+
For work a person explicitly asked an agent to execute, `node mcp/scripts/factory.js context-request --store <owner/repo> --job <public-job-id>` runs generation and separate privacy review for one already prepared, source-bound job. The invocation allocates one slot for each phase before starting; background maintenance cannot consume the review slot. The ordinary loop never selects this lane, and stored task prose, status fields or environment flags cannot enable it. A headless model child cannot request another operation.
|
|
120
|
+
|
|
121
|
+
Requested work does not borrow from, reset or enlarge the automatic 30-launch ledger or its triage windows. Read-only admission still checks retained witnesses and legacy dates; missing witnesses beside retained state, or an unsettled set, refuse rather than being repaired or treated as a fresh allowance. It holds the ordinary evaluator lock across both phases, drains serialized child bookkeeping before releasing it, retains consent, subscription/billing checks, source qualification, private evidence freshness, per-phase retry limits and model deadlines, and stops on a failed or stale phase. Its fixed phase slots live in the owning process, not in model-writable files. `status.requested_context` records reservations, actual outcomes and reported usage cost separately; missing cost is `null`. A ready result means the private record completed its independent review, not that it was published or proved useful. Publish through the ordinary `flush` path and verify the actual reader. Never invoke requested mode solely because automatic work reached its cap.
|
|
122
|
+
|
|
123
|
+
### Source and publication checks
|
|
124
|
+
|
|
125
|
+
Within each desk/person namespace, preparation also keeps a protected next-job cursor in `preparation.json`. It resumes saves in stable job order after completed, unchanged or explicitly held work, so hashing early jobs cannot consume every turn. Discovery and publication keep their separate cursors. If a discovered card cannot be saved this turn, discovery revisits that candidate rather than losing it between cursors; every retry still verifies the actual card. A removed next job wraps to the next existing job; malformed progress refuses rather than selecting evidence. This cursor schedules work only: it changes no job mapping, card authority, evidence, model attempt or publication approval.
|
|
126
|
+
|
|
127
|
+
Task-card lookup enriches already source-bound session evidence; it does not
|
|
128
|
+
establish that evidence's job mapping. Its private input records whether a card
|
|
129
|
+
is `associated`, `not_associated` by a completed lookup, or `unavailable` because
|
|
130
|
+
discovery is incomplete. A completed lookup without an association does not
|
|
131
|
+
prove that no card exists. Incomplete discovery keeps its normal cursor and
|
|
132
|
+
deadline; it never supplies a guessed identity, card path or directory access.
|
|
133
|
+
Already-current verified card inputs remain current under their existing
|
|
134
|
+
fingerprint checks, rather than being replaced merely by an incomplete search.
|
|
135
|
+
|
|
136
|
+
Verified session evidence can proceed without optional card enrichment. Both
|
|
137
|
+
the candidate and independent privacy reviewer see its unavailable status.
|
|
138
|
+
Such a published explanation must retain partial coverage with `not_recorded`;
|
|
139
|
+
the parent rejects a complete-coverage claim. Insufficient evidence still
|
|
140
|
+
requires an unavailable record. A later verified card creates a new input basis
|
|
141
|
+
and requires fresh generation and independent review. Consent, source freshness,
|
|
142
|
+
Git limits, model qualification, quotas and publication checks are unchanged.
|
|
143
|
+
|
|
144
|
+
A source change can mechanically replace old wording with a prose-free
|
|
145
|
+
`unavailable` record while a fresh explanation is reviewed. Its privacy verdict
|
|
146
|
+
is `not_required` with a null reviewer, never a fabricated independent approval.
|
|
147
|
+
That form cannot carry a heading or events; any public prose still requires the
|
|
148
|
+
separate approved, hash-bound privacy judgment.
|
|
149
|
+
|
|
150
|
+
The privacy verdict is a judgment, not a guarantee. Mechanical checks also
|
|
151
|
+
refuse unknown fields, path/URL/contact/credential-shaped prose, stale review
|
|
152
|
+
hashes, unrelated sources and unsupported ranges, without echoing input.
|
|
153
|
+
Private log paths, card text and transcript excerpts never belong in public
|
|
154
|
+
evidence references. A fresh independent reviewer must establish that the
|
|
155
|
+
wording is both supported and safe; a keyword scrub is not enough.
|
|
156
|
+
|
|
157
|
+
Context intake initially requires a store maintainer's authenticated authority,
|
|
158
|
+
in addition to the contributor's explicit prose permission. Numeric-only
|
|
159
|
+
contributors cannot opt the store into arbitrary prose. The gate reads facts
|
|
160
|
+
from the tree the merge actually leaves. Reports recheck source freshness and
|
|
161
|
+
withhold outdated wording when the task's sources change, while keeping all
|
|
162
|
+
existing measurements readable.
|
|
163
|
+
|
|
164
|
+
## Local state and commands
|
|
165
|
+
|
|
166
|
+
All factory state lives at `$XDG_STATE_HOME/ouroboros-skills/desk/factory`, or `~/.local/state/ouroboros-skills/desk/factory`. The [outbox](../mcp/src/factory/outbox.js) applies the shared owner-only protections and refuses Git checkouts, symlinks and hard links. Capture, derivation and finalize callers also exclude the canonical bound desk, including unversioned desks and symlink aliases, before creating state. Direct marker reads, sweep and status use the same owned-directory, leaf-protection, 64 KiB and filename/session identity checks. The read retains the protected directory's identity, compares the opened descriptor with the post-read descriptor and current pathname, and rechecks directory/leaf identity before returning data. Leaf repair follows identity validation; corrupt/expired pruning rechecks the same owned directory and leaf rather than adopting a replacement. Markers are local bookkeeping, not published facts: paths, routing warnings and exact hook times never enter a facts file. Prompt fields, assistant text, task titles and tool arguments are not copied into markers.
|
|
167
|
+
|
|
168
|
+
Run commands from the installed Desk plugin root:
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
node mcp/scripts/factory.js account --store ourostack/factory
|
|
172
|
+
node mcp/scripts/factory.js consent --store ourostack/factory --contribute yes --account <login>
|
|
173
|
+
node mcp/scripts/factory.js derive --marker <protected-marker-file> --wait-quiet 30000
|
|
174
|
+
node mcp/scripts/factory.js status
|
|
175
|
+
node mcp/scripts/factory.js flush --store ourostack/factory
|
|
176
|
+
node mcp/scripts/factory.js finalize --job <job> [--job <job> ...]
|
|
177
|
+
node mcp/scripts/factory.js validate-pr --base <base-sha> --head <head-sha> --author-association <value>
|
|
178
|
+
node mcp/scripts/factory.js build --store <store-directory> --out <output-directory>
|
|
179
|
+
node mcp/scripts/factory.js job-link --store <owner/repo> --desk-remote <url> [--person-prefix <prefix>] [--desk <desk-root>] --track <track> --slug <slug> [--this-machine]
|
|
180
|
+
node mcp/scripts/factory.js evaluate --desk <desk-root> --task [desks/<alias>/]<track>/<slug>
|
|
181
|
+
node mcp/scripts/factory.js evaluate-accept --job <job>
|
|
182
|
+
node mcp/scripts/factory.js kaizen-check --store <directory> --repo <owner/repo> [--author <login>]
|
|
183
|
+
node mcp/scripts/factory.js andon --store <directory> --repo <owner/repo> [--author <login>]
|
|
184
|
+
node mcp/scripts/factory.js reconcile --desk <absolute path> --since <time> --until <time> [--store <directory>] [--person-prefix desks/<alias>]
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The [CLI](../mcp/scripts/factory.js) returns one JSON result. `derive` accepts only a marker in the protected marker directory, waits for source quiet for up to five minutes, and then returns `written`, `held`, `skipped`, `not_opted_in`, `log_missing`, `source_unreadable` or `invalid`, with the selected store when known. `flush` makes one delivery attempt and prints `{ result, pr? }`; `finalize` takes one to eight distinct jobs and prints each job's outcome. A Codex marker records no plugins, so one whose route is the public default is held (`held`, reason `route_unverified`) until a Claude Code or Copilot CLI marker for the same desk, within 30 days, also routed by default; a desk that declares its store in `_meta/factory.json` routes Codex at once. The sweep reports the held Codex count as `route_unverified`, and local `status` shows it as `held_markers.route_unverified`. Local `status` includes marker/finalize counts, derivation receipts, routing warnings, the last flush result per store and skipped boot checks; it is not a public report and must not be uploaded as facts. Its receipts carry the binding fields described under "How a session is credited to a task", and `route` (the store the session last positively routed to) and `desk_root` (the session's absolute desk path), and its last flush entries carry `intake_prs` (each pushed intake PR's number and head, `owner:branch`, which names the delivering account); all three are local only and never published. No command prints the machine secret or a token.
|
|
188
|
+
|
|
189
|
+
## How a session is credited to a task
|
|
190
|
+
|
|
191
|
+
A job is one outcome, recorded as one task card. Everything a session tree does while working an outcome belongs to that outcome's job: the main agent, every subagent, and the time spent briefing, waiting on and reading back from them. Mentioning, filing, tidying or updating another card is not working on it. The [binder](../mcp/src/factory/binding.js) and the [focus rules](../mcp/src/factory/focus.js) decide this from the events a deriver reads out of the transcript; those events stay in memory and never reach facts.
|
|
192
|
+
|
|
193
|
+
### Declaring the task
|
|
194
|
+
|
|
195
|
+
The session's main agent calls `task_focus` with a task's `track` and `slug` when it starts or switches to an outcome, or with `clear: true` for a side conversation that belongs to no task. `task_create` with `focus: true` creates a card and declares it in one call; without the flag, a created card does not move focus. Both are declarations, and so is a clear. A subagent never calls `task_focus`: its brief carries a `Desk-Task: <track>/<slug>` line instead.
|
|
196
|
+
|
|
197
|
+
- **The call waits only for admission.** While the Desk server is still admitting, `task_focus` waits up to 2 seconds for it, then answers or refuses. It gains no write authority: it reads the card and writes nothing.
|
|
198
|
+
- **A session with no focus is reminded.** Every task tool result carries a short `focus_note` hint, worded for the main agent, until the session sets a focus or clears it on purpose. `task_update` and `task_archive` on a card other than the focused one carry a hint too. Hints never block a call.
|
|
199
|
+
- **The factory reads the transcript.** Focus is recorded only as the tool call in the transcript, so a session is credited the same way after a resume.
|
|
200
|
+
|
|
201
|
+
### What the binder credits
|
|
202
|
+
|
|
203
|
+
1. **Declared stretches come first.** The main agent's declarations cut the session into stretches. A stretch that names a task belongs to that task, and a stretch that clears belongs to none. A subagent's own `task_focus` call is ignored.
|
|
204
|
+
2. **Inference fills only what nothing declares.** Where a stretch has no declaration, including the start of a session before its first declaration, the binder infers the task from evidence inside it: files written under a task's folder, task tool calls that name it, subagent briefs that name it, commits whose `git add` or `git commit` names a path in its folder, and work in a code repository. Repository evidence counts, within one stretch, only for the one card that lists that repository and has evidence of its own in that stretch. A commit that names no path (`git add -A`, `git add .`, `git commit -am`) counts for nothing, and so does another session's commit that lands while this session's `git commit` runs. Window-only and pathless commits bind nothing. Where inference finds nothing before the first declaration, that stretch goes to the first declared task.
|
|
205
|
+
3. **An inferred segment has a floor.** Within one inferred stretch, a segment shorter than 1 minute joins the longer inferred segment beside it, and a lone segment stays. A declared stretch is never merged or dropped, whatever its length, and a whole short helper session still binds to its job.
|
|
206
|
+
4. **Subagents follow one job.** A subagent belongs to the task on its `Desk-Task:` line when that card exists, else to its parent's job when it is nested, else to the job the main agent held when it spawned it. A background subagent stays with the job it was spawned for, even after the main agent moves on, and a subagent resumed later keeps its job. A subagent's own touches never create a job.
|
|
207
|
+
5. **Touching a card binds nothing.** Creating a card, updating another card's status and committing another card bind nothing. The focused job keeps its own status transitions, and a transition on a card that is none of the session's jobs is not recorded; `reconcile` reports that case as `status_unobserved`.
|
|
208
|
+
6. **A job's segments are always recorded.** A session that binds any job carries segments, even for a single job, so a cleared or unbound stretch is never counted. A job keeps at most 200 segments, and the time the cap took from the task that held it, dropped or given to another task, is kept in the local receipt.
|
|
209
|
+
|
|
210
|
+
### Local receipt fields
|
|
211
|
+
|
|
212
|
+
Each derived session has a receipt in the local `status.json` with these fields. They never reach facts, and an absent value means "not recorded", never `0`.
|
|
213
|
+
|
|
214
|
+
| Field | Meaning |
|
|
215
|
+
| --- | --- |
|
|
216
|
+
| `bound_by` | For each job the main agent is in, `focus` when its time came from a declaration and `inferred` when it came from evidence. |
|
|
217
|
+
| `own_activity` | The spans of the session's own `git commit` calls in the desk and of its successful task tool calls, in milliseconds from the session's start. `reconcile` uses them to tell a session's commits from another session's. |
|
|
218
|
+
| `focus_disagrees` | The declared jobs that hold a stretch where inference finds at least 10 events on another task and none on the declared one. |
|
|
219
|
+
| `segments_capped_ms` | The time the segment cap took from the task that held it: dropped, or given to another task. It is `0` when the binder measured that the cap changed nothing. |
|
|
220
|
+
| `repo_unresolved` | How many directories outside the desk named no repository because repository evidence was not available: the directory is gone or could not be read (reconcile prints it as `repository_evidence_unavailable`). A directory that exists and is cleanly in no repository is not counted. |
|
|
221
|
+
| `checked_route` | The store this Desk last routed the session to on a positive, current route (a desk or overlay declaration, a proven default). Without a current marker, the flush sends the session only to this store; an absent value freezes it. |
|
|
222
|
+
|
|
223
|
+
The receipt also records `binding_version` (8 for this binder; 6 stopped joining two different cards through a Git rename, made a focus on a merged task follow the merge, and made `segments_capped_ms` count handed-over time; 7 added stop facts, ask-tool waits and created PRs of published facts `/4`; 8 separates Claude child executions at native coordinator and completion inputs). A session whose receipt records an older version is derived again by the ordinary sweep, and one that records a newer version is left alone. `binding_version` is the re-derive version, so a bump does not always change the binding: 7 and 8 changed the facts, not which job a worker belongs to. The last version that changed the binding is 6 (`BINDING_RULES_VERSION` in [derive-run.js](../mcp/src/factory/derive-run.js)), and reconcile and capture coverage compare receipts with that one. So a version-6 session whose transcript is gone before it re-derives still reads as bound by the current binder, not as stale. The waste evaluator's stop-facts relabel keys on the receipt value 7.
|
|
224
|
+
|
|
225
|
+
Claude child execution turns start at their initial prompt or a native `coordinator` or `task-notification` input that resumes a confirmed stopped child with no pending tool, including inputs marked `isMeta`. Inputs delivered during a response or tool call preserve continuous execution. A stopped overnight gap is not work. An untimed stopped-child resume closes the prior known turn without inventing the next start and flags `turns` as `source_unreadable`. Compact summaries and system injections do not start execution turns. These child inputs never count as human turns or human waits, and the child's task binding stays unchanged.
|
|
226
|
+
|
|
227
|
+
### Shared sessions
|
|
228
|
+
|
|
229
|
+
A session is shared between jobs only when their segments really overlap. A job with no segments, as in a file written by an older Desk, holds the whole session and so overlaps every other job. A job's time comes from the session's active intervals inside its segments, never from a segment's wall-clock span. A public desk publishes no segments, so a public desk's session that binds several jobs stays marked shared.
|
|
230
|
+
|
|
231
|
+
### Sessions whose capture marker was pruned
|
|
232
|
+
|
|
233
|
+
A marker is pruned after 30 days, which leaves a session with an outbox copy and no marker. Each sweep rebuilds such a Claude Code session from its transcript, but only in a desk that declares its store in `_meta/factory.json`, and only when all of these hold:
|
|
234
|
+
|
|
235
|
+
1. The session's outbox copy is already in the outbox of the store that desk declares.
|
|
236
|
+
2. A desk root is known: the receipt's `desk_root`, or else the transcript's working directory when it is exactly a desk root.
|
|
237
|
+
3. That desk's declaration names the same store. A desk that routes by default is never rebuilt this way.
|
|
238
|
+
4. No store holds a retraction record or a kept copy of the session.
|
|
239
|
+
5. The desk is not a crew desk, so its person prefix is none.
|
|
240
|
+
|
|
241
|
+
Any other session stays frozen, and nothing about it is guessed. The sweep reports how many sessions it rebuilt, how many it left frozen (by reason) and how many are still pending, so a session left behind is visible.
|
|
242
|
+
|
|
243
|
+
## Outcomes: delivery and sign-off
|
|
244
|
+
|
|
245
|
+
A job is delivered when its task reaches `done`, and it is accepted only when the operator says so. The task tools record this on the task card (`signoff`, `flow`, `returns`; see `task-card-format`), and each session's facts carry what the card says about the job, as an `outcomes` list with one entry per job (at most 256). A session that touched more jobs keeps the first 256 by job ID and flags `outcomes` `capped`, so a cut list never reads as the whole one. That flag is published only as `desk.factory.published/3`; the published validator refuses it in a `/1` or `/2` file as `inconsistent`.
|
|
246
|
+
|
|
247
|
+
Published facts are `desk.factory.published/3` only when they carry something only `/3` allows: that `outcomes` flag, or a commit's `at_ms`. Every other file is still published as `/2`, so an unchanged session republishes the same bytes, and `/1` and `/2` files already in a store stay valid. A commit's `at_ms` is the offset on the session clock at which the session recorded the commit; today only Copilot CLI records it (`session_refs.created_at`, the earliest row naming the commit), and only a time inside the session is kept. It is published under the same rule as a controller PR's `at_ms`: only for a desk known to be private and only in a session whose jobs carry segments. It never runs past `session.duration_ms` (`range`), a file marked `{job_offsets, desk_public}` carries none (`inconsistent`), and a `/1` or `/2` file carrying one is `inconsistent`.
|
|
248
|
+
|
|
249
|
+
Local facts. An entry holds the job, the card's revision count (`rev`), the outcome `state` (`not_delivered`, `not_recorded`, `delivered_unsigned`, `accepted`, `refused` or `reopened`), `verified` (true, false, or null when there is no answer), the operator's refusal `reason` (or null), the number of `deliveries`, and the times of the delivery, of the sign-off and of the observation, plus `first_validating_at` and `first_delivered_at` when the card has them. The times stay on the machine. `reopened` means the task was delivered and is back in work without a refusal. `not_recorded` means the card was finished before the record existed; it is never read as accepted.
|
|
250
|
+
|
|
251
|
+
Acceptance. An acceptance recorded through `task_signoff` counts as accepted, recorded by the agent on the operator's word. The factory reads `state` alone: an older entry whose `verified` is true or false and a newer entry with no `verified` count the same way.
|
|
252
|
+
|
|
253
|
+
Published facts. The same entry is published without any time or name: the job (keyed the same way the published `jobs` are keyed for that desk), `rev`, `state`, `verified`, `reason`, `deliveries` and `wait`. `rev` and `deliveries` are cut to 9999, which reads "9999 or more". `wait` is how long the delivery waited for its answer, as one of four classes (`lt_1h`, `lt_1d`, `lt_7d`, `ge_7d`) with a `censored` flag: a delivery with no answer yet has waited at least that long, so its flag is true. A state with no wait has `wait: null`, never a zero. `returns_truncated` and `returns_unreadable` (a count from 1 to 9999) are published when present. A time is never published, and neither is a track, a slug, a title or a person.
|
|
254
|
+
|
|
255
|
+
### Returns and rework
|
|
256
|
+
|
|
257
|
+
A return is any move that sends work back: a refusal, a move out of `done`, or a move below the furthest status the task had reached (`task-lifecycle`, "Returns"). Every return carries a reason the agent gave: `agent_error`, `changed_ask`, `new_information` or `external`. A return the operator caused by refusing also carries the operator's reason, and the entry keeps a `refusal_verified` flag that nothing reads: a recorded refusal counts by its recorded reason. Each entry of the `outcomes` list gains `since` (`created` or `adopted`: a card adopted from before the record has no known start, so it is left out of first-pass yield) and a `returns` list of at most 32 entries, each `{ reason, caught, counts, refusal, refusal_verified }`. `caught` says where the return was found: `in_task` (before the first review), `at_review` or `after_delivery`. `counts` says whether the return counts against first-pass yield: it does not when the deciding reason is `changed_ask`, because a changed ask is not a defect. The deciding reason is the operator's when the refusal recorded one and the agent's otherwise, with no `verified` distinction. When the list is cut, `returns_truncated` is true (published only when true); `returns_unreadable` counts damaged lines, so a damaged card never reads as having no returns. The times of the returns stay on the card and are not in the facts.
|
|
258
|
+
|
|
259
|
+
Published facts carry `since` and `returns` as the local entry has them, with the same four agent reasons, three catch points, `counts`, and the refusal reason and its verified flag, and no time, name or track.
|
|
260
|
+
|
|
261
|
+
## Human attention
|
|
262
|
+
|
|
263
|
+
Facts carry `human_turns`, a list of at most 1,000 entries in time order, so the factory can say how much human attention each accepted outcome cost. An entry is `{ at, basis, window_ms, prompt_class, output_class }` locally and `{ at_ms, basis, window_ms, prompt_class, output_class }` when published, where `at_ms` is the offset on the session clock, the same clock the intervals use. `basis` is `first` (the first human prompt of the session), `after_stop` (the agent had stopped) or `mid_turn` (the agent had not stopped since the previous human prompt). `window_ms` is the gap from the agent's stop to the prompt for `after_stop`, the time since the previous human prompt for `mid_turn`, and `null` for `first`. `prompt_class` and `output_class` are size classes of a character count: `none` is 0, `xs` 1 to 20, `s` 21 to 200, `m` 201 to 1,000, `l` 1,001 to 5,000 and `xl` above 5,000. No prompt text, command, path or reply text is held, only the class. A session over the limit keeps the first 1,000 entries and flags `human_turns` `capped`.
|
|
264
|
+
|
|
265
|
+
What a human turn is, per host:
|
|
266
|
+
|
|
267
|
+
- **Claude Code.** A human turn on Claude Code is a root prompt line whose `origin.kind` is `human`. The interrupt marker, a headless prompt, a scheduled task, a subagent's report and any line a hook or a tool result wrote are not human turns. A session where none carries an origin flags `human_turns` `field_absent` and writes no list, so a transcript from a host version that wrote no origin never reads as having no human turns; a mix flags `host_records_partly`. A queued prompt counts as `mid_turn`: the human typed it while the agent worked, so a `mid_turn` window is not human wait time, only the time since the previous prompt. The size of a reply is the text of the root assistant lines since the previous human turn, with no thinking, tool use or subagent lines.
|
|
268
|
+
- **Copilot CLI.** A human turn is a root `user.message` with no `source`, not an autopilot continuation. The agent's stop is the last root turn end with no root turn start after it. Nothing proves that a `user.message` with no `source` was always typed by a human, so every Copilot list is flagged `host_records_partly`: the list is kept, and the figure is not proven complete or exact.
|
|
269
|
+
- **Codex.** The log does not mark which prompt a human typed. Codex is flagged `host_does_not_record` and writes no list.
|
|
270
|
+
|
|
271
|
+
A prompt dated before the last kept turn is dropped and flags `source_unreadable`: moving a time would make up a fact, and one skewed line must not void the whole session. So is a prompt dated before the agent stop that comes before it: its wait would read as a measured zero. A human prompt with no readable time, an unreadable line, and a log that ends mid-record flag `source_unreadable` or `log_truncated` too, and the list is then a lower bound.
|
|
272
|
+
|
|
273
|
+
What cannot be known. No host records how long a person read a reply or how long they typed, and none records whether the person read while the agent was still writing. The estimate is built from the size classes and the gap the host shows, so it is an estimate and never a measurement. A permission decision is not a human turn: only Copilot records its wait, and Claude Code and Codex record none.
|
|
274
|
+
|
|
275
|
+
The estimator (method version 1) is a pure function of one entry, and it refuses an entry it cannot read:
|
|
276
|
+
|
|
277
|
+
`estimateTurn(turn) = max(FLOOR_MS, min(turn.window_ms ?? Infinity, READ_MS[turn.output_class] + TYPE_MS[turn.prompt_class]))`
|
|
278
|
+
|
|
279
|
+
| Constant (ms) | `none` | `xs` | `s` | `m` | `l` | `xl` |
|
|
280
|
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
281
|
+
| `READ_MS` (reading the reply) | 0 | 1,000 | 5,000 | 30,000 | 150,000 | 400,000 |
|
|
282
|
+
| `TYPE_MS` (writing the prompt) | 2,000 | 3,000 | 25,000 | 150,000 | 180,000 | 180,000 |
|
|
283
|
+
|
|
284
|
+
`FLOOR_MS = 1,000`, `PERMISSION_MS = 5,000` and `ATTENTION_METHOD = 1`. Reading is taken at about 50 ms per character of a representative reply for the class (1,250 characters a minute). Typing is taken at about 300 ms per character (40 words a minute) up to class `m`; classes `l` and `xl` are treated as mostly pasted and held at 180 seconds. A permission decision is `max(FLOOR_MS, min(wait, PERMISSION_MS))` and is reported beside the headline, not in it. The store recomputes every figure from the entries, and changing any constant raises the method version, so a figure is only compared with figures of its own method version.
|
|
285
|
+
|
|
286
|
+
Each turn belongs to the job whose segment holds its `at_ms` (the segment that started last when several do). A turn in no segment is unattributed, and a turn in a session whose jobs publish no segments is unplaced when the session has jobs and unattributed when it has none. Nothing is dropped, and every turn stays in the headline.
|
|
287
|
+
|
|
288
|
+
The headline, human attention per accepted outcome, is the sum of the estimates over every human turn of every session in the period, divided by the jobs accepted (recorded by the agent on the operator's word), including turns on jobs that were refused, are unsigned or were never delivered. The headline has three states, and the figure always carries its `state` and `reasons`. It is measured when every session in the period kept a complete list. The headline is partial, printed as a lower bound, when some session in the period flags the field (Codex sessions and every Copilot session do), or a session was cut by the limit; a partial figure is a lower bound on the total. It is unavailable when no session in the period kept a list (`no_turn_records` when no session is in the period, `turns_not_recorded` with the host's own reason otherwise), and no total is published then. It is also unavailable, with no total, when every turn is unreadable (`turn_not_estimable`). It is unavailable, with the total still published when a list exists and a turn could be estimated, when no verified acceptance exists (`no_accepted_outcomes`); the total is shown as "at least" when partial, and the headline shows no value and is never zero. A turn the estimator cannot read is counted, adds no time and gives `turn_not_estimable`; when every turn is unreadable the time is left out. Sessions in the old `/1` format carry neither list nor flag, so they are outside the period: coverage pages no longer count them under human turns, and their per-job result still reads `not_recorded`.
|
|
289
|
+
|
|
290
|
+
## Why the agent stopped, created pull requests and finish days
|
|
291
|
+
|
|
292
|
+
Published facts `/4` carry three things the factory needs to show a task on its own clock and say why it waited. Each value is derived when the session ends, so none of them needs the transcript later; the waste evaluator, which reads the session log itself, still does.
|
|
293
|
+
|
|
294
|
+
**Why the agent stopped.** Each `human_wait` interval carries `stop: { end, asks, pending_agents }`. `end` is how the agent's turn ended before the wait: `end_turn`, `max_tokens`, `rate_limit`, `api_error`, `refusal`, `interrupted`, `ask_question`, `ask_plan` or `not_recorded`. `asks` is whether the agent's last reply text ended in a question mark (`null` when the turn had no reply text), and `pending_agents` whether the agent's own background agents were still running (`null` when the host does not say). Only the last character of the reply is looked at, and nothing else of the text is read or kept.
|
|
295
|
+
|
|
296
|
+
- **Claude Code.** `end` comes from the turn's last root reply: its `stop_reason` (`end_turn` or a stop sequence is `end_turn`; `max_tokens` and `refusal` are themselves; `tool_use`, a thinking line's empty reason or an unknown reason is `not_recorded`), or, when the turn ended on an API error, `rate_limit` for a 429 or a `rate_limit` error and `api_error` otherwise. The wait the interrupt marker ends, and the wait after it while the agent did nothing, are `interrupted`. `pending_agents` comes from the turn's `system/turn_duration` line: `true` when its `pendingBackgroundAgentCount` is above zero, `false` when the line has no count (the host writes the count only when it is above zero: on the operator's transcripts, from 2.1.274 to 2.1.290, it never appears as 0), and `null` when the turn has no such line. A root `AskUserQuestion` or `ExitPlanMode` call that got an answer is also a `human_wait` spanning the call, with `end` `ask_question` or `ask_plan` and both flags `null`; the call stays a tool interval too, and the reports decide how its time counts. A subagent's call is not a wait on the operator.
|
|
297
|
+
- **Copilot CLI.** `end` is `interrupted` when the root logged an `abort` after its last turn started. Otherwise, when the root logged a `session.error` or a failed model call after its last turn started and wrote no reply after it, `end` is `rate_limit` for status 429 or an error type of `rate_limit` or `quota` (Copilot logs a used-up quota as status 402), and `api_error` for any other error. Otherwise `end` is `end_turn`. On this machine's logs (2026-10-08), every root error was followed by the session's shutdown, not by a prompt, so no wait carries an error end yet. `asks` comes from the last root `assistant.message`; `pending_agents` is always `null`.
|
|
298
|
+
- **Codex.** Codex writes a `human_wait` between turns but no stop facts, so each of its waits publishes `end: "not_recorded"` with both flags `null`.
|
|
299
|
+
|
|
300
|
+
A session derived before stop facts were recorded publishes each wait with `end: "not_recorded"` and both flags `null`.
|
|
301
|
+
|
|
302
|
+
**Created pull requests.** `refs.prs[].created` is `true` only when the session's own call created the pull request: a Claude Code `gitOperation.pr` with action `created` (in the root or a subagent's transcript), or a Codex or Copilot CLI `gh pr create` that finished with exit code 0 and printed the pull request (a failed create can still print an existing pull request's URL). A pull request Claude Code knows only from its `pr-link` line is `false`, because that line is also written for pull requests the session only looked at: on the operator's transcripts, read for event codes only on 2026-10-08, 62 of the 131 pull requests a session knew only from a link were first linked more than two minutes after GitHub created them, and 4 were created before the session began. For Copilot CLI, only the first pull request URL in that call's result is read; the rest of the result is not. On the operator's Copilot logs, read the same way on 2026-10-08, all 60 such calls printed a pull request that GitHub had created 0.8 to 8.8 seconds before the result. Every other pull request in Copilot's session store is `false`. A desk that withholds its job timing publishes `false` for every pull request.
|
|
303
|
+
|
|
304
|
+
**Finish days.** A job whose card was seen `done` or `cancelled` publishes `finished_on`, the UTC day of the session's own last move of the card into that status (`finished_basis: "transition"`), else of the card's `updated` time when the session saw it (`"card_updated"`, an upper bound). An `updated` time that is not after the card's `created` time was never restamped after the card was made, so it never dates a finish: the session's own last move into the status is used if there is one, and otherwise the job publishes no day. It needs a readable card creation time, because the same source must also be published on the task clock. An open job, a job without that time, and every job of a desk that withholds its timing publish `null` for both. A day before 2025-01-01, or after the day the flush runs, is withheld, because the store would refuse it. The day comes from the local file alone, so a session whose transcript is gone still gets one the next time its facts are published.
|
|
305
|
+
|
|
306
|
+
## Waste labels
|
|
307
|
+
|
|
308
|
+
When a task reaches `done` or `cancelled`, `task_update` (or `task_archive`) itself records an evaluation request at `evaluate-requests/<job>.json`, the same way and on the same opt-in gate it already records a finalize request — because the session that finished the job is usually not derived until it ends, this is a record only, not a prepared brief. Both terminal statuses request one: a cancelled job is still a finished job (see "Only finished jobs count" below), and the waste in it is exactly what the evaluator needs to see. `evaluate --pending`, which the loop's evaluate step runs (see [The improvement loop](#the-improvement-loop)), prepares every retained request's briefs, and the plugin then runs the evaluator headlessly on a subscription sign-in. An interactive agent that retries a job handles the answer as `desk:session-start` (its `details.md`, "Factory lines") says: when the answer is `ready`, it starts a fresh `desk:observer` subagent in the background with only the brief paths. `evaluate --task <track>/<slug>` remains available to record and prepare one task's request directly, for example a task finished before this wiring existed. A request is cleared once every session of the job has settled labels, or has its labels held back because its facts are quarantined. Labels are settled while the evidence they were made against still stands: accepted labels record a fingerprint of the job's own share of the session, the facts intervals that overlap it and the stop hints (`labels-basis/<store>/<job>/<session>.json`), so a job that finished in a session that runs on for days is labeled at its finish, and again, at most once a UTC day, only while that session's facts are derived again with different evidence for the job (a share that keeps growing under a held focus is relabeled daily until the session ends). Labels whose evidence changed during the run (a session that ended mid-run) are kept but leave the job wanting labels. Labels recorded before the fingerprint was kept follow the old rule (an open session is labeled again, an ended one stands). Labels of an older rubric are labeled again while the session's log is still on disk and its facts were derived with stop facts (derive receipt `binding_version` 7 or later), and stand otherwise. A request is and moved to `evaluate-requests/expired/` after 30 days or to `evaluate-requests/quarantine/` as `not_opted_in` when its stores lose consent. Before each sweep the loop's evaluate step also asks for every finished job that needs labels and has no request, expired request or quarantined request (`requestFinishedJobs`): a job whose latest observed card status is `done` or `cancelled` and that has a labelable session whose labels are missing or no longer settled, by the rule above. A session held back behind quarantined facts is passed over; the job's other sessions still count. This is the backstop for a request the done step never recorded and for one settled while its only sessions were held back behind quarantined facts that were later released; its request records the card's observed time as `finished_at`. It is also how already-labeled finished jobs are relabeled under a new rubric and how labels follow facts derived again: a job whose request expires is never asked for again. The requests it records carry the evaluate step's own start time, so they never make the step due once more. Without factory state or consent, `evaluate` answers `not_opted_in` and creates nothing. The observer labels each session's waste with the [factory-evaluator rubric](../skills/factory-evaluator/SKILL.md) and never sees the working agent's conversation. Neither status waits for it.
|
|
309
|
+
|
|
310
|
+
- **`evaluate`** computes the task's job ID exactly as the task tools do and, for each of the job's sessions (from the jobs index) that a store with consent holds, writes one brief to `evaluations/<job>/<store-slug>/<host>-<session-id>.brief.json` in the protected state folder. It answers `ready` with the brief paths, `not_opted_in` when no store has consent, or `no_sessions`. A session whose ID is not a version-4 UUID gets no brief, because its labels could never be published. Neither does a session whose facts are quarantined, even facts too broken to read: its labels could only ever travel with those facts, so its labels key is quarantined instead, as `facts_quarantined` with the quarantined facts file's name in the record's `facts` field, and the session counts as settled.
|
|
311
|
+
- **The brief** ([evaluator](../mcp/src/factory/evaluate-run.js), `desk.factory.evaluator-brief/2`) holds the job, the session, the plugin version and rubric version the labels must carry (rubric 4 only when the session's derive receipt is `binding_version` 7 or later, so its facts carry stop facts; rubric 3 with no stop hints otherwise, so labels never claim stops were classified on facts that cannot show them), the host's session log path from the session's marker (or `null` when the marker or the file is gone), the session's start as the clock origin, the session on the published clock, one stop hint per human wait (`stops`: the wait's range, its stop facts from the local facts or `null`, and the class a rule gives them or `null` when the evaluator decides), the `unavailable` codes that apply and the output path. Its intervals come from the same code that publishes facts (`publishedClock`), so evidence copied from them matches the store's facts. The brief stays on this machine. A session whose part for the job the store cannot place (the job's own share is unknown: a subagent-only binding, or one of several bindings without segments) is never briefed and needs no labels, so no empty labels file stands for it. Each preparation removes every brief file of the job it did not write in that pass, with its answer, so a brief of an older rubric or plugin version is never left for a run.
|
|
312
|
+
- **`evaluate-accept`** checks each answer against a brief rebuilt from the session's own local facts and marker, never the brief file the evaluator can edit; facts that are gone are refused as `facts_missing`. The checks are: JSON within the facts size cap, the current labels schema (`desk.factory.labels/3`, else `schema_outdated`), the brief's job, session, plugin version and rubric, on the file, every stretch and every stop (`job_mismatch`, `session_mismatch`, `evaluator_mismatch`), every `unavailable` code the brief names and no false `facts_missing` (`inconsistent`), a known share for the job (`share_unknown`), at least one stretch while the job's share holds a facts interval (`inconsistent` at `stretches`), and the store's own evidence, range and stop checks against the brief's intervals with each wait's stop facts from the hints (`evidence_unmatched`, `range`, and `inconsistent` for a stop on a wait a rule decides). Each session comes back `accepted`, `missing`, `rejected` with `{ code, path }` errors (including `too_large` and `unsafe_file` for an answer file that cannot be read), `not_opted_in` or `invalid_brief`. No result echoes anything the evaluator wrote. Accepted labels are rebuilt field by field, written as canonical bytes to `labels/<store-slug>/<job>/<session-id>.json` in the protected state folder, and the brief and answer are removed. A rejected answer never enters the outbox.
|
|
313
|
+
- **Delivery.** Local labels are already on the published session clock, as offsets from the session's start, never times of day. `toPublishedLabels` maps them to `labels/<job>/<session-id>.json` in the store and keys the job ID exactly as the facts transform does for a desk that is not known to be private. `pendingLabels` lists labels whose published bytes the store has not received, recorded in `delivered/<store-slug>.json` under `labels/<job>/<session-id>.json`.
|
|
314
|
+
|
|
315
|
+
## Store-side validation and reports
|
|
316
|
+
|
|
317
|
+
`validate-pr` judges exactly what merging the head into the base would land. It builds the merge result with `git merge-tree --write-tree` (Git 2.38 or later; an older or unreadable Git fails with `git_too_old`, and a merge-tree failure other than a conflict with `merge_tree_unavailable`, both without a result), lists changes as the base against that tree, and reads bytes through `git show` and `git ls-tree`. It refuses a head whose merge conflicts (`merge_conflict`) and a head that carries merge commits not already on the base (`unexpected_merge`). A `base...head` diff would read only one merge base, while the merge uses all of them, so a crafted head could otherwise pass while its merge changed something else. It never checks out, imports or executes candidate-controlled files. Contributor changes are limited to at most 500 added or modified data files of three kinds: published facts at `facts/<host>-<session-id>.json`, published labels at `labels/<job>/<session-id>.json` and the machine's capture record at `capture/<intake id>.json` (see "Capture coverage"). Each facts file must pass the canonical published-bytes gate, match its filename identity, preserve host/session identity when modified and never reduce `session.duration_ms`. Validation output contains only stable reason codes and safe paths. Any change that is not a published facts or labels file, including any other file under `facts/` or `labels/`, is accepted only for GitHub author associations `OWNER`, `MEMBER` or `COLLABORATOR`, and is marked as maintenance for the store workflow to leave unmerged. Only an author association of `OWNER`, `MEMBER` or `COLLABORATOR` may delete a facts or labels file (a retraction, see below): such a delete at those two path shapes validates with no content to check and is not maintenance, a delete at any other path is maintenance, every other author's delete of a facts or labels file is rejected as `removal` (a delete at any other path is rejected as `path`, or `removal_path` from `validatePr` itself), and a rename is still rejected. A modified facts file's previous bytes are read at the base, and its new bytes in the merge result.
|
|
318
|
+
|
|
319
|
+
A labels file holds an independent evaluator's waste labels for one job's session, in the exact [labels schema](../mcp/src/factory/label-schema.js), `desk.factory.labels/3` (files in `desk.factory.labels/1` and `/2` stay valid as they are). It carries the job and version-4 session IDs, the evaluator, a list of stretches, a list of stops (`/3` only), and a list of what the evaluator could not read. Nothing in the file is free text:
|
|
320
|
+
|
|
321
|
+
- **Evaluator.** `plugin_version` is a Desk version such as `1.0.0` or `3.2.0-alpha.58`: three numbers of at most three digits, optionally followed by `-alpha.N`, `-beta.N` or `-rc.N`. `model` uses published facts' own model-ID validator: a token of at most 80 characters with no spaces, with no date, time of day or credential-shaped value. `rubric` is the rubric version as a digit string from `1` to `999`.
|
|
322
|
+
- **Stretches.** Each stretch is a `[start_ms, end_ms)` span on the session clock with a `class` of `value`, `support` or `muda`, a `waste` that names one of the eight classic wastes for `muda` and is `null` otherwise, `mura` and `muri` flags, and at least one evidence range. Stretches are listed in start order and never overlap. A `/2` stretch also carries the evaluator's `confidence` in the label (`high`, `medium` or `low`) and the `evaluator_version` that assigned it (never newer than `evaluator.plugin_version`, else `inconsistent`), and may be `class: "unknown"` with `waste: "unknown"`: time the evaluator looked at and could not tell. The rollups keep `unknown` as its own row of the waste Pareto: it counts in the waste and unknown time every row's share is taken of (value and support time are not in it), but not in `muda_time_ms` or any `muda_time` measure, because it is not known to be waste. Each Pareto row lists the `evaluator_versions` of the labels behind it and, when every one of them recorded a confidence, `confidence_ms: { high, medium, low }`, which adds up to the row's `total_ms`; a row a `/1` label speaks to has no `confidence_ms`, so it reads as not recorded and is never counted as high. The evaluator's accept step takes only current answers (`/3`, else `schema_outdated`), with the brief's version on every stretch and stop. An evidence range may cite any interval of the session, not only one inside its own stretch; a defect stretch may rest on an earlier failed tool call, for example.
|
|
323
|
+
- **Stops.** A `/3` file lists why the agent stopped before each human wait the evaluator classified (the brief hints only the waits that overlap the job's own share, none when the share is unknown, and Desk keeps no stop on another wait): `{ wait, why, confidence, evaluator_version }`, where `wait` is one `human_wait` interval's `[start_ms, end_ms]` copied exactly and `why` is `decision`, `approval`, `acceptance`, `question`, `stopped_short` or `unknown` ("could not tell"). Stops are listed in wait order (`order`), at most one per wait (`duplicate`), never newer than the file's evaluator (`inconsistent`) and empty with `facts_missing` (`inconsistent`). The waits a rule classifies from their stop facts (`max_tokens`, `rate_limit`, `api_error` and `refusal` as `error_limit`, `interrupted`, `ask_question` as `question`, `ask_plan` as `approval`; `STOP_RULES`) are never the evaluator's: a stop on one is `inconsistent` at its `why`. Stops describe waits, which are idle time, so they never enter class or waste totals; evaluator labels still describe working time only. A `/2` file has no stops and stays valid; rubric 4 replaces rubric 3 by the existing replacement rule.
|
|
324
|
+
- **Unavailable.** `unavailable` uses a closed set of codes. `session_log_missing` means the host's session log was gone or unreadable, so the labels rest on the facts alone. `facts_missing` means the job's local facts were missing, so the file carries no stretches.
|
|
325
|
+
|
|
326
|
+
The gate reads that session's facts file, `facts/<host>-<session-id>.json` for either host, from the tree the merge would leave. It reads the file in the merge result when the merge adds or modifies it, treats it as absent when the pull request removes it, and otherwise reads it at the base tip, so labels whose branch predates their facts pass once the facts reach `main`. Exactly one such file must exist (`facts_missing`, `facts_ambiguous`) and pass the published-facts gate (`facts_invalid`); labels that declare `facts_missing` need no facts file, but one that exists is still checked. The labels must name a job that file binds (`job_unbound`), every stretch and every stop's wait must end within the session (`range`), every evidence range must equal one interval's `start_ms` and `end_ms` exactly (`evidence_unmatched`), every stop's wait must equal one `human_wait` interval exactly (`evidence_unmatched`), and a stop on a wait whose `stop.end` a rule decides is `inconsistent`. Evidence names time ranges rather than list positions, so labels stay valid when a still-running session is re-derived and grows. The job and session inside the file must match its path (`job_mismatch`, `session_mismatch`). Anyone may replace a labels file, but only with labels from an evaluator whose plugin version and rubric are both no lower than the ones it replaces (`evaluator_downgrade`); the previous bytes are read at the base.
|
|
327
|
+
|
|
328
|
+
A public store receives a plugin's name and version only when the plugin was installed from a public repository; the flush resolves each source's visibility, and the store's own, with the references', and never publishes the source itself. Every other plugin, including one with no known source, and every plugin when the store's visibility is unknown, is counted in `refs.private.plugins`. A store known to be private or internal, an organization's work store, receives every plugin's name. `refs.private.plugins` is optional in the published schema, so files published before it existed stay valid.
|
|
329
|
+
|
|
330
|
+
Published facts and labels share one refusal for secrets. Model IDs, plugin names and PR and commit repository names are refused as `credential_like` when they start with a token prefix such as `ghp_`, `github_pat_` or `sk-`, or hold a 16-character or longer hex or letter-and-digit run, a password value or an IPv4-looking run. The factory keeps its own copy of Desk's credential rules, and a test holds the two in parity. The rule can also refuse a real name: a repository such as `acme/build2026Q3release` holds a 16-character letter-and-digit run, so a facts file that names it is refused as `credential_like`.
|
|
331
|
+
|
|
332
|
+
`build` reads regular files directly under `facts/` and `labels/<job>/`, validates them again, sorts every key and collection explicitly, and replaces the output directory with deterministic `README.md`, `index.md`, `jobs/<job>.json`, `jobs/<job>.md` and `rollups/` bytes. It reads no wall clock. A store without `facts/` has zero sessions and publishes an empty index. Dotfiles such as `.gitkeep` are ignored; any other entry that is not a published facts file stops the build with a stable code (`invalid_facts_entry`, `facts_entry_not_regular_file`, `facts_not_directory` or `invalid_published_facts`), and so does any entry under `labels/` that is not a labels file in a job directory (`invalid_labels_entry`, `labels_not_directory`) or that fails the labels gate or names another job or session than its path (`invalid_published_labels`). This matches the facts policy: `validate-pr` gates what merges, so such a file means the store was changed around the gate, and a future labels schema version needs a matching build before labels in it can merge. A labels file that passes but no longer matches its session's facts, for example because the facts were re-derived, is not used and is counted in the rollups' coverage by reason (`evidence_unmatched`, `range`, `job_unbound`, `no_facts`, `facts_ambiguous`, or `facts_missing` when the labels declare it). Sessions with a job offset are placed on the job clock; sessions without one still count toward coverage and signals but do not enter the timeline. The classed formulas cover lead time, queue, active and busy time, parallelism, concurrent sessions and agents within a job, wait unions, flow efficiency, rework signals and unavailable first-pass yield.
|
|
333
|
+
|
|
334
|
+
Missing data is never a measured zero. A wait total or the API-retry signal is `unavailable` with the declared reason when every contributing session lacks its field (`human_waits`, `permission_waits` or `api_retries`), and is marked `partial` with the count of uncovered sessions when only some do. A `turns` or `tool_durations` gap (a dropped interval, a cap, a log cut mid-record, an open session's unfinished turn or tool call) means only some intervals are missing, so it makes the active-time family partial, a lower bound, and never unavailable: one long session's few lost intervals must not blank the working time of every task it served. An interval the publishing transform drops because it ran outside the published session clock, most often a subagent still working after the main log's last line, is flagged `interval_outside_session_clock`, which leaves every figure it reaches partial, never unavailable, as `host_records_partly` does. Flow efficiency and the "What mattered" shares use activity and waits clipped to the job clock's `[0, lead]` window, so no share exceeds lead time; work before the task card is reported separately as active before card. Busy time is the plain sum of turn, tool and subagent intervals, so a tool call inside its own turn counts twice and parallelism measures overlapping recorded work, not concurrent agents. Status follows the latest transition once any terminal one exists, and a transition without an offset never supplies a lead time. A job whose latest transition reopens it after `done` is open again: its lead time and flow efficiency are censored at the latest session end like any open job's, and the earlier `done` stays in its transition history. Once such a job closes again, its lead time ends at the `done` that begins its final terminal stretch, the first `done` after the last reopen; a job closed only once is unaffected.
|
|
335
|
+
|
|
336
|
+
The [rollups](../mcp/src/factory/pipeline/rollups.js) answer which waste costs the most across jobs, with no who and no when. Jobs are grouped by plugin version, host, job class and waste type, never by contributor. A job's plugin version is the Desk version all its sessions report (`unknown` when any session reports none, including a session whose Desk install source was not known to be public, `mixed` when they disagree), and its host is the one host of all its sessions (else `mixed`). Published facts carry neither the task card's `kind` nor milestone 4's organization signal, so every job's class is `other` and `search_waste` is unavailable with reason `not_in_published_facts`; `coverage.json` records both.
|
|
337
|
+
|
|
338
|
+
- `rollups/muda.json` is a Pareto of muda time by waste type, largest first with ties broken by waste name, overall, per job class and per plugin version, with each waste's share, cumulative share and job count. Muda time comes from labels: a finished job counts only when every one of its sessions has usable labels for it, and a waste the evaluator did not find is then a measured zero. Each session's labeled waste counts once in any one total, even when the session is bound to several jobs (the labels of the first such job by job ID are used); each Pareto reports the labeled sessions it summed and how many of them several jobs share. A job with some sessions labeled is excluded as `partial`, and one with none as `not_labeled`. A group without a fully labeled job has no Pareto, and a Pareto with no muda has no shares.
|
|
339
|
+
- `rollups/measures.json` gives the measure catalog's median, 75th percentile and counted jobs overall and per plugin version, host and job class: `lead_time`, `queue_before_start`, `active_time`, `flow_efficiency`, `human_wait`, `permission_wait`, `api_retry_wait`, `tool_failures`, `tool_retries`, `api_retries`, `compactions`, `retouches`, `muda_time`, `muda_time.<waste>` and `search_waste`. It lists andon's quality measures: `tool_failures`, `tool_retries`, `api_retries`, `retouches` and `muda_time.defects`.
|
|
340
|
+
- `rollups/tool-kinds.json` sums calls and failures per tool kind over every session with facts, each session once, most failures first.
|
|
341
|
+
- `rollups/coverage.json` counts unattributed sessions and their session time, and labels files used and unused by reason.
|
|
342
|
+
- `rollups/index.md` renders all four.
|
|
343
|
+
|
|
344
|
+
Only finished jobs count. A job is finished when its status is `done` or `cancelled` and its lead time is not censored; every measure of any other job, including a job reopened after `done`, is excluded as `open_job`, because its totals so far are right-censored and the newest plugin version always has the most open jobs. Each group reports its open jobs. Only complete values count. A finished job's value is excluded when the formulas mark it unavailable or `partial`, and each measure lists its exclusions by reason; a measure no job supplies has no median, never a zero. Medians and p75 use the nearest-rank method: sort the counted values ascending and take the value at 1-based rank `ceil(p × n)`, so the result is always a measured value. Output is byte-stable: JSON keys are sorted and every list has an explicit order.
|
|
345
|
+
|
|
346
|
+
### Lifecycle clocks
|
|
347
|
+
|
|
348
|
+
Each job file (`jobs/<job>.json`), its `rollups/tasks.json` row and its `rollups/stackup.json` row carry one additive `clocks` envelope from [lifecycle-clocks.js](../mcp/src/factory/pipeline/lifecycle-clocks.js), and each job page states it after the lead time. The legacy `lead_time_ms`, its floor and its basis keep their meaning; the acceptance wait stays in `formulas.signoff.wait` as its coarse class and is not a clock. Every clock is `{ class, state, value?, reasons, basis, bound?, bound_reason?, so_far }` with `basis` from a closed list (`recorded_activity`, `done_transition`, `terminal_observation`, `recorded_work_end`, `latest_observation`, `lifecycle_history`, `original_request_not_recorded`). All times are offsets on the job clock; no new date or epoch time is published.
|
|
349
|
+
|
|
350
|
+
- `request_to_delivery_ms` and `queue_ms` are always unavailable, `original_request_not_recorded`: published facts carry no proof of when work was first asked for, and an adopted card or a card made after work began would otherwise read as a short or negative queue. Work recorded before the card adds `work_before_card`. Card creation, the first recorded work and any prose are never used as the request.
|
|
351
|
+
- `production_ms` sums the production episodes in `production_periods`. An episode starts at the first corrected recorded work (every worker of the task once, ask-tool and labeled waits taken out as the walk does) and ends at a timed `done` transition. A timed reopen starts the next episode at the first work after it; the time between a delivery and a reopen is in no episode. A repeated `done` opens nothing. Only the delivering turn's short tail, work already under way at the `done` that ends within 15 minutes of it, is clipped there. An open job's last episode runs to the latest placed session end or timed observation, `so_far`, a lower bound (`censored`). A delivery seen only as the card's timed `done` observation is an upper bound (`finish_from_card_update`); a `done` with no time runs to the end of the recorded work, a lower bound (`finish_time_not_known`).
|
|
352
|
+
- `active_in_production_ms` is the corrected working time inside the episodes, and `production_remainder_ms` is the rest of the production time. An episode ending at the card's last update makes the active time an upper bound too, and a delivered episode with no recorded work makes production a lower bound (`no_active_intervals`). A job whose final `done` has no time, with nothing timed and not terminal after its last reopen, is done, not open: its last episode runs to the end of its recorded work. A timed move away from a `done` with no later `done` counts as a reopen only when recorded work follows it and the card's latest timed observation is not still that `done`; otherwise the history contradicts itself, so the production clocks are unavailable (`episode_boundary_not_recorded`) and the job is not called open. A card observation is recorded to the whole second, so it is ordered after any transition in that same second. The remainder is not by itself idle time or waste. Where production is known, the two add up to it.
|
|
353
|
+
- The production clocks are unavailable, never zero, for work after a delivery with no recorded reopen, read from the corrected working time and from every raw active interval's start (`late_work_without_reopen`), a transition with no time or a reopen seen only in a later observation (`episode_boundary_not_recorded`), lost job offsets, an unplaced session or a capped transition list (`episode_history_incomplete`), a cancelled job, an unread status, unread activity, or no recorded work.
|
|
354
|
+
- Coverage is joined per measure from four separate inputs: interval capture, label coverage, session placement and lifecycle history. Label coverage never stands in for captured intervals. Lost intervals make the active time a lower bound; partial labels make it an upper bound; when the production and active directions pull the remainder both ways, its `bound` is `null` with `bound_reasons_conflict`.
|
|
355
|
+
|
|
356
|
+
The store's readers ([ourostack/factory](https://github.com/ourostack/factory) `site/src/steps.js` `readLifecycleClocks`) validate this envelope and never derive episodes themselves. The synthetic cases in `tests/desk/mcp/__tests__/factory/fixtures/v12-clocks.json` are byte-identical to the store's paired fixture.
|
|
357
|
+
|
|
358
|
+
### The kaizen check
|
|
359
|
+
|
|
360
|
+
In a job that can write issues but not code, the store's build runs `factory.js kaizen-check --store . --repo <owner/repo>` with the workflow token in `GH_TOKEN` ([kaizen.js](../mcp/src/factory/pipeline/kaizen.js)). A kaizen card is an open issue labeled `kaizen` whose body holds one fenced `yaml` block with `kaizen: 1`, a `signal` from the measure catalog, a `job_class` (`any`, or a class the store fills), optional `evidence_jobs`, an optional `countermeasure` pull request URL, the `plugin`, the `version` that first carries the countermeasure (empty until it ships) and a `hypothesis` naming a measure and a direction (`down` or `up`). For each card with a version, the check takes the finished jobs of that class whose every session ran the plugin at that version or later (after) and those whose every session ran an earlier version (before); jobs whose sessions straddle the version are left out as `mixed_versions`, jobs without the plugin as `plugin_not_reported`, and any job's excluded measure under its own reason. Versions order by semantic-version precedence, as Desk's release checks do.
|
|
361
|
+
|
|
362
|
+
The [comparison](../mcp/src/factory/pipeline/compare.js) treats jobs that share a session as one independent group, because the per-job measures count that session's events in each of them; it reports each side's jobs, groups and median (nearest rank), the change in median (after minus before) and its 95% cluster-bootstrap interval from 10,000 resamples of the groups, seeded with the card's number so every build reproduces it. A side enters the comparison only when a distribution-free 95% interval for its median can exist: with n independent groups the chance that all of them fall on one side of the true median is 2 × 0.5^n, which must be at most 5%, so each side needs at least 6 groups. The code derives that minimum from the confidence level rather than storing it. Below it there is no interval and no verdict, whatever the values. The card gets `confirmed` when the whole interval lies in the hypothesis's direction and `not-confirmed` when it lies wholly in the other. Otherwise it carries neither, and the comment says which of two things holds: "not enough independent jobs yet" (no interval) or "no clear change so far" (the interval touches or spans zero). Published facts do not carry a job class yet, so every job is `other`; a card that names any class other than `any` or `other` gets the error `job_class_not_published` rather than waiting forever. A card without a version gets a comment saying so, and a card that does not parse gets one comment listing stable error codes with the field or block line. The check keeps exactly one comment of its own per card, edits it only when the numbers change, and never closes a card. A card whose issue calls fail is reported with a stable code and the rest are still checked; the command then exits 1. It echoes nothing from the card but validated values, and its comments carry no date or time.
|
|
363
|
+
|
|
364
|
+
Cards come from the desks. `friction_add` with `about: "system"` records friction about the shared system on the desk as a kaizen candidate and sends nothing. The loop's mirror step files the store issue for each improvement card that names a measure, and `file_card: true` files it at once ([kaizen-file.js](../mcp/src/factory/kaizen-file.js)). The desk write is prepared first. The card goes to the store the desk's facts go to: the desk's own `_meta/factory.json`, else the routing the session hooks recorded from the overlays' declarations; with neither, nothing is filed (`route_unknown`). It is filed with that store's recorded consent, as its recorded account. Unless GitHub reports the store as private, the card carries only structured fields: a generated title and body naming the plugin (only `crew`, `desk`, `plain-language` or `superpowers`; any other is refused as `plugin_not_public`), the friction class and the measure, and a generated card block (`signal` and a `down` hypothesis, or `up` for `flow_efficiency`, when the signal is known; `job_class: any`; the plugin; no version yet). Evidence jobs must have the job-ID shape, and a public store refuses this machine's plain local job IDs (`evidence_jobs_local`). A private store's card also carries the free-text title and body, which are refused if they hold anything credential-shaped, a home or drive path, or an email address. Each card carries a fingerprint (a keyed hash of the plugin, class and normalized title): a retry that finds the open card returns it as `duplicate` and files nothing, and at most five cards go to one store from one machine in any 24 hours (`held_cap`). The desk keeps a one-line record with the card's URL. The issue's author (the recorded account) and creation time are GitHub metadata; a card filed during a curator pass dates that pass, not the friction, but it is still a more precise time than a batched facts flush. The kaizen worker then ships each card's countermeasure, fills in `version` when the release lands, and closes confirmed cards. It never sets `countermeasure` or `version` on a card that still has no `signal` or `hypothesis`: the free text that would let a later pass complete such a draft stays on the filing desk, so a card that ships a fix before it names what the fix moves can become impossible for anyone else to judge or complete. A card already in that state is not lost by default: if the desk's own friction record can reconstruct what it was filed for, the worker completes `signal` and `hypothesis` from it and the check judges the card as usual; otherwise the card stays open with a comment saying why it can't be judged yet, until its `before` side runs out under the next rule. It also does not wait forever on a card whose `before` side, given how the fleet updates, will not gain another job — once every session in the store already runs the plugin at or after the card's `version`, that side stays at `0` jobs, `0` groups build after build — closing that card instead on its merged, verified countermeasure (merged, with tests, on green CI), with the closing comment saying plainly that no statistical verdict is coming. Andon is the backstop this leaves in place: it keeps watching every release of every tracked plugin for a release-over-release quality regression on its own schedule, independent of any kaizen card's state.
|
|
365
|
+
|
|
366
|
+
### Andon
|
|
367
|
+
|
|
368
|
+
Then the build runs `factory.js andon --store . --repo <owner/repo>` ([andon.js](../mcp/src/factory/pipeline/andon.js)). Andon watches only the plugins listed under `andon.plugins` in the store's `factory.json`, a maintenance path that intake pull requests cannot change; a store without the file raises nothing. For each tracked plugin, quality measure (`tool_failures`, `tool_retries`, `api_retries`, `retouches` and `muda_time.defects`) and job class, it uses only finished jobs whose every session ran exactly one version of the plugin, and treats a version as comparable when its jobs form at least 6 independent groups, the same minimum as the kaizen check. It compares the latest comparable version with the comparable version before it, so a version superseded before it gathered enough jobs is skipped rather than blocking the comparison. When the 95% interval for the change in median lies wholly above zero (worse), it opens an issue labeled `andon` titled `Andon: <plugin> <version> <measure> <job class>`, or updates or reopens the one it opened before, so there is never a second issue for the same alarm. The body gives the numbers, lists every compared job as evidence, and names every other plugin whose versions changed between the two sets of jobs; the regression then belongs to that set of versions, not necessarily to one plugin. The build closes its own andon issue, with a comment, when the alarm's version or a later comparable version is no longer clearly worse than the baseline; with too few groups to compare, it neither opens nor closes. A reviewer who judges an alarm not to be a real regression labels it `andon-dismissed`: the build never reopens or closes that issue, but when its numbers change it updates the body and adds a comment with them. It reads and changes only issues `github-actions[bot]` opened. Andon watches quality measures only, so no flow gain can offset a quality regression.
|
|
369
|
+
|
|
370
|
+
The desks see open alarms at session start. After each consented store's flush, the start-time delivery reads that store's `factory.json` and its open `andon` issues with the recorded account, and keeps those the build opened (`github-actions[bot]`) for a tracked plugin and no one labeled `andon-dismissed` ([andon-watch.js](../mcp/src/factory/andon-watch.js)). It records at most 20 of them in the protected `status.json` under `andon`. A store whose `factory.json` is missing (404) is `config_missing`, never "tracks nothing", so its open andon issues never read as clear; only a present, valid config may track no plugins. A failed refresh records its code as `failure` and `failed_at` beside the last good list. The next session start prints one `Factory:` line per store that has any ([boot-check.js](../mcp/src/factory/boot-check.js) `andonBootCheck`), so a line shows what the previous refresh found, and `Factory: andon state unknown for <store> since <date> (<code>)` for each contributing store with no record (`not_refreshed`), an unreadable `status.json` (`status_unreadable`), a record more than 72 hours old (`stale`) or more than five minutes in the future (`future_dated`), or a refresh that failed after the last success (its code) (`andonUnknown`). The loop's route step also keeps an andon card's condition present while its issue is still open but no longer tracked by a shrunken plugin list. The `curator` pass handles andon issues before any other card.
|
|
371
|
+
|
|
372
|
+
Each job Markdown report has exactly four second-level sections: `What happened`, `What mattered`, `What was waste` and `What we could not see`. Every Markdown value shows its evidence class. `What was waste` renders the independent evaluator's labels for the job's sessions that the build accepted against their facts: how many sessions are labeled, muda time by waste, value and support time, mura and muri flags, and what the evaluator could not read. It says "Not classified yet" only when no session of the job has accepted labels, and it always keeps the inferred candidate and wait signals. The job report names public pull requests and counts private references. The index reports sessions seen as unavailable, because the store only receives sessions that published facts, and includes bound and unattributed session counts, host counts, every unavailable field/reason rate and plugin-version session counts. Generated files contain no calendar dates, times of day, task names, local paths or transcript text. `job-link` reuses the binding module's accepted job-ID calculation and points to the job Markdown on the store's `reports` ref.
|
|
373
|
+
|
|
374
|
+
The [runner](../mcp/src/factory/derive-run.js) combines the existing native derivers, job binder, store resolver and consent-aware outbox. Per-session locks prevent concurrent derivations from overwriting one another. Receipts retain source identity, size, modification time and the effective marker hash. [Lifetime reconciliation](../mcp/src/factory/session-lifetime.js) checks native resumes and later root activity before treating a marker as ended; unclassifiable or over-limit lifecycle records cannot certify closure. Sweep and file-based requests use only the protected marker reread under the derivation lock; an enumerated copy cannot override that read on timestamp grounds, and a missing file cannot fall back to the copy. Quietness and source identity are checked under the lock. `sweep(env, { quietMs: 600000 })` derives quiet changed logs and currently ended sessions, not busy resumed sessions with stale end markers. A requested `derive --wait-quiet` also rechecks quietness under the lock, including late shutdown writes. Markers remain available for retry and later resumes. The jobs index mirrors the outbox: each derive replaces the jobs listed for its file, so a re-derive that drops a job removes it from the index, and an index written before that rule is rebuilt once from the outbox files (a stamp, `jobs-index.rebuilt`, records it; a failed rebuild is retried on the next sweep and never stops a sweep). The sweep then rebuilds sessions whose marker was pruned when it is safe to (see "Sessions whose capture marker was pruned" above) and records counts of what it rebuilt, left frozen and left pending. Each session start runs `sweep` before delivery, described next.
|
|
375
|
+
|
|
376
|
+
## Delivery: flush, finalize and the boot check
|
|
377
|
+
|
|
378
|
+
[`flush(env, { store, runner, deadlineMs })`](../mcp/src/factory/flush.js) is the only code that sends anything to a store, and it never sends local facts. It takes `flush.lock` in the protected state folder (a lock older than ten minutes is abandoned; a live one returns `locked`), reads the store's consent and account, releases the quarantine an older Desk wrote when a store refused its facts as `private_plugins_missing` (its facts named every plugin; this Desk always writes `refs.private.plugins`), together with the labels quarantined with those facts or held back behind them as `facts_quarantined`, and transforms every outbox file that is not quarantined, and every quarantined facts file whose record names no blob or a blob different from the one it publishes now, with `toPublished` and the public gate `validatePublishedBytes`. A quarantined file whose published bytes equal the refused blob stays quarantined and costs nothing: its record is left as written, and a repository whose visibility is already known is not looked up again. A quarantined file whose repositories cannot be resolved stays quarantined without stopping the files that can go, while a deadline, an offline network, a rate limit or a failed sign-in still ends the flush. The files that go again are released together, once, before sending; a record that is not a regular file (a symlink, a directory or a hard-linked file) is left where it is and its file is never sent, and it never blocks another file. Each referenced repository's visibility, each plugin's install source and the store's own visibility, and the visibility of the desk's own GitHub remote, come from the seven-day cache or `GET /repos/{owner}/{repo}` with the account's token: `private: false` is public, `private: true` private, and 403 or 404 unknown. A 403 or a 404 is retried once, with a plain, unauthenticated HTTP request, before it is accepted: a fine-grained token scoped away from a repository, or an organization's SSO enforcement, still answers 403 or 404 for a repository that is genuinely public, and the retry tells that case apart from one that is truly private or gone. The retry never goes through `gh`: unsetting its token environment variables still leaves it free to fall back to its own stored login, which would answer for whichever account happens to be signed in there instead of for no one. Only the confirmed answer — public, private or still unknown — reaches the cache; a network failure, a 5xx or a rate limit, on either try, is never cached as unknown, and stops the flush instead. Because answers are cached for seven days, a plugin repository that turns private, or a store that turns public, can keep its old answer for up to a week. A desk that is not known to be private publishes machine-keyed job IDs without timing, keyed by the protected 32-byte machine secret. A file the transform refuses (`implausible_session_span`, `session_id_not_v4`, `invalid`) or the gate rejects (its first error code) is quarantined and not sent; the record keeps the `blob` the store refused, when a rejection supplies one. When nothing changed since the last delivery, the flush ends there without a network call.
|
|
379
|
+
|
|
380
|
+
Otherwise it reads the store. With push permission the machine's intake branch `intake/<intake_id>` lives in the store; without it, in the account's default-branch-only fork, created on first use and updated with `merge-upstream` (a fork that is not ready yet returns `fork_pending`). An account without push permission that cannot fork the store returns `account_cannot_deliver` instead of waiting on a fork that will never exist: the store disallows forking, or the account is an Enterprise Managed User (its login holds `_`), which cannot fork or open pull requests outside its enterprise. Closed intake PRs are read newest first, page by page, down to the last PR already read, which is remembered by number in status and moved only after every page has been read. When the store automation (`github-actions[bot]`) commented a first line `factory-rejected: <code>` on one, followed by one such line per further code, every file of that PR, all pages of up to 500, is quarantined with its first data code. When every code is `merge_conflict`, `unexpected_merge` or a `*_check_unavailable` code (the store's own check failing to run, such as `intake_check_unavailable` or `corrections_check_unavailable`), the intake branch was stale, not the facts bad: nothing is quarantined, the files go out again on a branch rebuilt from the store's current default branch, and the flush reports `intake_stale_retried` with `stale_retries`, the number of stale-refused PRs it read, instead of `delivered_pr_open`. `validator_unavailable` never closes a PR. A rejected file with no local outbox file behind it (a session already delivered or gone) writes no quarantine record; the flush result counts those files as `rejections_unmatched`. The comment names no file, so a rejected PR quarantines its good files too, each with the blob the PR carried; the next flush sends a quarantined file again only when its published blob differs from that one, so identical content is never sent a second time. Labels quarantined on their own are not retried. Accepted waste labels travel the same way: each local labels file becomes its published form through `toPublishedLabels`, with the job keyed exactly as its session's facts are, and the labels gate `validateLabelsBytes`; one either refuses (`invalid`, or the gate's first code such as `too_large`) is quarantined at `quarantine/<store-slug>/labels/<job>/<session-id>.json` and never sent. A rejected intake PR quarantines its labels files with its facts, and a stale one sends them again, under the rules above. Labels go only with their session's facts, already on the default branch or in the same batch, because the store's gate refuses labels without facts and that refusal would quarantine every file of the PR; labels whose facts are not there yet wait for a later flush. Labels whose facts are quarantined, by this flush, by a rejection it reads or by an earlier flush, would wait forever, so they are quarantined too, as `facts_quarantined` naming those facts. Files whose exact published blob already sits at `facts/<name>`, or at `labels/<job>/<session-id>.json` for labels, on the store's default branch are marked delivered. Before anything is published or deleted, the flush places every session it could act on by where it routes now, with the one route helper ([session-route.js](../mcp/src/factory/session-route.js)) that the local status and reconcile also use, resolved the way the sweep resolves it. A positive route to this store makes the session here, and a positive route to another store makes it away. A positive route comes from a marker under 30 days old (its desk's declaration, or the overlay check its hook recorded for a default route), or, when the marker is missing or pruned, has no desk root or its desk folder is gone, from the desk root the session's derivation receipt recorded, when that desk declares its store in `_meta/factory.json`. A desk root, the marker's or the receipt's, that is an existing folder whose `_meta/factory.json` is present but unreadable or invalid makes the session unknown, and so does a marker whose hook recorded a route that names no store (an invalid overlay, or an incomplete plugin scan): the desk owner has said the route is changing, but it cannot be read where to. A desk folder that was recorded (the marker's or the receipt's) and no longer resolves, because it was moved or renamed, says nothing about where the desk routes now, so the session is not here: it is frozen and its copies are kept, until a positive route returns. Anything else says nothing new and keeps the session's last known route: a missing or pruned marker whose receipt's desk root declares nothing, a marker with no desk root, a marker from an older hook that recorded no overlay check for a default route, and a Codex default route that no Claude Code or Copilot CLI marker for the same desk within 30 days proves now (a Codex session held at derive time never reached an outbox, so one that did was proven then). The sweep, the flush and reconcile read a marker's route, and prove a Codex default route, with the same functions. The last known route is the `route` the session's derivation receipt recorded when the flush last saw it route positively, else the receipt's `store` (the sweep's latest derive), else this store, whose outbox holds the file. Placement alone is not enough: a re-derive after a route change leaves the old copy in the old store's outbox, and a route to a store without consent is never re-derived, so the flush records `route`, and the session's absolute `desk_root`, in the receipt itself; the sweep records `desk_root` too. Both stay in the local `status.json` and are never published. A last known route to this store makes the session here, so a session pending for more than 30 days, or labels evaluated long after their session, publish as before; one to another store makes it stale, never published there and never deleted. The session's own retraction records come before anything but a positive route: a retraction still open makes it stalled, and a finished retraction's tombstone makes it away, even when the declaration is invalid. Retraction follows three rules. First, a session is published to this store only while it is here. This holds for every file, including a session with no delivered record and a quarantined file that would otherwise be released. A session that is unknown, stale or stalled, or whose facts are quarantined (held), is frozen: it is never published, nothing of it is deleted, and its records stay as they are. The flush counts these in the store's `last_flush` status entry, as `route_unknown` (unknown sessions, frozen until their declaration is fixed), `retraction_stalled` (sessions whose retraction is open but whose route can no longer be shown positive: the record is kept and the delete stays out of the branch) and `held_elsewhere` (files of held away sessions still in the store), and frozen sessions never make a flush go online. Second, a flush that goes online builds the intake branch from what the current state wants, every time: the files to publish and the deletes still needed. When that set is empty, it closes this machine's open intake PR, found by its own head exactly as `openPr` finds it, and resets the branch to the default branch, so a delete the state no longer wants never merges. The status entry keeps `intake_pushed: true`, and `intake_prs`, the number and head (`owner:branch`) of each PR pushed, from the moment a batch is pushed until an online flush finds nothing to change and no PR left open; while it is set the flush goes online even with nothing else to do. A PR pushed under an earlier head (the account gained or lost push permission, so the route moved between the store and its fork, or the consent record names another account) is invisible under the current head, so every online flush closes it by its recorded number, whatever it pushes; its branch is left as it is, because it may sit in a fork this machine no longer uses, and a closed PR merges nothing. One that cannot be read or closed stays recorded, and keeps the flush going online until it is closed. A `store_missing` answer clears both, since no PR can be open on a store that is not there. This survives the loss of any retracting record, and an idle flush with no pending file, no retraction in progress and nothing pushed still ends with `nothing_pending` and no network call, except once after `status.json` lost the store's entry on a machine that delivered to, retracted from or was refused by the store before: that flush goes online to find an intake PR the lost entry would have named by its current head (one under an earlier head stays unknown). Third, retraction never deletes local files. Once the delete is pushed they leave the outbox, because an older Desk's flush publishes whatever `outbox/<store-slug>/` lists and cannot tell a retracted session from a pending one: the session's facts move to `retracted-copies/<store-slug>/<host>-<session-id>.json` and its labels to `retracted-copies/<store-slug>/labels/<job>/<session-id>.json`, in the same protected state folder, with the same owner-only, no-symlink and no-hard-link checks as the outbox. A copy is written to its new place before it leaves the old one and is never deleted; if a different file is already there, both stay. Every flush also moves any outbox copy of a session that has a retracting record or a tombstone, so copies an older Desk left behind, and files already placed in that folder by hand, are adopted and made owner-only. The same move happens before any delete for every session that is not here: at every flush, the copies of each session that is away, stale, stalled or unknown, held or not, delivered or not, leave the outbox for `retracted-copies/<store-slug>/`, and every sweep, after its orphan pass, routes every session with a copy in any store's outbox the way the flush does (its marker, else the desk folder its receipt recorded, else, with no marker and no receipt, the desk its Claude Code transcript names, as the orphan pass reads it) and moves its copies out of every store it does not route to, including a store whose consent is off and whose own flush never runs. A session with no route at all (an invalid declaration, or no desk folder that still resolves) belongs nowhere and is kept in every store. A kept copy whose transcript is unchanged is not derived again. So "away" is durable outside `status.json`: a kept copy goes back to the outbox, and publishes, only on a positive route here, and without one it is frozen (never published, never deleted) however its `status.json`, marker, tombstone or retracting file was lost, corrupted or restored from an older copy. A held session (a facts quarantine; a labels-only quarantine holds nothing) with no positive route and no derivation receipt is frozen the same way, and a refusal an older Desk recorded as `private_plugins_missing` is lifted only for a session that is here. An away session's facts file and every labels file this machine delivered for it are deleted, in the same intake PR, at the published paths their delivered record kept (an older Desk's record without a path is trusted only when republishing now gives the same blob). The delete is made only when the store's default branch holds exactly the blob this machine delivered at that path, and store names compare without regard to case. Once the delete is pushed, the session is retracting: its `{path, blob}` list moves to `retracting/<store-slug>.json`, in the protected state folder beside `delivered/`, written before the delivered records are dropped. Every online flush checks a retracting file against the default branch. Still there with the same blob, the delete stays in the branch; gone, or holding anything else, the retraction is over and the record becomes a tombstone, `{path, blob, done: true}`, in the same file. A delivered record of an away session whose file the default branch no longer holds ends the same way, without a delete. The tombstone keeps the session away from this store for good, whatever else is lost, including `status.json` and the marker; only a positive route back clears it. The local status and reconcile read the kept copies from `retracted-copies/` for `route_changed` and `stale_copy`, and the folder name is owned by [session-route.js](../mcp/src/factory/session-route.js) with the rest of the route decisions. A tree listing that GitHub reports as truncated never counts as a file being gone: the record stays until a full listing shows it. Because the local files are kept, a session that positively routes back finds no delivered record, has its kept copies moved back to the outbox and the labels folder first (a file already there, such as the sweep's newer derive, wins, and the kept copy is retired beside itself as `<name>.kept-<n>`, never deleted, so the session no longer reads as one that left), and is published as new, which restores the store's copy whether or not the delete had merged; its retracting record or tombstone is dropped once the branch no longer carries its delete. When a flush is online anyway, it also deletes a file of an away session it has no record of (the record was lost) if the default branch holds exactly the blob this Desk would publish for it, which only this machine's file can be. The store accepts a retraction only from a maintainer (`OWNER`, `MEMBER` or `COLLABORATOR`), so a contributor without that association cannot retract. A delete the store refuses returns the session to delivered and is counted as `retractions_refused` in the status entry. The refused name is kept there and not retried while the session's file stays delivered and its route stays elsewhere; any change of route clears it, nothing is quarantined, and the session publishes normally if it routes back. A refusal whose state change a crash interrupted is finished by the next flush. The PR body adds `Retracted: <n> files (route_changed)`, counts only, never the other store or a session. A session is never both published and deleted in one PR, and a flush with only deletions still opens the PR. What is retracted, then, is every file this machine delivered to the store for a session that positively routes elsewhere now, or whose desk root, recorded in its receipt, declares another store. What is not: a session whose marker is pruned and whose receipt predates `desk_root` (sweeps before this change did not record it, so such a session is retracted only after a re-derive or a flush that sees its marker), a session whose desk root no longer exists or reaches another store only by the default route with no fresh marker, a session whose desk declaration is invalid (frozen until it is fixed), and a session whose facts are quarantined. Three limits remain. A retraction whose route can no longer be shown positive is stalled, counted and never finished until a positive route returns. An intake PR under an earlier head that this account cannot close (an account change to one without the rights to close the old account's PR) can still merge, and is counted as long as it stays recorded. And if `status.json` and `retracting/<store-slug>.json` are both lost while a delete PR is open, and the session's route also becomes unknown, nothing makes the next flush go online, so that PR can still merge. The rest, at most 500 files and 24 MiB per flush with facts first, become one tree and one commit titled `Factory intake`; only the intake branch is force-updated, to exactly that commit, and left alone when it already holds the same tree on the same base. The open PR for that head is reused, or one is opened titled `Factory intake` whose body is the file count. Store trees, PR lists and comments are read as data and never executed.
|
|
381
|
+
|
|
382
|
+
Several Desk versions can run at once against one state folder, each with the version it loaded at start, so this Desk leaves a file it cannot fully read to the Desk that wrote it. A local facts or labels file that parses but fails local validation only with `unknown_key` errors, or that declares a newer schema version (`desk.factory.local/2`), is skipped: never published, never quarantined and left in place. A session whose derivation receipt records a newer `binding_version` than this code's is skipped the same way. The flush counts these in the store's `last_flush` status entry as `newer_format`. Any other validation failure keeps its behaviour: a file that does not parse or fails with another code is quarantined as `invalid`. A labels file is also a newer Desk's when it fails this Desk's local schema and its `evaluator.plugin_version` is newer than the Desk running (a file that passes the local schema but fails only the published gate is not covered by this rule). A Desk older than the labels newer-format guard (up to about alpha.173) does the opposite, because it quarantines such files as `invalid`. Every quarantine record now names the Desk that wrote it (`desk_version`). Each flush, before it looks for anything to send, judges again a labels record with no blob whose `reason` is one of this Desk's own check codes (`LABEL_CHECK_CODES` in `label-schema.js`: `invalid` and the schema codes): when the session is routed to this store (the same placement the flush uses to publish, so a session routed elsewhere, held or not shown positive keeps its record) and the local file now passes the full publishing check, the record is removed and the file goes out. A record the flush wrote for a store's refusal carries `source: "store"` and is never released this way; a store record written before that mark and without a blob can still be released, which costs one more send and one more refusal. Any other reason (a store's refusal, a hold behind quarantined facts, `too_large`, which a store also gives) is never released this way, with or without a blob. A valid `desk_version` at or above this Desk's keeps the record; a missing or malformed one does not stop the re-check, because the 14 records written before Desks named themselves cannot be told from an older Desk's decision and the check is the same gate that would publish the file. A file that still fails keeps its record.
|
|
383
|
+
|
|
384
|
+
Every outcome is one stable code: `delivered_pr_open`, `intake_stale_retried`, `nothing_pending`, `not_opted_in`, `no_account`, `gh_missing`, `gh_too_old` (older than 2.40.0), `auth_failed`, `store_missing`, `account_cannot_deliver`, `fork_pending`, `rate_limited`, `offline`, `locked`, `deadline` or `unexpected`, recorded as `last_flush` in `status.json`. A flush that ends before it reaches the account (`nothing_pending`, `not_opted_in`, `gh_too_old`, `rate_limited`, `offline`, `locked`, `deadline`, `unexpected`) keeps the store's standing account fault (`no_account`, `auth_failed`, `gh_missing`, `account_cannot_deliver`) as `account_fault` in the same entry, and the loop's route step reads it as still present, so only a flush that used the account clears it ([flush-health.js](../mcp/src/factory/flush-health.js)). The token comes from `gh auth token --user <account>`, lives only in memory and reaches `gh api` only as `GH_TOKEN`, with `GH_PROMPT_DISABLED=1`, `GH_NO_UPDATE_NOTIFIER=1` and `GIT_TERMINAL_PROMPT=0` and every ambient token removed. It never appears in an argument, a result, status, an error or a file. `deadlineMs` (120 seconds) is checked before and after every `gh` call, and a call still running at the deadline is abandoned; the Git calls that read a desk's remote share the same deadline, and one killed by its time limit or a signal stops the flush rather than reading as a desk without a remote. A flush on a machine without factory state returns `not_opted_in` and creates nothing.
|
|
385
|
+
|
|
386
|
+
`finalize(env, { job, runner })` re-derives the job's sessions from the jobs index and every marker updated since the job's finalize request, letting a session that is still writing go quiet for five seconds, within its own deadline. It then flushes every store holding one of the job's files, waiting out another flush's lock within its own deadline, and removes the request only once all of those files are delivered or quarantined. Any failure, a busy or unreadable session, or a file still in the open PR keeps the request for the next end of turn or session start. A request older than 30 days is dropped.
|
|
387
|
+
|
|
388
|
+
Both session-start hooks run the [boot-check registry](../hooks/lib/boot-checks.cjs) after building their existing output: an ordered list of checks, each with its own budget inside one 300 ms total, and the real time each takes is charged against that total. A check that overruns, including one that blocks synchronously past its budget, or fails is skipped for that start with its line and repair discarded; repairs start detached with ignored stdio after every check has run. When no check has a line, the hook's output is byte-identical to what it built; otherwise it gains exactly one line, `Desk boot pre-checks: <line>; <line>`, addressed to the agent. The factory has no check here: since Epoch 3 nothing about it runs at session start or per turn, so the boot prints no factory, evaluator, andon or improvement-card line and starts no delivery or loop worker. The checks, in order:
|
|
389
|
+
|
|
390
|
+
1. `desk-health` ([source](../mcp/src/runtime/desk-health.js)) reads the bound root's own `last-start` record. A degraded record becomes one line such as `Desk: degraded (crew checkout on feature-x; writes paused); run desk_doctor`. Otherwise, when a branch is checked out, it starts a detached fast-forward. That process fetches in the background and runs `git merge --ff-only @{upstream}` only when the checkout is on its state branch (the configured one, else `main`), has no tracked changes or Git operation in progress, and has no commits its upstream lacks, checked again after the fetch.
|
|
391
|
+
2. `workspace-tidy` ([contract](workspace-tidy.md)).
|
|
392
|
+
|
|
393
|
+
[factory-start.cjs](../hooks/factory-start.cjs) and [loop-start.cjs](../hooks/loop-start.cjs) stay in the plugin and run only when someone starts them: `factory-start.cjs` runs one `sweep` and then a flush of every consented store within one 120-second deadline, and `loop-start.cjs` starts the loop worker. Both print nothing and always exit 0.
|
|
394
|
+
|
|
395
|
+
## Consent, status and the report link
|
|
396
|
+
|
|
397
|
+
Each machine records one decision per store. Nothing asks for it at session start. When the operator asks to contribute (or asks what is sent), the agent follows [`desk:session-start`](../skills/session-start/SKILL.md)'s details, "Factory consent" ([`desk:first-run-bootstrap`](../skills/first-run-bootstrap/SKILL.md) asks at its endpoint), and asks the operator in plain words: what is published (durations, counts, tool kinds, plugin and model versions, public references), what never is (prompt, assistant or tool content, names, dates and times of day), that the store is public, and that a signed-in GitHub account of the contributor is the visible author of the intake pull requests. When the operator answers, the agent calls `desk_doctor` with `factory_consent`, and Desk resolves the account itself with the same choice `factory.js account --store <store>` makes: it asks GitHub about the store with each signed-in account's own token instead of assuming gh's active account, prefers an account with push permission, then one that can fork, and never picks an Enterprise Managed User for a store outside its enterprise; when no signed-in account can deliver, a yes is not recorded and the answer is `not_recorded` with each account's reason (`store_not_visible`, `auth_failed`, `forking_disabled` or `managed_account`), so a later session asks again. Yes and no are both recorded in the same `consent.json` that `factory.js consent` writes, yes with the account Desk chose, so the question is never asked again; the tool takes an answer only while the store is `undecided`. People can still run `factory.js consent` from a shell. A noninteractive session neither asks nor records. `desk_status` reports the decision (`undecided`, `yes`, `no`, `held` or `unreadable`), and the tool takes an answer only while it is `undecided`.
|
|
398
|
+
|
|
399
|
+
`desk_status` and `desk_doctor` report `factory` from the [local status](../mcp/src/factory/local-status.js), read without creating anything:
|
|
400
|
+
|
|
401
|
+
```json
|
|
402
|
+
{ "store": "ourostack/factory", "source": "default", "consent": "undecided",
|
|
403
|
+
"stores": [{ "store": "ourostack/factory", "consent": "undecided", "pending": 0, "route_changed": 0, "quarantined": 0, "last_flush": null }],
|
|
404
|
+
"warnings": [] }
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
`store` and `source` are the bound desk's routing (`desk`, `overlay` or `default`, or `invalid_declaration`, `plugin_scan_incomplete` or `no_desk` with `store: null`). `consent` is that store's decision: `yes`, `no`, `undecided`, `unreadable`, or `held` when no store is resolved. `stores` lists the resolved store and then every other store with a recorded decision, each with its outbox files never delivered and not quarantined whose session the flush would publish there (`pending`: here, or unknown and waiting for its route), its outbox files whose session the flush places elsewhere (`route_changed`: away, including a finished retraction's tombstone, stale, or stalled, read exactly as the flush reads routes, so they are never pending there), its quarantined files and its last flush result code. `warnings` holds skipped-manifest codes only. Neither tool prints the machine secret, an account, an intake ID, a token, a time, a local path or any content; `desk_doctor` adds the same data as a `Factory` summary section, and its preview snapshot carries none of it. The Desk MCP server reads the host's plugin set the way the end hook does ([factory context](../mcp/src/tools/factory-context.js)): Claude Code sets `CLAUDE_PLUGIN_ROOT` for the server, so its plugin registry is read; otherwise the folders beside Desk's plugin root are. The scan is the end hook's own code, loaded from the plugin root in `DESK_PLUGIN_ROOT`, because an installed server runs from a source mirror in the cache that has no `hooks/` folder. Claude's launcher sets that variable; on every other host (Copilot's and Codex's configs pass no environment) the server's entrypoint sets it to its own installed plugin folder before anything else runs.
|
|
408
|
+
|
|
409
|
+
On the transition to `done`, `task_update` and `task_archive` write `factory_report: https://github.com/<store>/blob/reports/jobs/<job>.md` into the task card when the resolved store has `contribute: true` and the desk is known to be private: its cached visibility is `private` or `internal`, so the store publishes the job under its plain job ID, and `<job>` is that ID. It is `factory.js job-link` for the task, computed from the same job identity as binding. `job-link --this-machine` answers the operator rather than the card: on a desk known not to be private it prints `{ "link": ..., "keyed": true, "note": ... }`, the report of the job ID keyed with this machine's secret, which covers this machine's sessions only, and a note saying the link is private. It never prints a link that might be wrong: a desk whose visibility is not known gets `{ "link": null, "reason": "visibility_not_known" }` until the next flush asks GitHub again, and a machine with no secret yet gets `{ "link": null, "reason": "no_machine_secret" }`, because it has published nothing keyed; the command never creates the secret. That link is for the operator's own evaluation (see `desk:online-evaluation`) and never goes on the card or anywhere public. Any other desk gets no link, because its store job is keyed so that nobody can tie the desk's public cards to it, and a link would make exactly that tie. The card then records why, as a reason code and nothing else, in `factory_report_unavailable`, and the tool result carries the same `factory_report_unavailable`: `desk_not_private` (a public desk, a desk GitHub answered as unknown, or a desk with no GitHub remote), `visibility_not_known` (a GitHub desk whose cached visibility answer is expired, absent or unreadable) or `job_identity_unavailable` (the task's job identity could not be read). `job-link` prints `{ "link": null, "reason": "<reason>" }` for the same cases. A missing link is not permanent. Every later `task_update` of a card that records `factory_report_unavailable` asks again: it writes the link and removes the field once a link can be named (its result then carries `factory_report`), and updates the reason otherwise. `task_archive` asks again the same way for any such card it archives, and for a card already in `_archive/` whenever it is called for it again, which is the one tool path that reaches an archived card. When the answer is the reason the card already records, that call writes and commits nothing and says so with `factory_report_unchanged: true`. `factory reconcile` counts the cards still waiting (`counts.report_link_unavailable`). Neither field can be set through a task tool's `frontmatter`; both are refused there. Each answer replaces the last, so a card never keeps an older link beside a reason, or an older reason beside a link, and a card whose desk no longer contributes loses both. The link names where the job's report will be, not that the report exists: the store writes it only after it has merged facts that credit a session to the job and rebuilt its reports, so the link answers 404 until then, and for good for a job no session was ever credited to. Done never waits for delivery. Without consent a move to `done` writes neither field and removes an older one. For `cancelled`, and for edits of a card that is already `done` and records no reason, the link fields are left as they are. A failure to compute the link never fails the task operation.
|
|
410
|
+
|
|
411
|
+
## Reconcile
|
|
412
|
+
|
|
413
|
+
`factory.js reconcile --desk <absolute path> --since <time> --until <time> [--store <directory>] [--person-prefix desks/<alias>]` compares a desk's real task activity in a window with the factory's jobs and prints each mismatch with a reason code (see [reconcile.js](../mcp/src/factory/reconcile.js)). It only reads.
|
|
414
|
+
|
|
415
|
+
- **Which tasks it lists.** A task is listed only when it had real work in the window (or, with `--store`, the store holds a session for it, as `store_only`): a real commit that changes the task's folder beyond its card's frontmatter, or a bound session that holds time in the window. A job holds its segments, never the whole span of its session (a job with no segments, as in a file an older Desk wrote, holds the whole session).
|
|
416
|
+
- **Housekeeping is counted, not listed.** A mass commit (one spanning more than three tasks), a commit that carries the trailer `Desk-Tidy: true` (the one-time tidy and its revert add it) and, for older history, a commit whose subject starts with `Tidy desk`, `Revert the desk tidy` or `Revert "Tidy desk` is housekeeping. A card touched only by housekeeping, with no session time in the window, appears in `housekeeping_cards` and in no mismatch, unless the store holds a session for its job in the window, which makes it a `store_only` row.
|
|
417
|
+
- **Each task carries its story.** Its bound sessions in start order, each with `active_ms` (the session's active time cut to the job, never a segment's wall-clock span, and `null` when the facts cannot be read) and `bound_by` from the local receipt: `focus`, `inferred`, `subagent_only` (only subagents worked the job), or `not_recorded` (the receipt is older than the binder, meaning below the last version that changed the binding, 6, or missing). `counts.bound_by` counts the story entries each way, so adoption of `task_focus` is measurable.
|
|
418
|
+
- **Sessions.** The top-level `sessions` list holds each story session once, with `segments_capped_ms` and `repository_evidence_unavailable` (the receipt's `repo_unresolved`). A receipt written before a measure existed, or by an older binder (`binding_version` below 6, the last version that changed the binding), says `not_recorded`, never `0`, because an older binder's value is not this binder's measure. The `counts` totals give the sum of the recorded values (in the measure's own unit: milliseconds or directories) with `sessions`, how many sessions were recorded, and `sessions_not_recorded`, how many were not; the total's state is `not_recorded` when none was.
|
|
419
|
+
- **Cards without a report link.** `counts.report_link_unavailable` is `{ cards, archived, by_reason, jobs_missing, not_checked }`. `cards`, `archived` and `by_reason` count every card of the desk, live or archived and not limited to the window, that records `factory_report_unavailable`; `by_reason` counts the three reason codes, and any other text counts as `unrecognized` without being echoed. `desk_not_private` is meant to last. The others clear themselves: a live card on its next `task_update`, an archived card when `task_archive` is called for it again. `jobs_missing` (`{ cards, archived, by_reason, named }`) counts and names, with `--store`, the done cards whose `factory_report` link names a job the store does not hold: `job_removed` only with positive evidence that the job's facts were delivered from this machine (a delivery record joined to the job by a local copy whose facts hold it; the jobs index alone is not evidence, because it can name a session whose facts never held the job), else `job_missing` (the store lacks it and the cause is not known); `named` lists `{ track, slug, reason }`. `not_checked` (`{ cards, by_reason }`) counts the done cards with a link that were not judged, so a zero never stands for unchecked: `too_fresh` (finished less than a day ago), `no_store` (the store was not read, as in the loop's daily step), `visibility_not_known` (a store was given but the desk's visibility is not known, so job IDs cannot be compared) and `store_file_unreadable` (a store facts file could not be read, so a job may be absent from what was read). The two newer parts are kept apart from the original three fields so an older Desk reading them still reads the counts it knows. The loop's daily reconcile keeps each desk's latest count and sums them into `status.json` as `reconcile.report_link_unavailable` (the health record shows `cards`, `archived` and `by_reason`).
|
|
420
|
+
- **`counts.mentioned`** counts real commits on a task that fall inside the own activity of a session bound to another task: a session's own `git commit` calls and its task tool calls, each widened by a minute. They are mentions, not mismatches. Its `sessions` counts the sessions that recorded their own activity, and `sessions_not_recorded` those that could not.
|
|
421
|
+
- **Reasons.** A task takes the first reason that explains it, in this order: `not_bound`, `not_opted_in`, `route_changed`, `held`, `log_missing`, `stale_binding`, `receipt_too_old`, `own_activity_cut`, `focus_disagrees`, `not_delivered`, `quarantined`, `pr_open`, `card_missing`, `invalid_status`, `status_unobserved`, and `store_only` for a store job the desk shows no real activity for. When no store has opted in (`contribute: true` in `consent.json`), reconcile reports none of `not_bound`, `receipt_too_old` or `own_activity_cut`, and the loop worker records nothing for `no_consenting_store`: a desk that has not opted in stays silent. `not_bound` replaces the older `no_marker`: a real commit that no session's own activity owns. Its detail counts the desk's unbound markers in the window (`unbound_markers_<n>`), and a task is never blamed on a marker. `mechanical_only` no longer exists, because such cards are `housekeeping_cards`. `stale_binding` means the receipt is older than the binder. Its detail says whether anything will fix it: `binding_version_<n>` when the session's marker is still there, so the next sweep derives it again; for an orphan (its marker was pruned) `orphan_binding_version_<n>` when the orphan pass may still rebuild it, and otherwise why it will not: `orphan_route_unknown` (its desk does not declare the store holding it), `orphan_crew_desk`, `orphan_host_not_rebuilt` (only Claude Code sessions are rebuilt) or `orphan_derive_failed` (frozen after repeated interrupted derives under this Desk). `receipt_too_old` means no session's recorded own activity owns a real commit, but a session of this desk that predates `own_activity` overlaps it and may have made it. `own_activity_cut` is the same for a session whose receipt holds the binder's full 500 own-activity spans and was still running after the last one: what it did after that span was not kept (`sessions_<n>`). `focus_disagrees` means the receipt says a declared stretch held none of the job's own events, and is reported in addition to another reason. `invalid_status` and `status_unobserved` are reported in addition too. `status_unobserved` applies with `--store`, when the card's status differs from the latest status the store observed for the job, which happens when the status changed while the session was focused elsewhere. Observations are ordered by when each is known to hold: the end of the published file that made it, or, for `done` and `cancelled`, the card's `updated` when that is later. A session that is still open counts only as far as its published file goes, never as far as this machine's newer local facts, so an old observation from an open session never stands in as the latest one. When the latest observations tie (nothing places them in time) and disagree, which one is latest is not known: the task gets no `status_unobserved`, and `counts.status_unobserved` carries `not_checked` with the number of such tasks and `reason: "observations_unordered"`.
|
|
422
|
+
- **Markers.** The top-level `unbound_markers` list gives each unbound marker in the window its own reason (`held`, `not_opted_in`, `route_changed`, `log_missing`, or `null` for none), so a marker is never blamed on a task. Markers count only between `--since` and `--until`.
|
|
423
|
+
- **Routes.** A bound session the flush places elsewhere than the store whose outbox holds its facts is `route_changed`, never `not_delivered`, read with the same route helper as the flush and the local status: detail `routes_elsewhere` for away (a positive route elsewhere, or a finished retraction's tombstone), `stale_copy` for stale, and `retraction_stalled` for stalled.
|
|
424
|
+
- **Store rows.** A `pr_open` read from the last flush without `--store` has the detail `pr_<n>_unchecked`. A `store_only` row for a job this desk cannot map prints `job: null`. On a keyed (public) desk the store's job ids are keyed, so `store_only` fires only for jobs with local facts on this machine.
|
|
425
|
+
|
|
426
|
+
## The improvement loop
|
|
427
|
+
|
|
428
|
+
The factory closes its own loop: it notices a problem, a card records it, an agent fixes the cause, a later check confirms the fix, and the record shows the result. Nobody has to ask for a pass. This section is for an agent that meets a card mid-task and for a person reading the factory cold.
|
|
429
|
+
|
|
430
|
+
### Cards
|
|
431
|
+
|
|
432
|
+
An improvement card is one Markdown file on the desk, in `_meta/improvement/` (under `desks/<alias>/` on a crew desk), committed with the desk. Its key is `<source>:<id>`, so the same finding never makes two cards, and a finding that comes back after its card closed reopens that card and counts a recurrence. The source says where the finding came from: `andon`, `friction_candidate`, `reconcile_class`, `desk_problem`, `store_build`, `evaluator`, `flush_health` or `loop_alarm`. A card holds only codes, counts and pointers (a job id, an issue or pull request number, a reconcile reason), plus a title Desk builds. The one piece of free text is a lesson's topic: a card that `lesson_add` opens is titled `Lesson for <owner>: <topic>`, and Desk checks the whole topic first and uses fixed words instead when it is not one line or holds a credential, an email address or a private or absolute path. No prompt text, command text, file content or absolute path goes into a card. A card is in one of six states: `open`, `claimed`, `shipped`, `verifying`, `closed_confirmed` or `closed_unverified`. A card file that cannot be read is moved to `_meta/improvement/invalid/` and counted, never deleted.
|
|
433
|
+
|
|
434
|
+
### What an agent does with a card
|
|
435
|
+
|
|
436
|
+
Three tools carry the work (all in the [MCP README](../mcp/README.md)). `improvement_open` opens a card for a finding, finds it already open or reopens a closed one. `improvement_next` claims the oldest open card, or one whose claim ran out, and answers with the card, a claim id and the authority below; it refuses in a noninteractive or headless session. `improvement_update` lets the holder of the claim ship the card with its countermeasure pull request, release it back to `open`, or close it as `wont_fix`, `duplicate` or `not_reproducible`. Nothing else is patched by hand: the loop sets the shipped version, the check results and every other close.
|
|
437
|
+
|
|
438
|
+
A card is backlog, not authority to expand an ordinary user task into tooling maintenance. Within an authorized maintenance scope, an agent may take a card without another approval round, provided it does not duplicate an existing repair owner. It decides the fix, writes tests, uses the normal contribution path, merges only where the task and repository permit, and calls `improvement_update`. Rulings live in the countermeasure pull request, which the card links. True human gates remain money, user-only credentials or accounts, and irreversible destructive actions. [`desk:curator`](../skills/curator/SKILL.md) holds the procedure. Startup reports counts and ages; it does not assign a repair child or PR to the foreground task.
|
|
439
|
+
|
|
440
|
+
System friction opens its card by itself. `friction_add` with `about: "system"` writes the friction entry and then opens `friction_candidate:<fingerprint>`; the entry ends with `Improvement card key: ...`, so the agent that takes the card finds the note by searching the desk's friction files for that key. The other sources open cards without a call, in the loop's route step (below).
|
|
441
|
+
|
|
442
|
+
### The steps
|
|
443
|
+
|
|
444
|
+
A detached worker does the mechanical part. It starts at session start after the delivery worker, only when a store has consent and never in a headless factory session, so there is one worker per machine. The end of a turn starts it too, so a finished job is labeled within the hour of its finish rather than at some later session start ([evaluation kick](../mcp/src/factory/evaluate-kick.js)): right after a finalize run has derived the finished job's sessions, and at the end of any turn with no finalize pending, the worker starts when the evaluate step is due for the kick, never in a headless session, with the loop off, or while a worker holds its lock. For the kick, the step is due when a request is newer than its last run, when the queue is draining (its last run accepted a job's labels, a job the runner can run today is left and the day's ceiling is not spent), or past its gap when a job the runner can run waits (`evaluator.ready_now`, or `ready_later` from an earlier UTC day); a request this machine cannot prepare or run never keeps the kick firing. It runs route, evaluate, mirror, reconcile, verify, measure in that order, each only when due, and exits by itself within 20 minutes. One worker starts at most one evaluation. A step is due after its gap: evaluate at most every hour, route and mirror every 6 hours, reconcile and verify every 24 hours; measure runs every time. An evaluation request recorded after the evaluate step last ran makes it due at once, whatever the gap. A worker whose evaluate step accepted at least one job's labels (`evaluator.accepted_last_step`) starts the next worker as it ends; a step whose runs timed out, spent their budget, failed or were rejected starts none, through the same kick, so the queue drains back to back, one 15-minute run after another, until no job the runner can run today is left or the day's ceiling is reached. The kick changes no money rule: the daily ceiling, the sign-in probe and the money rule below apply to every run it leads to.
|
|
445
|
+
|
|
446
|
+
- **evaluate** asks for finished jobs that have no request (the backstop above), labels the waste in each finished job's sessions headlessly (the money rule below), fresh finishes first and oldest finish first, with relabels after them, counts the requests that expired, and records the label lag: how many finished jobs have a session with no labels yet that the runner can label and is still trying to, and when the oldest of them finished (`status.json` `evaluator.lag`), and how long its facts scan took (`evaluator.scan_ms`: a run starts only with 15 minutes left before the step's deadline, so a growing scan shows here before it crowds runs out). The jobs left out are named apart, never in the lag: `unsupported_jobs` (an unlabeled session on a host the runner does not support, such as Copilot or Codex) and `gave_up_jobs` (three runs without an accepted answer). An accepted run starts a job's attempts again, keeping the day's date, so a session labeled again as its facts change never reaches the limit.
|
|
447
|
+
- **route** turns findings into cards: reconcile mismatches that persisted, delivery faults, expired evaluation requests, quarantined labels, open andon issues, filed Desk problems, store builds that fail and the loop's own alarms. Each is one `improvement_open`.
|
|
448
|
+
- **mirror** opens the store's kaizen issue for a card that has a measure, so the store's build can judge the fix.
|
|
449
|
+
- **reconcile** runs the read-only [reconcile](#reconcile) over the last 7 days and keeps only counts by reason.
|
|
450
|
+
- **verify** finds the release that shipped a card's countermeasure, reads the evidence and closes or reopens the card (below).
|
|
451
|
+
- **measure** writes the health record.
|
|
452
|
+
|
|
453
|
+
Turn the loop off with `DESK_FACTORY_LOOP` set to anything but `1`, `true`, `on` or `yes`; that stops every step. Turn the evaluator off alone with `DESK_FACTORY_HEADLESS_EVALUATOR=0`.
|
|
454
|
+
|
|
455
|
+
### The money rule
|
|
456
|
+
|
|
457
|
+
The plugin starts the evaluator itself only on a subscription sign-in. Under per-token billing, a per-token credential in the environment or an unknown sign-in, it does not run, spends nothing and says so: `disabled_would_bill` or `sign_in_unknown` on the health record and in the session-start line. Only `no_agent_cli`, `no_credentials`, `unsupported_host` and `sign_in_unknown` open the `loop_alarm:headless_blocked` card, after two blocked days; `disabled_would_bill`, `disabled` and `budget_exhausted` are shown on the health record and at session start and never carded, so the person can decide. Under `disabled_would_bill` the evaluator stays off and the agent changes nothing about billing or sign-in. Each run also carries a budget flag of 1 US dollar and a 15-minute limit, and the run's reported cost is kept (`not recorded` when the output carries none, never zero). Only the plugin's own evaluator process is ever started or stopped, never one found by name. An interactive agent runs `evaluate --pending` and starts a `desk:observer` only to retry a job the loop could not finish.
|
|
458
|
+
|
|
459
|
+
### Bounds
|
|
460
|
+
|
|
461
|
+
- At most 30 evaluator runs a day per machine, less the ledger's unused triage windows (see [Shared launch ledger](#shared-launch-ledger)), a safety ceiling rather than a pace; one job at most once a day, and at most three times in a row without an accepted answer (an accepted run starts the count again).
|
|
462
|
+
- 1 live claim per machine and no daily cap; a claim lasts 4 hours, then the card is open again.
|
|
463
|
+
- The 72-hour freshness rule: a reading older than 72 hours decides nothing, and a step that last succeeded more than 72 hours ago, or failed three times in a row, is stale.
|
|
464
|
+
- Two age alarms: the oldest open card is older than 7 days (`loop_alarm:improvement_age`), or a card has been in verification for more than 21 days (`loop_alarm:improvement_stuck`). Loop alarm cards are not counted in either age.
|
|
465
|
+
- Verify checks a card at most once every 23 hours and at most 25 cards a run.
|
|
466
|
+
|
|
467
|
+
### Shared launch ledger
|
|
468
|
+
|
|
469
|
+
Waste evaluation draws on one count of headless launches, kept by the [shared launch ledger](../mcp/src/factory/headless-ledger.js). The ledger was built for evaluation and improvement triage together; the triage runner has been removed, so nothing launches triage now, but the ledger keeps its triage windows unchanged until the factory owner decides otherwise. Each UTC day has four six-hour windows, and each holds one triage opportunity. Evaluation may launch only while `spent + 1` is at most 30 minus the unused windows that have not ended yet, so at the start of a day it can reach 26, and each window that ends unused returns one launch to it. Triage needs an unused current window, six hours since its last actual launch (counted across midnight) and fewer than 30 launches spent. A triage qualification reserved two model sessions together as that window's one triage opportunity, so it needed `spent + 2` at most 30. Every launch is reserved before it starts and is never given back, even when the runner reports that it did not start; its outcome is recorded afterwards as evidence only. The evaluator step reserves each run after its other checks, and a refused or blocked reservation stops it as `budget_exhausted`, with the ledger's code in `evaluator.headless.ledger`. The evaluator's own counts (`jobs`, `accepted`, `rejected`, cost) keep their meaning, and a triage launch never stamps an evaluation attempt. `maxRuns` lets the automatic loop start at most one run per worker generation.
|
|
470
|
+
|
|
471
|
+
The ledger is kept in three files that must agree: `agent-launch-ledger.json` and `agent-launch-guard.json` in the factory state folder, and a high-water mark at `status.json` `loop.agent_launch_highwater`. Each change writes the mark as pending, then the guard, then the ledger (each renamed into place and flushed, then read back), then marks it acknowledged, all under one lock. A crash part-way through never refunds a launch: if the ledger was not reached, that UTC day is sealed as spent and the next UTC day starts normally with older continuation tokens cancelled; if it was, the mark is acknowledged and the launch stays spent. A clock more than five minutes behind the mark blocks, and a smaller lag reads as the mark's own time.
|
|
472
|
+
|
|
473
|
+
When the status file is reset, set aside or loses a sound mark while the ledger and guard both survive and agree, the ledger writes all three files again from the pair, seals the day of the reset as spent and burns older continuation tokens; the next UTC day starts normally. The day stays spent however many times the status file is reset again, but the code in `evaluator.headless.ledger` names only the latest refusal: `witness_reset_sealed` for the call that sealed it, then `quota_exhausted` for a spent day, or `status_reset` while a file set aside today remains. A reset noticed only on a later day seals the reset's own day (the day the reader set the file aside), so the later day is not lost. The ledger launches nothing, and rebuilds nothing, when the mark is missing or damaged and the ledger or guard is missing or damaged, the ledger and guard disagree (`inconsistent`), the pair is older than the mark (a restored backup), the mark is older than the pair (a restored status file), the files come from different ledgers, or the pair is dated more than five minutes after the clock.
|
|
474
|
+
|
|
475
|
+
The first time the ledger is created, the evaluator's own record of today's runs counts as spent; a record from an earlier day counts as none; a record dated after the clock blocks; and without a sound record the first day counts as spent, unless `status.json` does not exist yet and was never set aside. An existing install that upgrades with no evaluator record therefore waits until the next UTC day for its first headless launch; this is deliberate, because a missing record cannot be told apart from one that was lost. A launch the runner reports as not started still counts, because the ledger cannot tell a launch that never began from one that crashed before reporting.
|
|
476
|
+
|
|
477
|
+
These checks find a restored ledger while the status mark survives, a restored status file while a newer ledger survives, and a reset status file. Restoring all three files together, with the evaluator's attempt records, from one earlier backup cannot be detected on this machine without an outside authority, and Desk does not claim to.
|
|
478
|
+
|
|
479
|
+
An evaluation continuation (`createEvaluationContinuation`, `consumeEvaluationContinuation`) let a worker generation whose agent slot went to triage leave one token for the evaluation it deferred. Nothing mints one now; the loop worker still consumes a token an earlier Desk left in `status.json` `loop.evaluation_continuation`. The token is used once: consuming it writes its serial to all three files before the evaluation may start, a crash burns it rather than replays it, and a changed evaluation basis (a genuine run or failure since) refuses it. It skips only the deferral's gap; the shared quota, attempt limits, the lock and the money rule still apply.
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
#### Repairing a blocked launch ledger
|
|
483
|
+
|
|
484
|
+
The blocks below do not clear with the next UTC day. While one holds, the evaluator stops each step as `budget_exhausted`, and the "Factory evaluator" line at session start names the code: "the shared launch ledger blocks every launch (`<code>`)". All the files are in the factory state folder.
|
|
485
|
+
|
|
486
|
+
- `clock_regressed`: the ledger's clock is more than five minutes ahead of this machine's clock. If the machine clock is wrong, correct it. If the ledger's clock came from a one-off jump forward, the block lasts until real time passes that clock; to clear it sooner, use the full reset below.
|
|
487
|
+
- `rollback_detected`, `status_rollback`, `ledger_missing`, `inconsistent`, `epoch_mismatch`, `ledger_unreadable`, `witness_missing` or `witness_invalid`: the three files disagree in a way that could refund launches, usually after a backup restore or a hand edit. Put back the newest copies of `agent-launch-ledger.json`, `agent-launch-guard.json` and `status.json` if you have them. Otherwise, move both `agent-launch-*.json` files aside and delete both `loop.agent_launch_highwater` and `evaluator.headless` from `status.json`. The next launch starts a new ledger with today counted as spent (30), and the next UTC day launches normally. Delete `evaluator.headless` too: it counts only evaluator runs, not triage launches or runs reported as not started, so a new ledger started from it would give launches back. Deleting it also clears the evaluator's own counts for the day (runs, cost, blocked days), which it starts again on its next step.
|
|
488
|
+
- `legacy_future_dated`: the evaluator's own record (`evaluator.headless.day` in `status.json`) is dated after the clock. Correct the clock or that date.
|
|
489
|
+
|
|
490
|
+
### How a card closes
|
|
491
|
+
|
|
492
|
+
Closing needs evidence, and a reading that failed decides nothing.
|
|
493
|
+
|
|
494
|
+
- A card mirrored to a store issue closes only on the store's verdict: `closed_confirmed` when the build confirms the change, `closed_unverified` when it cannot.
|
|
495
|
+
- A card with no store issue closes on its source's own recovery: an andon issue closing, a reconcile reason at zero on two runs, a store build passing again, a loop condition clearing.
|
|
496
|
+
- An open or claimed Desk problem whose own issue is closed closes at once as `closed_unverified` with `source_recovered`, the issue staying as its evidence.
|
|
497
|
+
- A Desk problem that shipped a fix closes after 7 days quiet from the version that shipped the fix, with its issue closed: `closed_confirmed` when the known-hit reading is measured and shows no hit, `closed_unverified` otherwise.
|
|
498
|
+
- Thin data never confirms a card. A card still reading thin data after 14 checks closes `closed_unverified` (`thin_data_after_14_checks`) when its pull request is merged with green checks, and goes back to `open` when it is not merged.
|
|
499
|
+
- A condition that is measured present again at 3 verifying checks reopens the card.
|
|
500
|
+
|
|
501
|
+
### When a loop alarm card opens
|
|
502
|
+
|
|
503
|
+
A loop alarm is a card like any other. The loop opens it when its own machinery needs a fix:
|
|
504
|
+
|
|
505
|
+
- `improvement_age`: the oldest card has waited too long. Take it with `improvement_next`.
|
|
506
|
+
- `improvement_stuck`: a shipped card cannot reach a verdict. Check that the countermeasure pull request merged and released, and that the release lookup and the store reading work; fix what is missing.
|
|
507
|
+
- `unsigned_age`: deliveries wait for sign-off longer than 7 days. It reads the `signoff` counts that session start records in `status.json` (a scan older than 72 hours reads `stale` and alarms nothing); a partial count is a lower bound and alarms when it is already above the limit. Sign the deliveries off with `task_signoff` to clear it.
|
|
508
|
+
- `headless_blocked`: the evaluator could not run on two days in a row. An agent can fix `no_agent_cli` (install the agent CLI) and `no_credentials` (the CLI is not signed in; agents run sign-in flows themselves). `unsupported_host` means the job's host cannot run the evaluator; read which hosts are supported before changing anything. `sign_in_unknown`: check the CLI's sign-in status and repair what an agent can, which is a CLI that is not signed in; never switch billing. The other blocked states never open this card: `disabled_would_bill` is a person's money decision, so the agent changes nothing, `disabled` is the person's own switch and `budget_exhausted` ends with the UTC day.
|
|
509
|
+
- `label_lag`: a finished job has waited more than an hour for labels (`evaluator.label_lag_minutes` on the health record above `label_lag_alarm_minutes`, 60). The owner is the loop's evaluate step ([evaluator step](../mcp/src/factory/evaluator-step.js), triggered by the [evaluation kick](../mcp/src/factory/evaluate-kick.js)). The lag counts only jobs this machine can label and is still trying to (jobs on an unsupported host and jobs at the attempt limit are named on the session-start line and counted as `unlabeled_unsupported` and `gave_up`), and the alarm stays down while the evaluator cannot run at all (`no_agent_cli`, `no_credentials`, `disabled_would_bill`, `sign_in_unknown`, `disabled`), which have their own state and alarm. Read the health record's `evaluator` (its `headless.state`, `jobs_today` against `cap_per_day`, `gave_up`) and the evaluate step's `last_result`: a spent daily cap ends with the UTC day, a blocked state is the `headless_blocked` card's, and `disabled_would_bill` is the person's decision, so the agent changes nothing about billing. A lag that grows while the evaluator runs and nothing is blocked means the trigger or the backstop missed the job; check that the job has a request in `evaluate-requests/`.
|
|
510
|
+
- `labels_quarantined`: labels were refused or their session's facts were quarantined. Read the quarantine folder and the `facts_quarantined` record for the cause. A label withdrawn as `job_unbound` does not raise it.
|
|
511
|
+
- `facts_quarantine_not_settling`: a coverage pass was recorded although a facts quarantine did not settle within the hour (`coverage_kept` is `quarantine_not_settling`), so a host mostly in quarantine goes to the store as not counted. Read the quarantine records (`desk_version` names the Desk that wrote each; a record without it came from an older Desk), check whether the copies validate now, and run `factory.js flush --store <store>` from the installed Desk, which releases those that do. A long-running session on an old Desk can quarantine them again; restart it.
|
|
512
|
+
- `cards_invalid`: card files were set aside under `_meta/improvement/invalid/`. Preserve them for the authorized repair owner. An unreadable or invalid file is not authority to change permissions, delete evidence or start unsolicited maintenance.
|
|
513
|
+
- `capture_loop_slot`: the loop's own health record fails the store's `loop_slot_v1` rule, so the capture record goes without its loop slot. Find which count is out of range on the health record (`loop.health` in `status.json`) and fix its source.
|
|
514
|
+
- `step_stale:<step>`: a step has not succeeded for 72 hours or failed three times in a row. Read that step's `last_result` on the health record and fix it.
|
|
515
|
+
- `triage_engine_unpinned` and `step_stale:triage` came from the removed triage step. Nothing raises them now, so their conditions clear at the next measure step.
|
|
516
|
+
|
|
517
|
+
### The health record
|
|
518
|
+
|
|
519
|
+
The `measure` step writes the loop's health into `status.json` in the machine's protected factory state, under `loop.health` (`desk_status` and `factory.js status` read it). It holds counts of cards by state and source, the age of the oldest open card and of the oldest card in verification, cards closed and reopened in the last 30 days, the unsigned deliveries, open alarms, the evaluator (waiting, expired, given up, quarantined, the label lag in minutes, the finished jobs still unlabeled and those on a host the runner does not support (`unlabeled_unsupported`), its state, today's runs and cost against the daily cap), the reconcile mismatch counts by reason, the cards still waiting for a factory report link (`reconcile.report_link_unavailable`: `cards`, `archived` and `by_reason`, each `unavailable` with `not_recorded` until a reconcile has counted them), and each step's last run, last success, last result, counts of runs and failures, expected interval and whether it is stale. Every number, constants such as the alarm limits and the expected intervals included, travels as `{ state, value, reasons }`: `measured` with a value and no reasons, `partial` with a lower-bound value and its reasons, or `unavailable` with `value: null` and the reason code. A value that was not recorded is `unavailable` with the reason `not_recorded`, never zero, so an empty list means nothing was found only where the count itself is measured. The loop's reconcile compares the desk only; it does not clone the store in this version. The two reasons that need the store's facts, `status_unobserved` and `store_only`, are therefore listed under `reconcile.store_side` as `unavailable` with the reason `store_not_compared`, never as zero mismatches. Comparing against the store is left to a later change. The record never holds a path, a task name or free text, and it is kept on this machine (a later change flattens it and delivers it with the intake).
|
|
520
|
+
|
|
521
|
+
## Completion and remaining boundary
|
|
522
|
+
|
|
523
|
+
The [task tools](../mcp/src/tools/task.js) write `finalize/<job>.json` on `done`, `cancelled` and archive, including repeat archive calls, only when factory state already exists. They use the same job identity as binding; a factory failure emits a fixed diagnostic code without failing the completed task operation. This does not wait for a store, create consent or mark a report delivered.
|
|
524
|
+
|
|
525
|
+
The [CLI](../mcp/scripts/factory.js) advertises `finalize`, so the end-of-turn hook now starts it for pending requests, and the `factory` boot check is the backstop. Delivery to the live public store, and installed Claude, Copilot and Desktop behavior for delivery, remain unverified until the channel update is installed and the controller runs the live proof.
|
|
526
|
+
|
|
527
|
+
## Capture coverage
|
|
528
|
+
|
|
529
|
+
The sweep counts each host's root sessions on disk and says what became of them. It lists folders only and never opens a transcript, except that for Codex it reads at most the first 16 KiB of each rollout file's first line to tell a child session from a root session. A symlink, a hard link and a symlinked folder are never counted. The counts go to the local `status.json`, and once a store says it accepts them, one content-free record per machine goes to that store. Nothing from a transcript is stored, logged or published.
|
|
530
|
+
|
|
531
|
+
### The buckets
|
|
532
|
+
|
|
533
|
+
Every session a host kept on disk is in exactly one bucket, and the buckets of a host add up to its `on_disk` count (the sweep checks the sum for every host before it writes anything).
|
|
534
|
+
|
|
535
|
+
- `derived`: the session has facts and they are placed with their store (delivered, or waiting in the outbox for that store).
|
|
536
|
+
- `held`: facts are not being made or sent for it, because its facts copy is quarantined (a transient state while a quarantine is being released, see `coverage_kept` below), its marker names no store, the store has no `contribute: true` consent, or it is an unproven Codex default route.
|
|
537
|
+
- `frozen`: facts exist or could exist, but the session cannot be published now. Its route is unknown, stale or stalled, or it is an orphan that is not current (see below). `frozen_by_reason` counts the reasons as fixed codes, and tolerates reasons it does not know.
|
|
538
|
+
- `pending`: the session has a marker and its store has consent, and its facts are not derived yet.
|
|
539
|
+
- `not_seen`: the capture hook never marked the session (or, on Copilot CLI and Codex, the marker says no desk), so there are no facts for it. On Copilot CLI and Codex an unmarked session has no owner (`-`), and a store's record leaves those out (see the owner rules below); they stay in the local `status.json`.
|
|
540
|
+
- `not_in_a_desk`: Claude Code only. An unmarked session in a folder that belongs to none of this machine's known desks. On Copilot CLI and Codex this is `null`, because an unmarked non-desk session cannot be told from a miss there.
|
|
541
|
+
|
|
542
|
+
A bucket that cannot be told is omitted or `null`, never `0`. A host that is `absent` (no folder), `unreadable` or `capped` (more than the entry budget or the three-second time budget) carries only its `state` and `unverified`, no counts.
|
|
543
|
+
|
|
544
|
+
Every not-current orphan reads as `frozen`. An orphan is current when its receipt is at or above 6, the last version that changed the binding, even though the orphan pass still re-derives one below 7 while its transcript is on disk. The orphan pass counts its pending orphans machine-wide, so that count cannot be split by owner and is never used: one owner's record must not move with another owner's sessions. The reason is `orphan_unsplit`, or `orphan_pass_unavailable` when the pass left no usable result. `frozen_by_reason` has that one source, so its counts add up to `frozen` and no orphan is counted twice; the pass's own reasons are a tally of its last window and stay in `status.orphans`.
|
|
545
|
+
|
|
546
|
+
### The local `status.json` keys
|
|
547
|
+
|
|
548
|
+
- `coverage`: `{ method: 1, ran_at, hosts }`, one entry per host as above, plus `by_owner` (each owner's own buckets, which sum to the host's) and, on Codex, `undetermined` (rollouts whose first line could not be read) and `fallback` when set.
|
|
549
|
+
- `coverage_failed`: set to `state_unreadable`, `count_failed` or `classify_failed` (the stage that failed, no message) when a pass fails. A failed pass keeps the earlier `coverage` in place and writes only this code. A successful pass clears it.
|
|
550
|
+
- `coverage_kept`: set when a coverage pass is held back because the quarantine is in flux, so a record is never built from a transient state. A pass is in flux when a quarantine folder changed within the last 5 minutes (a folder dated in the future counts as settled), or when the sessions whose facts copy is in quarantine are more than half of a host's sessions on disk (sessions held for another reason, such as a store without consent, do not count). While passes are kept the previous `coverage` stays and the value is `{ code: "quarantine_in_flux", since, at }`; the sweep reports `kept`. The keep lasts at most one hour from `since`. After that the pass is recorded anyway, the value becomes `{ code: "quarantine_not_settling", since, at }`, and the status and the doctor say the quarantine did not settle. In that recorded pass, each host most of whose sessions are in quarantine keeps its counts and is flagged `held_in_quarantine: true`; the record sends it as `{ "not_counted": true }`, never as a share, and the loop raises the `facts_quarantine_not_settling` alarm so the store's status line still shows that something is wrong. A pass with nothing in flux clears it.
|
|
551
|
+
- `coverage_cache`: local only. Its keys are Codex rollout file names, kept so the next sweep need not reread unchanged files. It is never copied into `coverage`, a record, `last_flush` or any other file.
|
|
552
|
+
- `markers_unreadable`: `{ count, last_at }`, the number of marker files the sweep dropped because they could not be read or did not validate. The session each one belonged to is counted as an ordinary session, so this count says how many sessions may have been counted that were meant to be left out. It holds no name, path or content.
|
|
553
|
+
|
|
554
|
+
### Proof sessions
|
|
555
|
+
|
|
556
|
+
A controlled proof run, one started to prove a behavior, sets `DESK_FACTORY_PROOF` to `1` (any value except empty or `0`) in its own environment. Its session's end writes a private marker with `proof: true` and nothing else: no facts, no finalize, no evaluation. That mark stays with the session, even when a later hook or sweep runs without the variable and even past the 30-day marker window, so a proof session is left out of every capture count for as long as its transcript stays on disk. A proof mark counts only for the session whose own file and id it matches; any other mark is ignored, and an unreadable one counts the session as ordinary (see `markers_unreadable`). Unattended runs without the variable count as before. Proof sessions already published before the mark was written are not withdrawn by this rule. At the next flush of each store, a proof session's copies move out of the outbox into `proof-held/`, a local folder that no flush reads, and no flush publishes a proof session's facts or labels. Nothing is deleted: a copy the store may already hold keeps its bytes for the withdrawal that follows. Each move is audited in `proof-audit.json` under a keyed hash of the session id, which holds no session id, path or account. A proof session whose published record the flush has recorded as delivered is withdrawn: its delete goes through the retraction path, which deletes only where the store's default branch holds exactly the delivered blob, and a tombstone records the withdrawal once the store no longer holds it. This happens whatever the session's route says, and a withdrawn session is never published again. Each push and tombstone is audited with reason `proof`, or `proof, unrecorded` for a record found by the check below. A published file that no flush had recorded when the session was marked is checked once against the store's default branch, through the same retraction path. It is withdrawn only when the store holds exactly the bytes this Desk would publish for the session (the store path is derived from the local copy, and the bytes carry this machine's keyed identifiers), which is the proof that the record is this owner's. Any other file at that path is refused, audited as `refuse`, and left on the store; a missing file settles the check with nothing to do. A copy is checked again only while its result is not yet known, so a rerun opens no pull request and writes no entry.
|
|
557
|
+
To mark an existing local session as a proof after the fact, run `node mcp/scripts/factory.js proof <session id> [--desk <absolute desk root>]`. The session's marker must exist and name a desk, and with `--desk` that desk must be the one named. The command prints `{ "result": "marked" }`, or `{ "result": "already_proof" }` when the session was already marked. Any other result exits 1 with a `reason`: `unknown` (nothing recorded on this machine), `ambiguous` (more than one host records the session), `no_marker` (only the derivation ledger knows it, because its marker was pruned after 30 days) or `foreign` (no desk recorded it, its desk folder is gone, or it is not the desk given). A `failed` result means the marker write did not land; `uncertain` means it may have landed and the marker cannot be read back. Each attempt is audited, and running the command again reads the marker first.
|
|
558
|
+
|
|
559
|
+
### Owners and withheld sessions
|
|
560
|
+
|
|
561
|
+
Each session has an owner, and a store's record counts only its own sessions plus the owner `-`, except that an unowned `not_seen` session of a host whose `not_in_a_desk` is `null` (Copilot CLI and Codex) is withheld like `?`.
|
|
562
|
+
|
|
563
|
+
- A store name is the owner when a marker, a receipt or a facts copy tells it. Names are compared in lower case.
|
|
564
|
+
- `-` means the session belongs to no store: no desk evidence names it, and at most one store has `contribute: true`.
|
|
565
|
+
- `?` means the owner cannot be told, and a `?` session is in no record at all. This happens when a marker or receipt names a desk root but its store cannot be told (a desk with no tellable store, or a route that is unknown or whose desk folder is gone); when two sessions of one desk folder point to two stores, or one of them to none; when two desks share one Claude Code folder name (a folder-name collision) and their sessions point to different stores; and when an unowned session exists while two or more stores have `contribute: true`, because it could belong to either.
|
|
566
|
+
- An unmarked Copilot CLI or Codex session has no owner, because those hosts cannot tell a session in no desk from a missed one, so it might belong to a private store. A store's record leaves it out of every count, and the host keeps `not_in_a_desk: null` so the store can tell. The share of such a host is therefore not a measure of capture coverage, only of delivery of sessions that were already marked, and the store reads it as unavailable.
|
|
567
|
+
- Failing closed costs a slightly high-looking share. Failing open could put a private desk's activity in a public record, so every doubt is withheld.
|
|
568
|
+
|
|
569
|
+
### The published record
|
|
570
|
+
|
|
571
|
+
When a store accepts capture records, the sweep's coverage is scoped to that store and sent as `capture/<intake id>.json` in the same intake pull request as facts, through the same outbox and flush. The file name's intake id is the machine's existing intake branch name, so it is already public. The record holds counts and fixed words only: no date, path, session id, desk name, store name or host name beyond the three hosts.
|
|
572
|
+
|
|
573
|
+
The key set is closed. Any other key fails the store's gate with `unknown_key`. The machine-readable list is this block, and a test fails if it differs from the schema ([capture-schema.js](../mcp/src/factory/capture-schema.js)):
|
|
574
|
+
|
|
575
|
+
```text capture-record-keys
|
|
576
|
+
top: schema basis hosts loop
|
|
577
|
+
host: on_disk derived held frozen pending not_seen not_in_a_desk unverified
|
|
578
|
+
uncounted: not_counted
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
- `schema` is `desk.factory.capture/1`, and `basis` is always `still_on_disk`. `basis` is required so the share cannot be shown without its caveat.
|
|
582
|
+
- `hosts` holds zero to three of `claude-code`, `copilot-cli` and `codex-cli`. A host that is `absent` on this machine, or whose in-scope total is 0, is left out. A host that could not be counted (its listing was `capped` or `unreadable`, or most of its sessions sat in a quarantine that did not settle, `held_in_quarantine`) is exactly `{ "not_counted": true }`, with no other key: never a zero and never left out. Every other entry has the eight keys above. Each count is an integer from 0 to 1,000,000, `not_in_a_desk` may be `null`, and `unverified` is a boolean. The buckets add up to `on_disk`, which is the in-scope total, not the machine's.
|
|
583
|
+
- `loop` is the optional flat `loop_slot_v1`, at most 512 bytes. `v` is required and is `1`. The nine `LOOP_SLOT_COUNTS` keys in [capture-schema.js](../mcp/src/factory/capture-schema.js) are whole counts from 0 to 1,000,000 or `null`; `headless` is a code matching `^[a-z_]{1,32}$` or `null`. Unknown keys fail locally. [loop-slot.js](../mcp/src/factory/loop-slot.js) reads the stored health record only within 72 hours. Open, claimed, shipped and verifying exclude alarm cards; `loop_alarms_open` counts those separately. `oldest_open_age_days` includes the record's own whole-day age, so the store's seven-day alarm is not late. The two `closed_*_month` counts cover 30 days; `steps_stale` counts stale steps. Missing, partial or invalid values become `null`, never zero; a missing or stale record sends no slot. Empty capture records never carry a slot.
|
|
584
|
+
- Only when the actual default branch advertises `loop_context: 1` in `context.json`, a fresh snapshot may add `triage_refresh`: `current`, `incomplete`, `resource_unrecoverable` or `null`. With the triage step removed it reads `null`. This code requires a recent store-matched triage operation whose timestamp matches the loop health step; the retained writer/resource-state reason comes from the actual refresh tally, never a stale-step guess. No path, operation token or raw error is published. The capability is checked before new bytes are emitted; an open intake keeps its exact sent bytes, SHA and normal settlement rules. Absent capability leaves legacy bytes unchanged.
|
|
585
|
+
- The record is at most 2 KiB, in canonical bytes.
|
|
586
|
+
|
|
587
|
+
The share is "of sessions still on disk" and an upper bound: a host that deleted its old transcripts is invisible here. A store's record is also self-reported: the store cannot check it, and anyone who can open an intake pull request can overwrite a capture file, so the numbers are a signal, not proof.
|
|
588
|
+
|
|
589
|
+
### Reading the record with number states
|
|
590
|
+
|
|
591
|
+
The record is raw input, and a store's reports must read it by the same rule as every other number: a count never stands alone, and a number that was not measured is never shown as 0. A host entry that is present has measured counts, and when its `unverified` is `true` the counts are a lower bound, shown as unverified in words. A `null` `not_in_a_desk` was not measured. A host left out of the record means no session in this store's scope (or no such host on the machine), which is not the same as zero sessions seen on the machine; for Copilot CLI and Codex it can also mean that every session in scope was an unowned one that the record withholds. A host whose entries all have `not_in_a_desk: null` (Copilot CLI, Codex) cannot say which unmarked sessions were missed, so the store reads its capture shares as unavailable with the reason `host_does_not_say_desk`, raises no low or dropped alarm for it, and marks the store-wide share partial with that reason. A host that is exactly `{ "not_counted": true }` could not be counted on that machine at that time, or most of its sessions sat in a quarantine that did not settle: it has no data, shown as "not counted", never as 0 and never as "no sessions", and it does not stand for the counts the store held before. A store with no record has no data. A rollup over machines says how many machines it rests on (n of N). The record carries no reason keys, so the store's own reading and wording apply, in the terms of its README.
|
|
592
|
+
|
|
593
|
+
### Codex is unverified until proven
|
|
594
|
+
|
|
595
|
+
A record's Codex entry says `unverified: false` only when the in-scope `derived` count is above 0 (a Codex session this store's own facts were derived from), the listing had no `undetermined` rollouts, and no fallback listing was used. Otherwise it says `unverified: true`. An `undetermined` residual is a rollout whose first line was unreadable, too long or invalid, so it could be a root or a child. It is never counted as a session, and any above 0 makes the host unverified. The host's own receipt-based flag is not read for the record, so another store's derived session cannot change a public record.
|
|
596
|
+
|
|
597
|
+
### A host that is capped, unreadable or mostly in quarantine
|
|
598
|
+
|
|
599
|
+
A host whose listing is `capped` or `unreadable`, or that the sweep flagged `held_in_quarantine` (most of its sessions sat in a quarantine that did not settle within the hour), goes into the record as exactly `{ "not_counted": true }`, and the other hosts keep their true counts, so the record never overwrites a host's true counts with a gap and never says zero for one it could not count. The store takes that shape and nothing else (`capture_keys` or `capture_values` otherwise). The local `status.json` still says why (the host's `state`, or its `held_in_quarantine` flag with `coverage_kept`). A machine that stays stuck stays visible in the record, and the store's rule for stale files (below) still catches a machine that stops sending. A machine whose only host is uncounted sends that one flag, which replaces the record the store held: the store reads "could not count", not "no sessions".
|
|
600
|
+
|
|
601
|
+
### When a record is sent
|
|
602
|
+
|
|
603
|
+
- Handshake: the record is sent only when the default branch holds a file `capture.json` at its root whose content is exactly the JSON object `{"capture":1}` (read through the account's own client, from the store, not a fork). Anything else, no file, an error, bad JSON, an extra key or another value, is `store_not_ready`: no record is sent, `status.capture[<store>].skipped` says so, and the store is asked again after a day. `factory.json` is deliberately untouched (a `capture` key there enables nothing), so an older client's andon parser keeps working. A store that is not ready never delays facts.
|
|
604
|
+
- Coverage older than three days (by `ran_at`), unparsable or in the future sends nothing and retracts nothing. A failed pass leaves the earlier coverage in place, so it is used only while it is still fresh.
|
|
605
|
+
- Replacement is throttled to once in 20 hours, and only when the bytes differ from what the default branch holds. The one exception is a corrected record: when the captured share (`derived` over `derived + frozen + pending + not_seen`) of any host named by both this record and the last one sent differs by 0.15 or more, the record is due at the next flush. The share of the last record sent is kept locally as `sent_share` in `status.capture[<store>]` (a ratio per host, never published). A small change still waits. The bookkeeping lives in `status.capture[<store>]` and never in a delivered record. A push that rebuilds the intake branch without a record the open pull request carried either finds the record on the default branch (settled) or records it as not delivered: `dropped: "capture_dropped"` and `dropped_at`, with `sent_at` forgotten so the record is due at the next flush instead of 20 hours after the lost send. State with no kept bytes cannot be checked, so it keeps `sent_at` and records `dropped: "capture_drop_unconfirmed"`, which is never raised as a finding because the record may have landed. A record still `capture_dropped` six hours later is raised as a finding: `capture_dropped` in the doctor and boot status.
|
|
606
|
+
- Retraction is the empty record, `hosts: {}`. It is sent when a record was sent before and nothing is left in scope (every host `counted` or `absent`). Any contributor may send it. A host that could not be counted is in the record as `not_counted`, so it is not an empty scope and is never retracted.
|
|
607
|
+
- A refusal that names the record (a `capture_*` code except `capture_check_unavailable`, or `path` for the pull request that carried it) is counted as a stale pull request: facts are sent again and never quarantined because of it. The record backs off a week. A data code beside it still quarantines facts as before.
|
|
608
|
+
- `capture_check_unavailable` is the store's own check failing to read the commits, an infrastructure failure and not a refusal of the record. It is a stale pull request like a merge conflict: facts go again, nothing is quarantined, no week's wait is recorded, and the record goes again in its normal 20-hour turn.
|
|
609
|
+
- The record's own gate fails (a bug, not a store refusal) only as `capture_invalid`: nothing is sent and it is asked again after a day.
|
|
610
|
+
|
|
611
|
+
### Local retention
|
|
612
|
+
|
|
613
|
+
The sweep keeps local state from growing without bound, and never at the cost of a retraction. A finished retraction's tombstone records when it finished (`at`) and is pruned after 90 days, but only when no local copy of that session is left for that store (outbox, labels, `retracted-copies/` or quarantine); kept copies are never deleted, so a tombstone normally stays as long as they do. A kept copy that has no positive route here fails closed and stays frozen: a lost or unreadable `status.json` never makes it publish. A delivered facts copy is pruned only when its transcript is gone, its record is over 90 days old, the delivered record holds a trusted path and the blob sha of this very copy (so nothing newer and undelivered is lost and a later retraction can still find the file); a delivery recorded by an older Desk has no such sha, so its copy stays. `factory.js status` shows `retention` (what the last sweep pruned, a failure code, or that nothing has run; a failed copy prune is counted as `copies_prune_failed`) and `capture_check`, a line per store whose own capture check could not read the record three times in a row. Neither waits for someone to look: a failed pruning raises the `retention` finding (`prune_failed`, or `copies_prune_failed`) and a store whose check failed three or more times in a row raises `capture_check_unavailable`, only for a store this machine still contributes to. Each is a line in `desk_doctor`'s summary and in the plain-text boot (starting `Factory: `), next to the orphan pass's finding, before the consent line. Kept copies with no positive route anywhere are frozen for good: never published and never deleted, which is the fail-closed cost of a session whose route can no longer be shown. The local status counts them per store (`kept_frozen`, with `kept_frozen_oldest_days`) and `desk_doctor` prints the count and the oldest age.
|
|
614
|
+
## Triage validation (no producer)
|
|
615
|
+
|
|
616
|
+
The [`triage-schema.js`](../mcp/src/factory/triage-schema.js) contract is separate from facts, labels, capture records, and canonical improvement cards. It adds validation only: it does not emit batches, launch a model, claim work, or make a reviewed recommendation executable. Desk no longer has a producer: the triage runner that emitted batches was removed. The store's intake gate still uses this contract, so the store's 13 existing `triage/` files and its own tests keep their meaning.
|
|
617
|
+
|
|
618
|
+
### Public batch and immutable intake
|
|
619
|
+
|
|
620
|
+
`desk.factory.triage/1` has exactly `{schema,batch,producer_version,rubric_version,coverage,runner,rows}`. Each batch has at most twenty rows, each at most sixteen KiB of canonical JSON, and its sixteen-lowercase-hex `batch` must equal the filename `triage/<batch>.json`. Raw bytes must equal `JSON.stringify(value)` with at most one trailing newline; duplicate keys, extra fields, unsupported schemas, unsafe integers, and arbitrary prose are refused with fixed codes and safe field paths. These checks use the existing canonical-byte/schema walker. Source: [`validateTriageBytes` and `validateTriageChange`](../mcp/src/factory/triage-schema.js).
|
|
621
|
+
|
|
622
|
+
Rows have exactly `{id,revision,state,source,lifecycle,ownership,route,gate,evidence,basis,related_ids,duplicate_ids,age,producer_version,rubric_version}`. The annotation ID is an independently assigned random 32-lowercase-hex token, not a canonical card key, machine ID, or capability. Row revisions and evidence revisions are positive safe integers. Generation tokens are 32 lowercase hex digits. Evidence/basis evidence revisions are lists of at most sixteen `{kind,ref,revision}` pointers. Issue/PR refs use our public GitHub URL shapes; job refs use the existing `https://github.com/<store>/blob/reports/jobs/<published-id>.md` shape, with no new machine/job ID transform. Pointer syntax is **not** proof of public visibility or consent: the trusted parent/store must positively establish both before projection. Related/duplicate IDs also need acknowledged same-store assignments; byte validation does not establish those assignments. Sources: [`triage-schema.js`](../mcp/src/factory/triage-schema.js), [`jobReportUrl`](../mcp/src/factory/pipeline/build.js).
|
|
623
|
+
|
|
624
|
+
Coverage preserves unknowns: `{generation,scan,reviewed,unreviewed,refused,deferred,more_unreviewed}`. `scan` is `complete`, `truncated`, or `unreadable`; counts may be null when unknown, and `more_unreviewed` is boolean or null. Missing data must not become zero. Runner is `{state,last_success_age}`. The shared exported `TRIAGE_RUNNER_STATES` is `ran|no_agent_cli|unsupported_host|no_credentials|disabled_would_bill|sign_in_unknown|scope_unqualified|scope_changed|timeout|budget_exceeded|failed|headless_session|no_time_for_a_run`; local qualification states `qualified|blocked` are not public runner states. The age vocabulary is `recent|aging|stale|never|unknown`, not a local timestamp. Source: [`publicSpec` and shared enums](../mcp/src/factory/triage-schema.js).
|
|
625
|
+
|
|
626
|
+
Intake uses the **separate contextual** gate `validateTriageChange({path,status,bytes,previousBytes,trustedMaintainer})`. Only an added regular-file status normalized by the trusted Git reader, no previous blob, matching batch/path, and `trustedMaintainer === true` succeeds. `modified|removed|renamed|copied|type_changed`, unknown/nonregular modes, and falsely added existing paths fail with `triage_immutable`. Even identical existing bytes are not an addition; a later transport may acknowledge exact trusted-main readback as a no-op, but must not submit it as a change. Withdrawal/correction is a new batch with higher row revisions; historical batches remain evidence. Source: [`validateTriageChange`](../mcp/src/factory/triage-schema.js).
|
|
627
|
+
|
|
628
|
+
For triage changes only, the [`validate-pr` CLI](../mcp/scripts/factory.js) additionally needs `--repo <owner/repo> --pr <number>`, alongside its existing base/head and association flags. It queries the actual PR actor and head through the trusted API, requires a successful current repository permission answer (`write`, `maintain`, or `admin`), and rereads actor/head after validation. Missing, failed, malformed, or changed metadata is `triage_authority_check_unavailable`; a known non-maintainer is `triage_untrusted_producer`. No association flag, Git author, JSON field, or random ID supplies triage authority. Mixed unrelated changes retain legacy maintenance classification and are not automatic data intake. The store's trusted merge checker must independently requery permission and pin actor/head; this Desk-only validator is not that merge implementation. Sources: [`runValidatePrCommand`](../mcp/scripts/factory.js), [`validatePr`](../mcp/src/factory/pipeline/validate-pr.js).
|
|
629
|
+
|
|
630
|
+
### Protected candidate, not a Git annotation
|
|
631
|
+
|
|
632
|
+
`validateTriageResultBytes(bytes,{brief})` returns `{ok,errors,valid,refused}` and persists nothing. The result envelope is exactly `{schema,batch,rubric_version,producer_version,results}` with schema `desk.factory.triage-result/1`. Each protected result is exactly `{key,basis,route,problem,observed_impact,unknowns,next_step,authority,evidence,related,duplicates,decision,gate_reason,recommendation,safe_continuation}`. Text is nonempty, control-free, and at most 1200 characters; lists have at most sixteen entries. There are at most twenty results and sixteen KiB per result. Individual refused results do not discard valid siblings. Errors contain only fixed codes and numeric/schema paths; `valid` and `refused:[{index,result,errors}]` contain protected data and must never be logged or committed verbatim. Source: [`validateTriageResultBytes`](../mcp/src/factory/triage-schema.js).
|
|
633
|
+
|
|
634
|
+
The trusted parent supplies a minimal authorization projection:
|
|
635
|
+
|
|
636
|
+
```text
|
|
637
|
+
brief = {
|
|
638
|
+
batch, producer_version, rubric_version,
|
|
639
|
+
cards: [{key,basis,evidence_ids,ruling_ids,authority_codes}]
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
Keys, opaque per-card basis tokens, evidence IDs, ruling IDs, and allowable authority codes must come from current prepared evidence/rulings, not the candidate. References outside this brief are refused. Duplicate claims need nonempty evidence common to both prepared cards and the result's evidence; merely similar findings use `related`. Agent-ready authority requires an existing-scope or approved-plan code with a supplied ruling. A human route requires `human_gate`, a gate code, decision, recommendation, and safe continuation; those four human-only fields are null on other routes. Investigation `next_step` is required text describing the inspection/experiment and its success condition; the protected parent/rubric must assess its meaning, not infer authority from prose. Source: [`resultSpec` and candidate reference checks](../mcp/src/factory/triage-schema.js).
|
|
644
|
+
|
|
645
|
+
A successful protected candidate is deliberately rejected by the public batch validator. It is also not the `desk.factory.triage-local/1` safe Git annotation. A later separately validated safe-code projection must be used for Git; full briefs/results, private quotations/decisions, and private evidence fingerprints remain in owner-protected state, never public transport or canonical card fields. This node implements neither that persistence nor that safe annotation writer. Sources: [`triage-schema.js`](../mcp/src/factory/triage-schema.js), [`triage_schema.test.js`](../../../tests/desk/mcp/__tests__/factory/triage_schema.test.js).
|
|
646
|
+
|
|
647
|
+
The synthetic paired-fixture source is [`v12-triage.json`](../../../tests/desk/mcp/__tests__/factory/fixtures/v12-triage.json). Materialize each case by cloning `public`, replacing `schema`/`rows`/`runner` when present, and overlaying `row` on the first row and `coverage` on coverage. Only `publicEvidence` is trusted synthetic public enrichment; no rich local candidate belongs in browser fixtures. Consumer rollout must copy this fixture byte-for-byte to the store and verify pairing there.
|
|
648
|
+
|
|
649
|
+
Store validator parity must include credential refusal for both envelope and row `producer_version`, as well as rejection of any repeated row ID within one batch, whether identical or conflicting. Credential refusal is `credential_like` at the safe schema path; repeated IDs are `duplicate` at `rows.<index>.id`, without echoing the value. The paired fixture includes `credential_producer_envelope` and `credential_producer_row`; materialization also replaces envelope `producer_version` when supplied. These are validator constraints, not permission to publish a richer candidate. Sources: [`version` and `validateTriageBytes`](../mcp/src/factory/triage-schema.js), [`triage_schema.test.js`](../../../tests/desk/mcp/__tests__/factory/triage_schema.test.js).
|
|
650
|
+
|
|
651
|
+
A new correctly named batch with higher row revisions is valid even if it resembles a historical batch. The CLI's supplementary copy detection uses an exact-content threshold (`-C100%`): similarity is not immutable-path mutation. Exact copies, renames/removals, type/mode changes, prior blobs at an allegedly new path, and path/batch mismatches remain refused. The historical file remains unchanged and acknowledged as evidence; the new batch is checked as a separate addition. Sources: [`triageStatuses`](../mcp/scripts/factory.js), [`similar_new_batch_with_higher_revision_is_added_without_mutating_historical_batch`](../../../tests/desk/mcp/__tests__/factory/factory_cli.test.js).
|