@defrex/autobuild 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/SPEC.md +1512 -125
- package/bin/ab-dispatch-generation.ts +2 -0
- package/docs/agent-runtimes.md +30 -3
- package/docs/answering-blocked-builds.md +15 -7
- package/docs/architecture.md +282 -39
- package/docs/builds.md +5 -0
- package/docs/cli.md +7 -1
- package/docs/configuration-overview.md +1 -0
- package/docs/configuration.md +268 -45
- package/docs/dispatcher.md +17 -3
- package/docs/forges.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/integration-overview.md +4 -2
- package/docs/integration-tree.md +102 -11
- package/docs/merge-policy.md +30 -14
- package/docs/migration-1.0.md +2 -1
- package/docs/operating.md +32 -4
- package/docs/operator-api.md +117 -14
- package/docs/optimization-nodes.md +1042 -0
- package/docs/overview.md +1 -1
- package/docs/plugin-authoring.md +46 -12
- package/docs/remote-store-protocol.md +46 -7
- package/docs/remote-ticket-protocol.md +50 -2
- package/docs/restacking.md +99 -11
- package/docs/seams.md +2 -2
- package/docs/setup.md +13 -2
- package/docs/skills.md +4 -2
- package/docs/spec-standard.md +2 -1
- package/docs/ticket-dependencies.md +5 -0
- package/docs/ticket-migration.md +4 -2
- package/docs/ticket-sources.md +30 -12
- package/docs/tickets.md +15 -6
- package/docs/troubleshooting.md +3 -2
- package/docs/verification.md +11 -0
- package/docs/workspaces.md +3 -1
- package/package.json +3 -3
- package/packages/core/src/accounts/chatgpt-oauth.ts +7 -5
- package/packages/core/src/cli/attempt.ts +103 -0
- package/packages/core/src/cli/attention.ts +8 -1
- package/packages/core/src/cli/binary-direct.ts +52 -1
- package/packages/core/src/cli/binary.ts +5 -3
- package/packages/core/src/cli/build-control.ts +328 -66
- package/packages/core/src/cli/context.ts +268 -15
- package/packages/core/src/cli/dashboard/detail.ts +26 -2
- package/packages/core/src/cli/dashboard/facts.ts +40 -3
- package/packages/core/src/cli/dashboard/integration-detail.ts +7 -2
- package/packages/core/src/cli/dashboard/landing-display.ts +15 -2
- package/packages/core/src/cli/dashboard/model.ts +102 -27
- package/packages/core/src/cli/dashboard/objective-row.ts +189 -0
- package/packages/core/src/cli/dashboard/render.ts +47 -1
- package/packages/core/src/cli/dashboard/reopen-display.ts +39 -0
- package/packages/core/src/cli/dashboard/tree.ts +12 -1
- package/packages/core/src/cli/dispatch-frontend.ts +9 -1
- package/packages/core/src/cli/dispatch-launch-stop.ts +55 -0
- package/packages/core/src/cli/dispatch-launcher.ts +26 -44
- package/packages/core/src/cli/dispatch-repository-feed.ts +1 -1
- package/packages/core/src/cli/dispatch.ts +16 -4
- package/packages/core/src/cli/env.ts +42 -0
- package/packages/core/src/cli/help.ts +208 -11
- package/packages/core/src/cli/init-agent.ts +4 -1
- package/packages/core/src/cli/init-readiness-remote.ts +3 -2
- package/packages/core/src/cli/init-validation.ts +2 -2
- package/packages/core/src/cli/init.ts +3 -2
- package/packages/core/src/cli/judge-entry.ts +82 -0
- package/packages/core/src/cli/judge.ts +233 -0
- package/packages/core/src/cli/landings.ts +3 -2
- package/packages/core/src/cli/main.ts +412 -143
- package/packages/core/src/cli/measurement-text.ts +19 -0
- package/packages/core/src/cli/objective.ts +154 -0
- package/packages/core/src/cli/publication-settlement.ts +106 -22
- package/packages/core/src/cli/repo-lease.ts +1 -0
- package/packages/core/src/cli/repository-status.ts +113 -18
- package/packages/core/src/cli/status.ts +193 -15
- package/packages/core/src/cli/store-opening.ts +4 -0
- package/packages/core/src/cli/terminals.ts +205 -8
- package/packages/core/src/cli/ticket-start.ts +53 -0
- package/packages/core/src/cli/ticket.ts +68 -2
- package/packages/core/src/cli/upgrade-agent.ts +12 -8
- package/packages/core/src/cli/wait.ts +8 -2
- package/packages/core/src/cli/watch.ts +341 -91
- package/packages/core/src/config/create-labels.ts +23 -0
- package/packages/core/src/config/live.ts +2 -0
- package/packages/core/src/config/pipeline-source.ts +1 -3
- package/packages/core/src/config/roles.ts +182 -73
- package/packages/core/src/config/schema.ts +112 -9
- package/packages/core/src/events/catalog.ts +39 -3
- package/packages/core/src/events/compatibility.ts +7 -1
- package/packages/core/src/events/payloads.ts +588 -1
- package/packages/core/src/events/policy.ts +53 -0
- package/packages/core/src/events/repository.ts +107 -24
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +1481 -199
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/0ab2a90d0305dc9d.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/10a4657408d4e121.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1152a2e97ee81728.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/13ca84752c5f8b54.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1411d1cdbdd9911e.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1444fe1fa7fc802c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1491ac0600349391.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1921f86f752428c9.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1972c1d66008ef6b.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/19e8e43e7f3f1a06.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/20a85c143c3e8164.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/21ce2c0bf58318e1.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/293dcb3a94fb3470.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2ab7436356267118.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2d084641735caaff.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3237bcecf68e5db9.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/33d0cc593610e56f.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3451ed2136dcc356.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/358ec8693f2237e6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/35cf9ccc4478b2d2.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3649e7bd1203f154.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/378da6dece82202a.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/38c75099d9191471.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/398952f1f01db1a3.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3b64d352d56c9121.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3dc486226c05372d.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/431c9bb2ee8838e0.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4400dffca929e2f0.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/49064fc079964a5c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4edded75f17742f4.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4f00c0f2c8afd159.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516a5a7aadf97587.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516dc6ea85d67cd7.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/584e2ba74608e051.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/59ffaa6974094c72.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5bb43afb121674c6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5f0ca42af862c4ee.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6118031132db9bfc.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63107a8d58776b63.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63546b08d4d6fa11.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/643d70429ce03dad.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/677ea92572c29082.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6ae5bf60504d6467.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6efdc8defc75fccb.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/71c53d33f09d8204.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7267ca2757cffba7.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/76b7d4244082b3f9.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7749f918c6f10968.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7833e42d16301424.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7d4edad0614adaf1.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/837365898d04f45a.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/85f9f0c921b8b5bb.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8879f57a24733897.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/88cb9e71bdec972d.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8a0cd6dd06cc155e.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8aa9ca8609dc051d.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8c8640255bd61658.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8cc15eb1807c0157.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8ced97c44bc0af3a.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8d4144004720b9f8.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8db633ead1807f8b.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8e42cdbd0994ab0c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9011d0f6ff955ef9.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/916ebc5433801c41.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9539b995af5c54a9.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/95f391bfd7b7dbd7.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9613e8fa568a9281.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9a68f8753bd9038d.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9b25e58227080094.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9ee3919fbd4f9458.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a04a34cc2717147b.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a0b32c12e4e6edb6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a55218252707bdd3.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a732fd08b31522a6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a9d206a01f9039e5.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/abf7fe3c92c82f2d.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ac928b04842c00db.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/af953392d81911da.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0d877c44810ecb0.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0f7c6ebb2db57fc.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b905c22ec17eed31.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/bce0c54e865f4b79.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c68b7ee2e2610f30.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c7f7e0378aeea237.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c98cb1659eb142b6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ca830adf06ed55a1.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cb3a219f33e437ca.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cf1e0c0d82567e0c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d008d86d9ff77b30.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d1432a819d8e48c5.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d185ed6aa9192aff.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d873fad29d6c7e55.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/db84b12316e2da4a.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ddf6dc967d898767.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/dfc64de6e7bfc0a0.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e2f18fa32fe1f6d0.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e37393fed29e84c5.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e6a8585e2a054ff6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e7e9e327baca6903.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e86447af0571672c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ea819202d22122e5.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb4535585f2e84f6.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb7ddd5319d09e27.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eca4959b2b87ae15.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ee10d7959ec4843c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ef1b68347966ab26.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f3e55425cc41f230.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f40042c1cdb9fd43.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f48466215c790a3f.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f5b9ace9b59351e7.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fa8f1475a55be935.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fb21116a15d0b1f1.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fe95444fbeabe592.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/09bf0a1611d07363.json +984 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/10eac4988d66e161.json +1067 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/1a436b5fb45aee3e.json +1116 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/249db6f7a41f90e2.json +161 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/25dcb2fb6eaa83f4.json +858 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/2e1bdc763924616f.json +4932 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/30e9dabce3c4263d.json +399 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/4898ef339c68fa36.json +83 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/51816c0ffa62af6e.json +417 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/561bf45320062a44.json +83 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5672d0233085d050.json +84 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5e39f42cbdbf35ef.json +163 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/7771a7a2250f9964.json +868 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/881c491321bec99a.json +1074 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/965f25c3af1d2cdc.json +160 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9b76d89da575ca90.json +20 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9eb485320a72a9ff.json +233 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a60448c01016135e.json +18 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a6584fb61b6679bd.json +97 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c88365c25b3186d3.json +543 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e8f0481b23f90056.json +711 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/ee55782ed40ebbac.json +110 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fc5082fac8167f3d.json +98 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fd55c329cfe921cc.json +1069 -0
- package/packages/core/src/kernel/attempt-creation-key.ts +20 -0
- package/packages/core/src/kernel/attempt-settlement.ts +125 -0
- package/packages/core/src/kernel/auto-merge-default.ts +1 -3
- package/packages/core/src/kernel/auto-merge.ts +1 -3
- package/packages/core/src/kernel/dispatch-capacity.ts +312 -38
- package/packages/core/src/kernel/dispatch-placement.ts +1 -1
- package/packages/core/src/kernel/dispatch-settings.ts +1 -4
- package/packages/core/src/kernel/dispatch-status.ts +3 -5
- package/packages/core/src/kernel/dispatch-upgrade.ts +1 -1
- package/packages/core/src/kernel/engine.ts +109 -13
- package/packages/core/src/kernel/forge-checks.ts +140 -0
- package/packages/core/src/kernel/forge-health.ts +2 -2
- package/packages/core/src/kernel/generated-files.ts +43 -0
- package/packages/core/src/kernel/generated-regeneration.ts +254 -0
- package/packages/core/src/kernel/generators/build-log.ts +30 -2
- package/packages/core/src/kernel/generators/optimization-log.ts +578 -0
- package/packages/core/src/kernel/generators/panel-log.ts +133 -0
- package/packages/core/src/kernel/guarded-forge.ts +76 -11
- package/packages/core/src/kernel/harvest.ts +1 -4
- package/packages/core/src/kernel/head-paths.ts +4 -1
- package/packages/core/src/kernel/history-retention.ts +337 -0
- package/packages/core/src/kernel/incremental-fixtures.ts +6 -0
- package/packages/core/src/kernel/incremental.ts +14 -4
- package/packages/core/src/kernel/integration-landing.ts +64 -13
- package/packages/core/src/kernel/integration-stack.ts +123 -20
- package/packages/core/src/kernel/integration-state.ts +39 -2
- package/packages/core/src/kernel/janitor-failure.ts +2 -0
- package/packages/core/src/kernel/kernel-git.ts +1 -1
- package/packages/core/src/kernel/landing-measurement.ts +275 -0
- package/packages/core/src/kernel/landing-readiness.ts +2 -0
- package/packages/core/src/kernel/landing-state.ts +20 -1
- package/packages/core/src/kernel/leaf-restack-state.ts +17 -1
- package/packages/core/src/kernel/log-index-value.ts +2 -0
- package/packages/core/src/kernel/log-index.ts +81 -3
- package/packages/core/src/kernel/measurement.ts +406 -0
- package/packages/core/src/kernel/mixed-version.ts +6 -3
- package/packages/core/src/kernel/node-landing.ts +92 -18
- package/packages/core/src/kernel/node-restack-state.ts +27 -1
- package/packages/core/src/kernel/node-restack-transaction.ts +80 -23
- package/packages/core/src/kernel/node-verification-context.ts +14 -4
- package/packages/core/src/kernel/open-pr-backpressure-state.ts +24 -0
- package/packages/core/src/kernel/open-pr-backpressure.ts +133 -0
- package/packages/core/src/kernel/optimization-admission.ts +249 -0
- package/packages/core/src/kernel/optimization.ts +774 -0
- package/packages/core/src/kernel/panel.ts +225 -0
- package/packages/core/src/kernel/phases.ts +42 -6
- package/packages/core/src/kernel/pr-attachments.ts +4 -16
- package/packages/core/src/kernel/pr-summary.ts +2 -2
- package/packages/core/src/kernel/read-deferrals.ts +2 -2
- package/packages/core/src/kernel/read-facts.ts +69 -31
- package/packages/core/src/kernel/reconcile-restack.ts +352 -103
- package/packages/core/src/kernel/reducer-identity.ts +659 -0
- package/packages/core/src/kernel/reducer-registry.ts +37 -3
- package/packages/core/src/kernel/reducer-revisions.ts +50 -0
- package/packages/core/src/kernel/reducer.ts +208 -9
- package/packages/core/src/kernel/reopen-state.ts +48 -0
- package/packages/core/src/kernel/reopen.ts +143 -0
- package/packages/core/src/kernel/replay-retention.ts +208 -39
- package/packages/core/src/kernel/repository-attention.ts +1 -1
- package/packages/core/src/kernel/service-facts.ts +19 -7
- package/packages/core/src/kernel/terminal-guard.ts +13 -5
- package/packages/core/src/kernel/ticket-handbacks.ts +1 -1
- package/packages/core/src/kernel/ticket-migrations.ts +1 -1
- package/packages/core/src/kernel/ticket-preparation.ts +1 -1
- package/packages/core/src/kernel/ticket-source-health.ts +1 -1
- package/packages/core/src/kernel/ticket-starts.ts +118 -0
- package/packages/core/src/kernel/ticket-wait.ts +37 -2
- package/packages/core/src/kernel/verify-diff-base.ts +62 -0
- package/packages/core/src/kernel/verify-stage-state.ts +1 -0
- package/packages/core/src/kernel/verify-stages.ts +41 -1
- package/packages/core/src/objective.ts +532 -0
- package/packages/core/src/ontology.ts +49 -6
- package/packages/core/src/operator/annotations.ts +35 -4
- package/packages/core/src/operator/control.ts +2 -1
- package/packages/core/src/operator/index.ts +12 -0
- package/packages/core/src/operator/optimization.ts +307 -0
- package/packages/core/src/operator/protocol.ts +30 -1
- package/packages/core/src/operator/query.ts +15 -1
- package/packages/core/src/operator/registry.ts +219 -13
- package/packages/core/src/operator/requests.ts +25 -2
- package/packages/core/src/operator/ticket-start.ts +152 -0
- package/packages/core/src/operator/tickets.ts +3 -2
- package/packages/core/src/plugin-sdk/index.ts +2 -0
- package/packages/core/src/plugins/registry.ts +1 -0
- package/packages/core/src/ports/forge/contract.ts +9 -0
- package/packages/core/src/ports/forge/fake.ts +23 -2
- package/packages/core/src/ports/forge/git-rewrite.ts +6 -4
- package/packages/core/src/ports/forge/github-readiness.ts +1 -1
- package/packages/core/src/ports/forge/github-transport.ts +156 -1
- package/packages/core/src/ports/forge/github.ts +306 -100
- package/packages/core/src/ports/forge/readiness.ts +15 -3
- package/packages/core/src/ports/forge-failure.ts +22 -0
- package/packages/core/src/ports/forge-request-context.ts +23 -1
- package/packages/core/src/ports/forge-telemetry.ts +16 -0
- package/packages/core/src/ports/runner/antigravity.ts +1071 -0
- package/packages/core/src/ports/runner/claude.ts +6 -1
- package/packages/core/src/ports/runner/codex.ts +11 -2
- package/packages/core/src/ports/runner/contract.ts +25 -1
- package/packages/core/src/ports/runner/fake.ts +2 -2
- package/packages/core/src/ports/runner/native-cli-fixture.ts +40 -5
- package/packages/core/src/ports/runner/native-process-fixture.ts +4 -1
- package/packages/core/src/ports/runner/pi.ts +23 -7
- package/packages/core/src/ports/runner/production.ts +19 -2
- package/packages/core/src/ports/runner/session-env.ts +65 -5
- package/packages/core/src/ports/runner/start-prompt.ts +6 -4
- package/packages/core/src/ports/tickets/contract.ts +4 -2
- package/packages/core/src/ports/tickets/github.ts +20 -5
- package/packages/core/src/ports/tickets/hosted-index.ts +6 -1
- package/packages/core/src/ports/tickets/labels.ts +21 -0
- package/packages/core/src/ports/tickets/linear.ts +33 -0
- package/packages/core/src/ports/tickets/migration.ts +2 -0
- package/packages/core/src/ports/tickets/priority.ts +11 -0
- package/packages/core/src/ports/tickets/remote-protocol.ts +71 -6
- package/packages/core/src/ports/tickets/remote.ts +138 -16
- package/packages/core/src/ports/tickets/tree.ts +17 -4
- package/packages/core/src/ports/types.ts +98 -4
- package/packages/core/src/ports/workspace/builtin-capabilities.ts +7 -4
- package/packages/core/src/ports/workspace/commit-preservation.ts +182 -64
- package/packages/core/src/ports/workspace/create.ts +3 -0
- package/packages/core/src/ports/workspace/git-worktree.ts +13 -1
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +242 -61
- package/packages/core/src/processes/build-execution-state.ts +1 -3
- package/packages/core/src/processes/build-runner.ts +1435 -132
- package/packages/core/src/processes/dispatch-failure-budget.ts +1 -1
- package/packages/core/src/processes/dispatcher-selectors.ts +15 -13
- package/packages/core/src/processes/dispatcher.ts +2781 -242
- package/packages/core/src/processes/execution-no-progress.ts +36 -1
- package/packages/core/src/processes/execution-settlement.ts +2 -6
- package/packages/core/src/processes/harvest-execution-state.ts +2 -6
- package/packages/core/src/processes/harvest-runner.ts +7 -2
- package/packages/core/src/processes/infrastructure-failure-budget.ts +1 -3
- package/packages/core/src/processes/judge-launcher.ts +38 -0
- package/packages/core/src/processes/measurement-runner.ts +235 -0
- package/packages/core/src/processes/optimization-merges.ts +101 -0
- package/packages/core/src/processes/optimization-stop.ts +179 -0
- package/packages/core/src/processes/panel-runner.ts +756 -0
- package/packages/core/src/processes/phase-failure-budget.ts +1 -0
- package/packages/core/src/processes/publication-state.ts +1 -4
- package/packages/core/src/processes/repo-view.ts +77 -5
- package/packages/core/src/processes/sandbox-state.ts +1 -4
- package/packages/core/src/processes/tick-state.ts +1 -3
- package/packages/core/src/processes/workspace-preservation.ts +67 -9
- package/packages/core/src/scenarios/harness.ts +19 -8
- package/packages/core/src/store/contract.ts +44 -0
- package/packages/core/src/store/digest.ts +89 -7
- package/packages/core/src/store/judge-authority.ts +161 -0
- package/packages/core/src/store/phase-session.ts +226 -4
- package/packages/core/src/store/reduced-reads.ts +10 -0
- package/packages/core/src/store/reducer-value-shapes.json +17060 -12099
- package/packages/core/src/store/remote/client.ts +12 -2
- package/packages/core/src/store/remote/credentials.ts +31 -1
- package/packages/core/src/store/remote/index.ts +8 -0
- package/packages/core/src/store/remote/protocol.ts +38 -0
- package/packages/core/src/store/remote/released-clients.json +11 -0
- package/packages/core/src/store/remote/released-reducer-values/1.10.0.json +34439 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -16
- package/packages/core/src/store/remote/token.ts +13 -4
- package/packages/core/src/store/repo-state-events.ts +6 -8
- package/packages/core/src/store/session-reducer.ts +1 -4
- package/packages/core/src/store/ticket-assets.ts +1 -3
- package/packages/core/src/store/types.ts +9 -0
- package/packages/core/src/testing/dispatch-read-budget.ts +70 -0
- package/packages/core/src/testing/git-config-isolation.ts +25 -0
- package/packages/core/src/testing/index.ts +13 -0
- package/packages/core/src/testing/reduced-read-budget.ts +3455 -34
- package/skills/code-review/SKILL.md +16 -0
- package/skills/finalize/SKILL.md +10 -4
- package/skills/guide/SKILL.md +383 -77
- package/skills/guide/references/integration-tree.md +102 -11
- package/skills/guide/references/merge-policy.md +30 -14
- package/skills/guide/references/migration-1.0.md +2 -1
- package/skills/guide/references/operator-api.md +117 -14
- package/skills/guide/references/optimization-nodes.md +1042 -0
- package/skills/guide/references/plugin-authoring.md +46 -12
- package/skills/guide/references/remote-store-protocol.md +46 -7
- package/skills/guide/references/remote-ticket-protocol.md +50 -2
- package/skills/guide/references/restacking.md +99 -11
- package/skills/guide/references/setup.md +13 -2
- package/skills/guide/references/spec-standard.md +2 -1
- package/skills/guide/references/ticket-dependencies.md +5 -0
- package/skills/guide/references/ticket-migration.md +4 -2
- package/skills/implement/SKILL.md +51 -1
- package/skills/judge/SKILL.md +43 -0
- package/skills/operate/SKILL.md +243 -28
- package/skills/plan/SKILL.md +18 -0
- package/skills/plan-review/SKILL.md +15 -1
- package/skills/propose/SKILL.md +121 -0
- package/skills/reconcile/SKILL.md +21 -2
- package/skills/spec/SKILL.md +30 -4
- package/skills/tickets/SKILL.md +44 -5
- package/templates/hosted-service/package.json +2 -2
package/docs/ticket-sources.md
CHANGED
|
@@ -12,6 +12,24 @@ order: 13
|
|
|
12
12
|
|
|
13
13
|
A ticket source owns ticket CRUD, lifecycle transitions, claiming, labels, blockers and creation identity. The build's pinned spec, history, transcripts and artifacts live in the BuildStore; editing a ticket after claim doesn't replace the pinned spec. See [Tickets are the interface](tickets.md) for grooming and the ready gate.
|
|
14
14
|
|
|
15
|
+
## Creation labels
|
|
16
|
+
|
|
17
|
+
`[tickets].createLabels` marks every ticket Autobuild files, so a shared tracker can tell them apart from reports people file:
|
|
18
|
+
|
|
19
|
+
```toml
|
|
20
|
+
[tickets]
|
|
21
|
+
source = "github"
|
|
22
|
+
readyLabels = []
|
|
23
|
+
createLabels = ["autobuild"]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- **Where.** `ab ticket create`, the operator `tickets.create` tool, harvest proposals and optimization attempts add the labels.
|
|
27
|
+
- **Union.** Labels a create names are kept, and the creation labels are added after them; they never replace each other. A harvest proposal carries `autobuild:proposal` plus the creation labels, including when a retried create adopts the ticket it already filed.
|
|
28
|
+
- **Import.** `ab ticket import` keeps the exported labels and never adds creation labels.
|
|
29
|
+
- **Not a ready gate.** Creation labels are ordinary labels and count toward `readyLabels` only if listed there too. A name in both lists makes every Autobuild-filed ticket pass the label gate. On `github` and `linear` an omitted `readyLabels` defaults to `["autobuild"]`, so pair `createLabels = ["autobuild"]` with an explicit `readyLabels`, as above.
|
|
30
|
+
- **Reserved names.** `github` refuses `autobuild:<state>` and `autobuild-link:` labels and `node`; `linear` refuses `node`. `[]` or omission adds none.
|
|
31
|
+
- **Hosted.** The service's own operator `tickets.create` applies the value from the published ticket policy, so it sees a change at the next publish: any non-delegated `ab` ticket command, `ab connect`, or dispatcher start. A service older than this field refuses a policy naming it.
|
|
32
|
+
|
|
15
33
|
## Shipped adapters
|
|
16
34
|
|
|
17
35
|
Install with `bun add -d --exact @defrex/autobuild`. Examples are complete minimal `autobuild.toml` files. Credentials go in the dispatcher environment or an ignored `.env`, never TOML.
|
|
@@ -137,9 +155,9 @@ rejectedState = "rejected"
|
|
|
137
155
|
- **States are `autobuild:` labels.** An open issue with one `autobuild:<state>` label is in that state, and an open issue with none is in triage, so issues filed on GitHub arrive there. An issue with two or more state labels is left out of listings with a diagnostic naming it and its labels. `ab ticket state create icebox --about "…"` creates the `autobuild:icebox` label, with the purpose as its description. A name is one to forty lowercase letters, digits or hyphens, starting with a letter.
|
|
138
156
|
- **Closing reasons.** Closed as completed, or closed before GitHub recorded reasons, is done. Closed as not planned or duplicate is in the `rejectedState` state; without `rejectedState` it reads as a fixed `not-planned` state that is never ready, never resolves a blocker and can't be moved into. Moving to done or rejected closes the issue with that reason (an issue already closed with the other reason is reopened and closed again, because GitHub changes a reason only with the state); moving to any other state opens it with exactly that state's label.
|
|
139
157
|
- **Reopen goes to triage.** If a state label survived the close, the adapter strips that stale label the first time it reads the reopened issue. It tells stale from fresh by the issue's last 100 label and reopen events; an issue whose deciding event is older than that is left out of listings with a diagnostic until its state label is removed and re-added.
|
|
140
|
-
- **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate. Missing labels are created on demand. State and link labels are never part of a ticket's labels, and a write that names one is refused. The `autobuild:proposal` and `autobuild:aborted` labels that harvest and abort apply are ordinary labels, so `proposal` and `aborted` can't be states.
|
|
158
|
+
- **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate. Missing labels, [creation labels](#creation-labels) included, are created on demand. State and link labels are never part of a ticket's labels, and a write that names one is refused. The `autobuild:proposal` and `autobuild:aborted` labels that harvest and abort apply are ordinary labels, so `proposal` and `aborted` can't be states.
|
|
141
159
|
- **Assignee.** `readyAssignee = "me"` keeps only issues assigned to the login that owns the GitHub credential; a username, including an Enterprise Managed User login such as `mona_acme`, names a specific user. The ready read itself is narrowed by assignee, an unassigned issue is never ready, and any one of several assignees matches. While `readyAssignee` is set, each scan reports open ready issues that carry every `readyLabels` entry but have no assignee in the ticket diagnostics, which `ab repository status` and the dashboards show, naming the ten lowest-numbered and counting the rest. The report never claims or assigns them; assigning one makes it claimable. `"me"` costs one `GET /user` per dispatcher start, never during a tick, so a reload that enables it needs no restart unless startup couldn't resolve the credential's owner.
|
|
142
|
-
- **Assignees.** Tickets carry the issue's assignees as an `assignees` array of usernames in JSON reads, whether they were set on GitHub or through `ab`, and `ab ticket show` prints them. They aren't part of the ticket's `revision`. `--assignees` on `ab ticket create` and `ab ticket update`, and the `assignees` field of the operator `tickets.create` and `tickets.update` tools, set them: each entry is a username or `me`, at most ten entries counted before duplicates collapse, and an update replaces the whole set. `createAssignee = "me"` (or a username) assigns every ticket Autobuild creates, through `ab ticket create`, operator `tickets.create` and harvest proposals, unless the create names its own assignees; a harvest proposal goes to the owner of the filing dispatcher's credential. That pairs with `readyAssignee = "me"`, so each person's dispatcher picks up the tickets they file. A create or update fails, naming the cause and writing nothing, when `me` has no user behind the credential (a GitHub App installation token has none) or a user can't be assigned issues in the repository. GitHub silently drops assignees a token without push access sets, so a write whose assignees don't come back fails, naming the issue and saying it is unassigned; a retried harvest create adopts that issue and
|
|
160
|
+
- **Assignees.** Tickets carry the issue's assignees as an `assignees` array of usernames in JSON reads, whether they were set on GitHub or through `ab`, and `ab ticket show` prints them. They aren't part of the ticket's `revision`. `--assignees` on `ab ticket create` and `ab ticket update`, and the `assignees` field of the operator `tickets.create` and `tickets.update` tools, set them: each entry is a username or `me`, at most ten entries counted before duplicates collapse, and an update replaces the whole set. `createAssignee = "me"` (or a username) assigns every ticket Autobuild creates, through `ab ticket create`, operator `tickets.create` and harvest proposals, unless the create names its own assignees; a harvest proposal goes to the owner of the filing dispatcher's credential. That pairs with `readyAssignee = "me"`, so each person's dispatcher picks up the tickets they file. A create or update fails, naming the cause and writing nothing, when `me` has no user behind the credential (a GitHub App installation token has none) or a user can't be assigned issues in the repository. GitHub silently drops assignees a token without push access sets, so a write whose assignees don't come back fails, naming the issue and saying it is unassigned; a retried harvest create adopts that issue, assigns it and adds any requested labels it is missing. A write naming assignees costs one check per user per process, `me` reuses the `readyAssignee` `GET /user`, and reads cost nothing extra.
|
|
143
161
|
- **Blockers** are native issue dependencies ("blocked by"), visible on both issues, including ones added on GitHub. A blocker resolves when its issue is done. One in another repository never resolves and is named in the dependency diagnostics. An issue transferred to another repository is no longer a ticket here: its old number reads as missing, so it is never written and never resolves a blocker.
|
|
144
162
|
- **Issue links.** The ticket's own issue is always a `closes` link that can't be removed. Links to other issues are labels named `autobuild-link:<intent> #<n>`, such as `autobuild-link:refs #820`, so they show on the issue and survive edits on GitHub. Each linked issue and intent adds one repository label, which appears in GitHub's label picker; unused link labels are never deleted.
|
|
145
163
|
- **Comments and assets.** Dispatcher notices post as issue comments, but tickets carry no comment history, so `ab ticket show` lists none; export and import read comment history explicitly. Assets live in the BuildStore, with the usual note left as an issue comment.
|
|
@@ -173,7 +191,7 @@ The `file`, `hosted` and `github` sources store [forge issue links](tickets.md#g
|
|
|
173
191
|
|
|
174
192
|
### Optional priority
|
|
175
193
|
|
|
176
|
-
A ticket is `urgent` or `normal` (the default); the dispatcher claims urgent ready work first. The `file` and `hosted` sources store priority: as `priority = "urgent"` frontmatter with no key for normal (`file`), or transactional project data covered by the ticket revision (`hosted`, whose ready listing returns urgent tickets first). `linear` uses its native Urgent priority, described in its section above.
|
|
194
|
+
A ticket is `urgent` or `normal` (the default); the dispatcher claims urgent ready work first, ahead of normal builds waiting for a slot. The `file` and `hosted` sources store priority: as `priority = "urgent"` frontmatter with no key for normal (`file`), or transactional project data covered by the ticket revision (`hosted`, whose ready listing returns urgent tickets first). `linear` uses its native Urgent priority, described in its section above.
|
|
177
195
|
|
|
178
196
|
### Optional ticket tree
|
|
179
197
|
|
|
@@ -208,6 +226,8 @@ Declare `readyAssignee` only if `listReady` filters by `criteria.assignee`; with
|
|
|
208
226
|
|
|
209
227
|
Declare `assignees` only if you store, return and verify ticket assignees; without it, a write naming assignees and a configured `createAssignee` are refused, naming your source. See the [optional assignees capability](plugin-authoring.md#optional-assignees-capability).
|
|
210
228
|
|
|
229
|
+
Labels need no capability: every source stores them. Callers union `[tickets].createLabels` into the draft's `labels` before `create`, so a draft's labels are always exact.
|
|
230
|
+
|
|
211
231
|
Declare tree support only if you keep the [optional tree contract](plugin-authoring.md#optional-ticket-tree-capability) on the same port and harness: exhaustive pagination, canonical targets, revision coverage and atomic rejection.
|
|
212
232
|
|
|
213
233
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
@@ -228,15 +248,13 @@ Only paged operator listings select this capability. Sources without it retain
|
|
|
228
248
|
the full-read fallback, which orders the listing before offset and limit: by
|
|
229
249
|
default a stable urgent-first partition (urgent, then normal, each in source
|
|
230
250
|
order), or for newest the reversed listing, which is newest filed first for
|
|
231
|
-
sources that list in filing order (file, GitHub, Linear).
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
|
|
239
|
-
`HostedTicketSource` retain fallback; the POST list-ready protocol stays exhaustive.
|
|
251
|
+
sources that list in filing order (file, GitHub, Linear). Native errors
|
|
252
|
+
propagate. Unpaged operator listings, CLI ticket lists and dispatcher ready
|
|
253
|
+
scans remain exhaustive through `listReady`/`listAll`. The hosted PostgreSQL
|
|
254
|
+
source counts matches without bodies and reads only the SQL-bounded window.
|
|
255
|
+
File, Linear and GitHub retain fallback; the remote `HostedTicketSource`
|
|
256
|
+
forwards pages to the service's native paging (`list-page`), falling back only
|
|
257
|
+
against a service predating it. The POST list-ready protocol stays exhaustive.
|
|
240
258
|
|
|
241
259
|
Bounded state counts are another optional capability:
|
|
242
260
|
`countStates?(names: readonly string[]): Promise<TicketStateCount[]>`. It returns
|
package/docs/tickets.md
CHANGED
|
@@ -61,15 +61,17 @@ On the `github` source a ticket has assignees. `--assignees alice,me` on `ab tic
|
|
|
61
61
|
bun ab ticket update 412 --assignees octocat
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
Set `[tickets].createLabels` to label every ticket Autobuild creates, including harvest proposals, so a shared tracker separates them from reports people file. `--labels` on create adds to them instead of replacing them, and `ab ticket import` never applies them. See [Creation labels](ticket-sources.md#creation-labels).
|
|
65
|
+
|
|
64
66
|
|
|
65
67
|
## Backlog and rejected
|
|
66
68
|
|
|
67
69
|
Two optional lifecycle roles sit beside triage, ready, claimed and done:
|
|
68
70
|
|
|
69
71
|
- **Backlog** holds work you deferred on purpose. Nothing dispatches from it.
|
|
70
|
-
- **Rejected** holds work you considered and declined. A rejected ticket never unblocks the tickets it blocks, and a rejected child no longer holds its node open.
|
|
72
|
+
- **Rejected** holds work you considered and declined. A rejected ticket never unblocks the tickets it blocks, and a rejected child no longer holds its node open. The dispatcher moves a ticket here only when an optimization attempt ends without landing, including when you abort it.
|
|
71
73
|
|
|
72
|
-
Both roles are recommended. Map each to a native state with `[tickets].backlogState` and `[tickets].rejectedState`; `ab init` writes `backlog` and `rejected` for the file, hosted and GitHub sources, and a Linear team might use `Icebox` and `Canceled`. With a key unset, that role doesn't exist. Your operator agent moves tickets by role, so it never needs your native names:
|
|
74
|
+
Both roles are recommended. Map each to a native state with `[tickets].backlogState` and `[tickets].rejectedState`; `ab init` writes `backlog` and `rejected` for the file, hosted and GitHub sources, and a Linear team might use `Icebox` and `Canceled`. With a key unset, that role doesn't exist, and an [optimization node](optimization-nodes.md) is refused at dispatch: it needs the rejected role for its rejected attempts. Your operator agent moves tickets by role, so it never needs your native names:
|
|
73
75
|
|
|
74
76
|
```sh
|
|
75
77
|
bun ab ticket move AUT-12 --role backlog
|
|
@@ -79,12 +81,13 @@ Moving a ticket back to triage, backlog or ready restores ordinary behavior. "Bu
|
|
|
79
81
|
|
|
80
82
|
## Ready is a gate, not a guarantee
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
Ordinary intake claims only tickets in the ready state with the required labels and any source-specific listing filter, such as a ready assignee. A ticket named by `ab start` (`tickets.start`) must still be in the ready state, but those listing labels and the ready assignee are not applied to it. A ready ticket still waits on:
|
|
83
85
|
|
|
84
86
|
- **Blockers.** Unresolved prerequisite tickets keep it queued; they don't create a blocked build. With nodes, prerequisites with builds must be present at the sampled destination; see [integration and blocker presence](integration-overview.md).
|
|
85
|
-
- **Destination and capacity.** Its target must accept new work, and a capacity slot must be free and not reserved for an integration node awaiting verification, a finished build waiting to re-verify or reconcile, or a build resuming after its ticket wait ends; each of those is admitted before
|
|
87
|
+
- **Destination and capacity.** Its target must accept new work, and a capacity slot must be free and not reserved for an integration node awaiting verification, a finished build waiting to re-verify or reconcile, or a build resuming after its ticket wait ends; each of those is admitted before normal claims (see [slot admission order](dispatcher.md#slot-admission-order)). A pending `ab start` request reserves a slot ahead of the claims and parked work its tier outranks.
|
|
88
|
+
- **Open-PR backpressure.** When the repository configures `maxOpenPrs` and that many root build PRs are open and unmerged, the dispatcher pauses ordinary ready-queue normal-priority claims, even with a free slot, until the count drains to `resumeOpenPrs` (below `maxOpenPrs` when the two are equal). Urgent tickets bypass this gate, and so does every `ab start` tier, which still respects capacity and repository pause. See [`[policy]`](configuration.md#policy) for the thresholds.
|
|
86
89
|
|
|
87
|
-
When a slot is free, the dispatcher takes urgent ready tickets first, then normal ones, each in the source's order.
|
|
90
|
+
When a slot is free, the dispatcher takes urgent ready tickets first, then normal ones, each in the source's order. Urgent tickets also go ahead of normal builds waiting to re-verify, reconcile or resume, though not ahead of urgent ones. A claimed ticket's priority becomes its build's priority; to expedite a build that already exists, run `ab priority <slug> urgent`. Urgent tickets also bypass open-PR backpressure: a blocked urgent ticket waits like any other while normal work proceeds, and an urgent ticket never stops or pauses a running build. The web dashboard's Queue tab lists tickets in the same order and marks urgent ones `URGENT`; the mark shows priority, not that the ticket will dispatch next.
|
|
88
91
|
|
|
89
92
|
Before ready filing, the agent checks `ab repository status --json`. With live
|
|
90
93
|
`operator.registrations`, it records intent, rejected alternatives and out-of-scope
|
|
@@ -92,12 +95,18 @@ reasons in the ticket body, files, tells you the existing operator will pick it
|
|
|
92
95
|
and stops without a watch. Otherwise it takes the operator role for the builds the repository's dispatcher dispatches.
|
|
93
96
|
Your explicit instruction overrides either default; non-ready work needs no watch.
|
|
94
97
|
|
|
95
|
-
At dispatch, Autobuild pins the spec, so later tracker edits don't change what reviewers approved.
|
|
98
|
+
At dispatch, Autobuild pins the spec, so later tracker edits don't change what reviewers approved. Editing the ticket alone publishes nothing; a deliberate revision must be published explicitly, and restarts planning. For a blocked build, your operator agent publishes it while answering an escalation:
|
|
96
99
|
|
|
97
100
|
```sh
|
|
98
101
|
bun ab answer <slug> --revise-spec-from-ticket
|
|
99
102
|
```
|
|
100
103
|
|
|
104
|
+
For a finished leaf that is waiting for its merge decision and not yet merged, reopen it with the revision instead; no escalation is needed, and the open PR is kept. Revising from the ticket also re-pins its assets. See [Send a finished build back](operating.md#send-a-finished-build-back):
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
bun ab reopen <slug> --revise-spec-from-ticket
|
|
108
|
+
```
|
|
109
|
+
|
|
101
110
|
|
|
102
111
|
## Work and node tickets
|
|
103
112
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -57,7 +57,8 @@ bun ab harvest status
|
|
|
57
57
|
- **Ready state:** ticket in the exact ready state with every required label.
|
|
58
58
|
- **Blockers and destination:** blockers done, target node open, required changes in the destination. A target node built by another dispatcher's store never opens here; see [several dispatchers](build-store.md#several-dispatchers-on-one-repository). `ab repository status` lists the queue diagnostics.
|
|
59
59
|
- **Claims:** claimed tickets aren't reclaimed.
|
|
60
|
-
- **
|
|
60
|
+
- **Forge cooldown:** `forge landing/polling paused until <reset>` means a GitHub rate limit holds forge work until that reset, whether a request was refused or a successful response reported the quota exhausted. `forge rate limit <resource>` lines show the last observed quota and when it was seen.
|
|
61
|
+
- **Capacity:** paused unfinished work, and work blocked on a question, keeps its slot; builds waiting for a merge decision, builds waiting on other tickets, and idle collecting nodes take none. A finished build that must re-verify or reconcile, or a build whose ticket wait ended, reserves a slot ahead of normal claims; urgent work, including urgent ready tickets, goes first, and `ab priority <slug> urgent` expedites a waiting build. Node verification and reconciliation account specially for descendants' slots.
|
|
61
62
|
- **Harvest:** check the acknowledged harvest gate and unclaimed observations. Harvest triggers at `policy.harvestThreshold` observations, or `policy.harvestMaxDrift` other merged builds since the oldest observation (zero disables drift), and uses no build slot.
|
|
62
63
|
|
|
63
64
|
## Authentication failures
|
|
@@ -68,7 +69,7 @@ bun ab harvest status
|
|
|
68
69
|
|---|---|
|
|
69
70
|
| Linear | `LINEAR_API_KEY`, team and workflow states, in the actual process environment or supported `.env` |
|
|
70
71
|
| GitHub | `gh auth status` and repository permissions; test Git fetch and push separately. With `source = "github"` tickets, the same token needs Issues read and write |
|
|
71
|
-
| Agent providers | The effective role's runtime: `codex login` when the Codex diagnostic asks; for Pi, provider login and the provider-qualified model |
|
|
72
|
+
| Agent providers | The effective role's runtime: `codex login` when the Codex diagnostic asks; for Pi, provider login and the provider-qualified model; for Antigravity, sign in with `agy` or check `GEMINI_API_KEY` and `modelProvider` |
|
|
72
73
|
| Hosted store | `bun ab connect` for service, project and credential status |
|
|
73
74
|
|
|
74
75
|
- **Provider refusals.** Fix permission, billing and quota failures on the provider side.
|
package/docs/verification.md
CHANGED
|
@@ -115,6 +115,17 @@ Path rules:
|
|
|
115
115
|
|
|
116
116
|
After a reconcile, the `afterReconcile` policy applies before plan and path selection. By default it re-verifies; excluded steps are recorded as policy skips.
|
|
117
117
|
|
|
118
|
+
## What a check command receives
|
|
119
|
+
|
|
120
|
+
A `check` command runs in the build's workspace with `AB_VERIFY_BASE` set to the commit verification compares against, the same base path applicability diffs from:
|
|
121
|
+
|
|
122
|
+
- **Leaf builds:** the branch-cut SHA, or the refreshed base after a completed reconcile or restack.
|
|
123
|
+
- **Integration nodes:** the integration cycle's parent.
|
|
124
|
+
|
|
125
|
+
Use it for checks that only make sense relative to the base, such as "this file changed, so that one must change too": `git diff --name-only "$AB_VERIFY_BASE" HEAD`.
|
|
126
|
+
|
|
127
|
+
The variable is absent outside a build, under a runtime that predates the variable, and for a leaf with no provisioned base. A check that needs it must handle its absence, by skipping that clause with a notice, for example, rather than assuming it is set. Checks that ignore it behave as before.
|
|
128
|
+
|
|
118
129
|
## Route the verifier role
|
|
119
130
|
|
|
120
131
|
Agent steps route by step name, not skill name: [`[roles.acceptance]`](agent-runtimes.md#choosing-models) picks the agent for the `acceptance` step. Omitted `runtime` and `model` each inherit from the default role.
|
package/docs/workspaces.md
CHANGED
|
@@ -113,7 +113,7 @@ Sandbox preparation order:
|
|
|
113
113
|
- **Runtimes.** Every primary and alternate runtime needs a pinned install and exact-version preflight, and gets only the credentials named in `environmentVariables`, except declared [accounts](configuration-overview.md#accounts), whose credentials remain on the host and are brokered by egress policy using guest placeholders.
|
|
114
114
|
- **Repetition.** New sandboxes repeat provisioning and preflights rerun before each build-runner; keep setup idempotent.
|
|
115
115
|
- **Validation.** `bun ab init --validate` runs named provisioning, setup, runtime and Store checks in a disposable environment, deletes it even on failure, and starts no build. For every declared account, including unused accounts, it runs a tool-free model probe through the account's runtime (Claude Code for Claude/Kimi, Codex for ChatGPT); these probes create no ordinary build phase or persistent agent session. Hosted ChatGPT, Claude and Kimi project secrets report readiness from write-only status metadata instead; the first hosted build is the live check.
|
|
116
|
-
- **Lifetime.** `timeoutSeconds` bounds a sandbox; provider operations have their own timeouts. An intact sandbox resumes. Before replacement, the dispatcher fences it, preserves reachable unpublished commits to build-private refs, and records a receipt; the next workspace restores those commits. Loss is limited to already absent or unrecoverable work and uncommitted files; known loss appears in the next session's recovery context. See the [workspace recovery contract](architecture.md#key-boundaries).
|
|
116
|
+
- **Lifetime.** `timeoutSeconds` bounds a sandbox; provider operations have their own timeouts. An intact sandbox resumes. Before replacement, the dispatcher fences it, preserves reachable unpublished commits to build-private archive refs or, where the forge refuses them, BuildStore copies, and records a receipt; the next workspace restores those commits. Loss is limited to already absent or unrecoverable work and uncommitted files; known loss appears in the next session's recovery context. See the [workspace recovery contract](architecture.md#key-boundaries).
|
|
117
117
|
|
|
118
118
|
### Private repositories
|
|
119
119
|
|
|
@@ -150,3 +150,5 @@ The suite certifies only the basic working copy. Remote execution adds trusted s
|
|
|
150
150
|
|
|
151
151
|
- Publication reports confirmed SHA and cache tips and supports the required guarded rewrites.
|
|
152
152
|
- Store grants go through the host's `delegateCredential` callback; never serialize host tokens into execution identity.
|
|
153
|
+
- An optional `provisionEstimateMs` declares the expected wall time of one `provision`; a bounded dispatcher invocation does not start provisioning with less budget left.
|
|
154
|
+
- `provision` may receive `adoptAbandoned` when the previous attempt at the same generation was cut off by a recorded dispatcher teardown. Finish that environment in place only after verifying it; otherwise throw `WorkspaceCleanupRequired`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defrex/autobuild",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Agent-driven software delivery from groomed ticket to merged PR",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
160
|
"@biomejs/biome": "2.5.5",
|
|
161
|
-
"@defrex/autobuild-postgres-store": "1.
|
|
162
|
-
"@defrex/autobuild-vercel-sandbox": "1.
|
|
161
|
+
"@defrex/autobuild-postgres-store": "1.10.0",
|
|
162
|
+
"@defrex/autobuild-vercel-sandbox": "1.10.0",
|
|
163
163
|
"@resvg/resvg-js": "2.6.2",
|
|
164
164
|
"@types/bun": "^1.3.14",
|
|
165
165
|
"@types/node": "^24.0.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomBytes } from 'node:crypto'
|
|
2
|
-
import {
|
|
2
|
+
import type { JWTVerifyGetKey } from 'jose'
|
|
3
3
|
import { chatgptStateSchema, earliestRefreshAt, type ChatGPTState } from './chatgpt-state'
|
|
4
4
|
|
|
5
5
|
const issuer = 'https://auth.openai.com'
|
|
@@ -69,15 +69,17 @@ export function callback(t: OAuthTransaction, url: URL): { code: string; clientI
|
|
|
69
69
|
throw failure()
|
|
70
70
|
return { code, clientId }
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
timeoutDuration: 15000,
|
|
74
|
-
})
|
|
72
|
+
let jwks: JWTVerifyGetKey | undefined
|
|
75
73
|
export async function verifyIdentity(
|
|
76
74
|
idToken: string,
|
|
77
75
|
clientId: string,
|
|
78
76
|
nonce?: string,
|
|
79
|
-
keys
|
|
77
|
+
keys?: JWTVerifyGetKey,
|
|
80
78
|
): Promise<string> {
|
|
79
|
+
const { createRemoteJWKSet, jwtVerify } = await import('jose')
|
|
80
|
+
keys ??= jwks ??= createRemoteJWKSet(new URL(`${issuer}/.well-known/jwks.json`), {
|
|
81
|
+
timeoutDuration: 15000,
|
|
82
|
+
})
|
|
81
83
|
const { payload } = await jwtVerify(idToken, keys, {
|
|
82
84
|
issuer,
|
|
83
85
|
audience: clientId,
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optimization attempt resolution for the CLI (RFC 0005 §6.1, §6.2): whether
|
|
3
|
+
* a session's build is an in-flight attempt of an optimization node, and the
|
|
4
|
+
* harness paths its contribution touches.
|
|
5
|
+
*
|
|
6
|
+
* A build is an attempt exactly when it targets a node whose objective was
|
|
7
|
+
* accepted and its ticket was filed from one of that node's in-flight
|
|
8
|
+
* proposals. Proposal and child refs are compared through the recorded
|
|
9
|
+
* ticket-migration identity, as the dispatcher compares them, so a proposal
|
|
10
|
+
* recorded before a migration still matches a child dispatched after it.
|
|
11
|
+
*/
|
|
12
|
+
import { compilePathSelectors } from '../config/path-selectors'
|
|
13
|
+
import { parseNulChangedPaths } from '../kernel/head-paths'
|
|
14
|
+
import {
|
|
15
|
+
optimizationAttempt,
|
|
16
|
+
type InFlightAttempt,
|
|
17
|
+
type OptimizationState,
|
|
18
|
+
} from '../kernel/optimization'
|
|
19
|
+
import type { BuildState } from '../kernel/reducer'
|
|
20
|
+
import { migrationIdentity } from '../kernel/ticket-migrations'
|
|
21
|
+
import type { TicketRef } from '../ontology'
|
|
22
|
+
import type { Exec } from '../ports/workspace/git-worktree'
|
|
23
|
+
import { readBuildFacts, readRepositoryFacts } from '../store/reduced-reads'
|
|
24
|
+
import type { BuildStore } from '../store/types'
|
|
25
|
+
|
|
26
|
+
export interface AttemptContext {
|
|
27
|
+
/** The node build's slug. */
|
|
28
|
+
node: string
|
|
29
|
+
attempt: InFlightAttempt
|
|
30
|
+
optimization: OptimizationState
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AttemptInput {
|
|
34
|
+
slug: string
|
|
35
|
+
state: BuildState
|
|
36
|
+
/** The build's `build.created` repository. */
|
|
37
|
+
repo: string
|
|
38
|
+
/** The build's `build.created` ticket. */
|
|
39
|
+
ticket: TicketRef
|
|
40
|
+
/** The configured ticket source, the migration destination. Loaded only
|
|
41
|
+
* once the node is known to be an optimization node. */
|
|
42
|
+
ticketSource: () => Promise<string>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The attempt `input.slug` is, or undefined. A build without a target reads
|
|
47
|
+
* nothing; any other build reads its node's served reduced value once, and
|
|
48
|
+
* only an optimization node adds one served repository value. Unresolvable
|
|
49
|
+
* migration continuity throws: an attempt is never silently treated as an
|
|
50
|
+
* ordinary build.
|
|
51
|
+
*/
|
|
52
|
+
export async function readAttemptContext(
|
|
53
|
+
store: Pick<BuildStore, 'getReducerValue' | 'getRepo'>,
|
|
54
|
+
input: AttemptInput,
|
|
55
|
+
): Promise<AttemptContext | undefined> {
|
|
56
|
+
const target = input.state.target
|
|
57
|
+
if (input.state.kind === 'node' || target === undefined) return undefined
|
|
58
|
+
const optimization = (await readBuildFacts(store, target.build)).value.state.optimization
|
|
59
|
+
if (optimization === undefined) return undefined
|
|
60
|
+
const migrations = (await readRepositoryFacts(store, input.repo)).value.ticketMigrations
|
|
61
|
+
const key = migrationIdentity(migrations, await input.ticketSource())
|
|
62
|
+
let attempt: InFlightAttempt | undefined
|
|
63
|
+
try {
|
|
64
|
+
attempt = optimizationAttempt(optimization, input.ticket, (ref) => key(ref, input.slug))
|
|
65
|
+
} catch (error) {
|
|
66
|
+
const detail = error instanceof Error ? error.message : String(error)
|
|
67
|
+
throw new Error(
|
|
68
|
+
`cannot resolve optimization attempt identity for build ${input.slug}: ${detail}`,
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
if (attempt === undefined) return undefined
|
|
72
|
+
return { node: target.build, attempt, optimization }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The sorted net contribution paths between `base` and `head` that the
|
|
76
|
+
* objective's harness selectors match. A reverted harness edit is absent. */
|
|
77
|
+
export async function harnessPathsTouched(
|
|
78
|
+
exec: Exec,
|
|
79
|
+
workspacePath: string,
|
|
80
|
+
base: string,
|
|
81
|
+
head: string,
|
|
82
|
+
harness: readonly string[],
|
|
83
|
+
): Promise<string[]> {
|
|
84
|
+
const args = ['git', 'diff', '--no-renames', '--name-only', '-z', base, head, '--']
|
|
85
|
+
const result = await exec(args, { cwd: workspacePath })
|
|
86
|
+
if (result.exitCode !== 0)
|
|
87
|
+
throw new Error(
|
|
88
|
+
`${args.join(' ')} exited ${result.exitCode}: ` +
|
|
89
|
+
`${result.stderr.trim() || result.stdout.trim() || '(no output)'}`,
|
|
90
|
+
)
|
|
91
|
+
const matches = compilePathSelectors(harness)
|
|
92
|
+
return [...new Set(parseNulChangedPaths(result.stdout))].filter(matches).sort()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The `ab done` refusal for an attempt whose contribution changes its harness. */
|
|
96
|
+
export function harnessRejection(paths: readonly string[]): Error {
|
|
97
|
+
return new Error(
|
|
98
|
+
'publication rejected: an optimization attempt must not change its harness ' +
|
|
99
|
+
"(the measurement's ruler):\n" +
|
|
100
|
+
paths.map((path) => ` ${path}`).join('\n') +
|
|
101
|
+
"\nRevert these paths to the contribution base, commit, then retry 'ab done'.",
|
|
102
|
+
)
|
|
103
|
+
}
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
type DeferralLedger,
|
|
10
10
|
} from '../kernel/auto-merge'
|
|
11
11
|
import { reduceBuild, type BuildState } from '../kernel/reducer'
|
|
12
|
+
import { actionableEscalations } from '../kernel/ticket-wait'
|
|
13
|
+
import { currentCiFailure } from '../kernel/forge-checks'
|
|
12
14
|
|
|
13
15
|
export interface MergeDecision {
|
|
14
16
|
type: 'build.merge-decision'
|
|
@@ -43,7 +45,8 @@ export function buildNeedsAttention(events: AbEvent[], state: BuildState): boole
|
|
|
43
45
|
state.janitor?.attention === true ||
|
|
44
46
|
!!state.targetRewrite ||
|
|
45
47
|
(state.compatibility?.decisiveFacts ?? 0) > 0 ||
|
|
46
|
-
(state.
|
|
48
|
+
actionableEscalations(state).length > 0 ||
|
|
49
|
+
currentCiFailure(state) !== undefined ||
|
|
47
50
|
mergeDecision(events, new Date(0), state) !== null
|
|
48
51
|
)
|
|
49
52
|
}
|
|
@@ -67,7 +70,11 @@ export function repositoryNeedsAttention(event: RepositoryEvent): boolean {
|
|
|
67
70
|
case 'hook.skipped':
|
|
68
71
|
case 'forge.credential-limited':
|
|
69
72
|
case 'ticket.handed-back':
|
|
73
|
+
case 'ticket.start-settled':
|
|
70
74
|
return true
|
|
75
|
+
case 'dispatcher.forge-degraded':
|
|
76
|
+
// An episode's opening cooldown wakes once; its extensions are silent.
|
|
77
|
+
return event.payload.continued !== true
|
|
71
78
|
case 'dispatcher.config-reloaded':
|
|
72
79
|
return event.payload.restartRequired.length > 0
|
|
73
80
|
case 'dispatcher.run-stopped':
|
|
@@ -12,8 +12,19 @@ import { join } from 'node:path'
|
|
|
12
12
|
import { isSessionlessInvocation, runCli } from './main'
|
|
13
13
|
import { createUpgradeAgentResolver } from './upgrade-agent'
|
|
14
14
|
import { loadDotEnv } from './dotenv'
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
MissingAmbientContextError,
|
|
17
|
+
resolveCliEnv,
|
|
18
|
+
resolveHarvestCliEnv,
|
|
19
|
+
resolveJudgeCliEnv,
|
|
20
|
+
} from './env'
|
|
21
|
+
import { isRemoteStoreRef } from './repo-state'
|
|
22
|
+
import {
|
|
23
|
+
scopeLocalStoreToJudgeSession,
|
|
24
|
+
scopeRemoteStoreToJudgeSession,
|
|
25
|
+
} from '../store/phase-session'
|
|
16
26
|
import { openProductionSessionStore } from './store-opening'
|
|
27
|
+
import { judgeAccountRedaction } from './judge'
|
|
17
28
|
import { processTerminal, processTerminalInput } from './terminal'
|
|
18
29
|
import type { TerminalRestoreProcess } from './terminal-restore'
|
|
19
30
|
import type { DashboardRendererResolver } from './dashboard/render'
|
|
@@ -134,6 +145,46 @@ export async function runDirectBinary(
|
|
|
134
145
|
}
|
|
135
146
|
}
|
|
136
147
|
|
|
148
|
+
if (command === 'judge') {
|
|
149
|
+
let judgeEnv: ReturnType<typeof resolveJudgeCliEnv>
|
|
150
|
+
try {
|
|
151
|
+
judgeEnv = resolveJudgeCliEnv(process.env)
|
|
152
|
+
} catch (error) {
|
|
153
|
+
if (error instanceof MissingAmbientContextError) {
|
|
154
|
+
return runCli(argv, unscopedDeps)
|
|
155
|
+
}
|
|
156
|
+
console.error(error instanceof Error ? error.message : String(error))
|
|
157
|
+
return 1
|
|
158
|
+
}
|
|
159
|
+
const judgeRedact = judgeAccountRedaction(process.env)
|
|
160
|
+
// A local judge holds no store: its preference goes to its outbox.
|
|
161
|
+
if (judgeEnv.store === undefined)
|
|
162
|
+
return runCli(argv, {
|
|
163
|
+
...unscopedDeps,
|
|
164
|
+
judgeEnv,
|
|
165
|
+
...(judgeRedact !== undefined ? { judgeRedact } : {}),
|
|
166
|
+
})
|
|
167
|
+
// A judge's store handle appends its one preference and refuses every
|
|
168
|
+
// read; a remote server is the authority behind the same refusals. A
|
|
169
|
+
// local store path is never set by the runner; set by hand, it is guarded
|
|
170
|
+
// the same way.
|
|
171
|
+
const inner = openProductionStore(judgeEnv.store, judgeEnv.token)
|
|
172
|
+
const scope = {
|
|
173
|
+
build: judgeEnv.build,
|
|
174
|
+
panel: judgeEnv.panel,
|
|
175
|
+
judge: judgeEnv.judge,
|
|
176
|
+
session: judgeEnv.session,
|
|
177
|
+
}
|
|
178
|
+
const store = isRemoteStoreRef(judgeEnv.store)
|
|
179
|
+
? scopeRemoteStoreToJudgeSession(inner, scope)
|
|
180
|
+
: scopeLocalStoreToJudgeSession(inner, scope)
|
|
181
|
+
try {
|
|
182
|
+
return await runCli(argv, { ...unscopedDeps, store, judgeEnv })
|
|
183
|
+
} finally {
|
|
184
|
+
await store.close()
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
137
188
|
let cliEnv: ReturnType<typeof resolveCliEnv>
|
|
138
189
|
try {
|
|
139
190
|
cliEnv = resolveCliEnv(process.env)
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { selectDispatchMode } from './dispatch-mode'
|
|
2
1
|
import { spawnExec } from '../ports/workspace/git-worktree'
|
|
3
2
|
import { join } from 'node:path'
|
|
4
3
|
import type { DashboardRendererResolver } from './dashboard/render'
|
|
5
4
|
import { loadDotEnv } from './dotenv'
|
|
6
5
|
import { parseDispatchArgs } from './dispatch-args'
|
|
7
|
-
import { launchDispatcher } from './dispatch-launcher'
|
|
8
6
|
import { DISPATCH_GENERATION_ENV, DISPATCH_CONDITIONAL_ENV } from './dispatch-launch-contract'
|
|
9
7
|
export {
|
|
10
8
|
usesGenericSessionlessSigintHandler,
|
|
@@ -30,6 +28,7 @@ export async function runBinary(
|
|
|
30
28
|
try {
|
|
31
29
|
const args = parseDispatchArgs(argv.slice(1), process.env)
|
|
32
30
|
if (!args.viewer && !args.once && !args.repository) {
|
|
31
|
+
const { selectDispatchMode } = await import('./dispatch-mode')
|
|
33
32
|
const mode = await selectDispatchMode({
|
|
34
33
|
...args,
|
|
35
34
|
targetRepo: process.cwd(),
|
|
@@ -37,7 +36,10 @@ export async function runBinary(
|
|
|
37
36
|
exec: spawnExec,
|
|
38
37
|
stderr: console.error,
|
|
39
38
|
})
|
|
40
|
-
if (!mode.viewer)
|
|
39
|
+
if (!mode.viewer) {
|
|
40
|
+
const { launchDispatcher } = await import('./dispatch-launcher')
|
|
41
|
+
return await launchDispatcher(argv)
|
|
42
|
+
}
|
|
41
43
|
const { runDirectBinary } = await import('./binary-direct')
|
|
42
44
|
return runDirectBinary(
|
|
43
45
|
[...argv, '--viewer', '--dispatched-by', mode.dispatchedBy!],
|