@defrex/autobuild 1.8.1 → 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 +1602 -134
- 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 +320 -53
- package/docs/builds.md +5 -0
- package/docs/cli.md +7 -1
- package/docs/configuration-overview.md +1 -0
- package/docs/configuration.md +515 -49
- package/docs/dispatcher-hosting.md +4 -0
- 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 +70 -14
- package/docs/migration-1.0.md +2 -1
- package/docs/operating.md +53 -4
- package/docs/operator-api.md +128 -16
- package/docs/optimization-nodes.md +1042 -0
- package/docs/overview.md +1 -1
- package/docs/plugin-authoring.md +50 -13
- package/docs/remote-store-protocol.md +46 -7
- package/docs/remote-ticket-protocol.md +50 -2
- package/docs/restacking.md +102 -10
- package/docs/seams.md +2 -2
- package/docs/setup.md +16 -3
- 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 +18 -6
- package/docs/workspaces.md +3 -1
- package/package.json +4 -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 +11 -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 +24 -3
- package/packages/core/src/cli/dashboard/model.ts +127 -33
- package/packages/core/src/cli/dashboard/objective-row.ts +189 -0
- package/packages/core/src/cli/dashboard/render.ts +49 -3
- 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 +136 -5
- package/packages/core/src/cli/env.ts +42 -0
- package/packages/core/src/cli/help.ts +212 -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 +179 -19
- package/packages/core/src/cli/status.ts +195 -17
- 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 +1325 -628
- package/packages/core/src/config/create-labels.ts +23 -0
- package/packages/core/src/config/live.ts +3 -0
- package/packages/core/src/config/load.ts +19 -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 +226 -9
- package/packages/core/src/events/catalog.ts +41 -3
- package/packages/core/src/events/compatibility.ts +7 -1
- package/packages/core/src/events/payloads.ts +610 -1
- package/packages/core/src/events/policy.ts +62 -0
- package/packages/core/src/events/repository.ts +147 -21
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +1512 -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 +34 -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/generators/repository-journals.ts +18 -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 +76 -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 +9 -1
- 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 +151 -10
- package/packages/core/src/ports/forge/git-rewrite.ts +38 -5
- package/packages/core/src/ports/forge/github-readiness.ts +1 -1
- package/packages/core/src/ports/forge/github-squash-message.ts +89 -0
- package/packages/core/src/ports/forge/github-transport.ts +186 -1
- package/packages/core/src/ports/forge/github.ts +846 -239
- 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 +145 -7
- 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 +5 -6
- 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 +2874 -266
- package/packages/core/src/processes/execution-no-progress.ts +38 -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/hook-command.ts +125 -0
- package/packages/core/src/processes/hook-webhook.ts +144 -0
- package/packages/core/src/processes/hooks.ts +740 -0
- 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 +72 -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 +17254 -11861
- 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 +22 -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/1.9.0.json +29475 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -14
- package/packages/core/src/store/remote/token.ts +13 -4
- package/packages/core/src/store/repo-state-events.ts +9 -8
- package/packages/core/src/store/retention.ts +16 -2
- 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 +14 -0
- package/packages/core/src/testing/reduced-read-budget.ts +3950 -54
- package/skills/code-review/SKILL.md +16 -0
- package/skills/finalize/SKILL.md +10 -4
- package/skills/guide/SKILL.md +464 -83
- package/skills/guide/references/integration-tree.md +102 -11
- package/skills/guide/references/merge-policy.md +70 -14
- package/skills/guide/references/migration-1.0.md +2 -1
- package/skills/guide/references/operator-api.md +128 -16
- package/skills/guide/references/optimization-nodes.md +1042 -0
- package/skills/guide/references/plugin-authoring.md +50 -13
- 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 +102 -10
- package/skills/guide/references/setup.md +16 -3
- 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 +267 -32
- 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/architecture.md
CHANGED
|
@@ -25,7 +25,11 @@ disagree, the code is authoritative.
|
|
|
25
25
|
forward. Pending operator commands remain actionable.
|
|
26
26
|
3. **Ingesters propose, humans dispatch.** Nothing auto-generated passes
|
|
27
27
|
Triage without a human grooming it to Ready, unless the repository waives
|
|
28
|
-
that gate explicitly with `[tickets].proposalState
|
|
28
|
+
that gate explicitly with `[tickets].proposalState` for its own harvest.
|
|
29
|
+
An optimization node's attempts are the one other path: grooming the
|
|
30
|
+
node's objective, purpose, budget and stop policy is the dispatch decision
|
|
31
|
+
for the attempts its proposer files, so within that budget they go
|
|
32
|
+
straight to Ready. The gate still holds for all other generated work.
|
|
29
33
|
4. **Every step leaves a paper trail** — queryable, not carried in the repo.
|
|
30
34
|
|
|
31
35
|
## Pipeline
|
|
@@ -93,7 +97,7 @@ remote-store protocol requires matching client and server versions.
|
|
|
93
97
|
| `packages/core/src/ports/` | TicketSource / Workspace / Forge / AgentRunner / Telemetry interfaces, adapters, and fakes; registry-aware builtin/plugin construction; eager primary/alternate runtime routing and provider-failure classification, awaited native identity observation and optional fresh-process native resume under `ports/runner/` | §3.2, §9, §13 |
|
|
94
98
|
| `packages/core/src/plugins/` | Strict versioned plugin manifests, dual-root repository/package Bun loading, owner-aware adapter registration, contract/credential metadata, and runtime-factory materialization | §3.2.1, §9 |
|
|
95
99
|
| `packages/core/src/plugin-sdk/` | The sole supported `@defrex/autobuild/plugin-sdk` barrel: port/manifest types, contract suites, and reference fakes | §3.2.1 |
|
|
96
|
-
| `packages/core/src/processes/` | build-runner and standalone child composition, durable execution config/diagnostics, dispatcher (+ janitor duty, sandbox idle settlement and harvest trigger), harvest deterministic core + runner | §3.3, §7.1.2, §12, §15.7 |
|
|
100
|
+
| `packages/core/src/processes/` | build-runner and standalone child composition, durable execution config/diagnostics, dispatcher (+ janitor duty, sandbox idle settlement and harvest trigger), harvest deterministic core + runner, configured hook delivery (`hooks.ts`, `hook-command.ts`, `hook-webhook.ts`) | §3.3, §7.1.2, §12, §15.7, §16.1 |
|
|
97
101
|
| `packages/core/src/cli/` and `bin/` | The `ab` CLI — the only agent↔store channel — plus the shared presentation-only durable-progress projection, init/upgrade, the filesystem-only dispatch launcher and immutable generation cache, the dispatch frontend (Store-backed, plus the viewer's ticket-source triage count), its private supervised kernel entry, and `bin/ab-build-runner.ts` (one child per build) | §8, §14, §16.3 |
|
|
98
102
|
| `packages/core/src/cli/dashboard/` | `ab dispatch`'s fixed live frame: pure projection, renderer, poll cache, and deterministic image renderer | §14 |
|
|
99
103
|
| `bin/agent/ab` | Private launcher placed first on agent-session `PATH`; delegates to the canonical `bin/ab.ts` | §8.1 |
|
|
@@ -146,11 +150,39 @@ wrappers over the same fold, so results cannot diverge, and a property test
|
|
|
146
150
|
checks every split point of fixture and generated logs. The accumulator is plain
|
|
147
151
|
JSON, so it survives a serialize-and-parse round trip. `advance` never mutates
|
|
148
152
|
its input: it clones, then folds, so a state derived earlier is never disturbed
|
|
149
|
-
by a later advance. Each reducer publishes a `version
|
|
150
|
-
accumulator
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
by a later advance. Each reducer publishes a `version`, because a cached
|
|
154
|
+
accumulator is only valid for the version that wrote it. The version is derived,
|
|
155
|
+
never edited (`kernel/reducer-identity.ts`): a frozen legacy base, plus one for
|
|
156
|
+
each line naming the reducer's identity in the append-only revision ledger
|
|
157
|
+
`kernel/reducer-revisions.ts`, plus the versions of its declared parts. When an
|
|
158
|
+
accumulator shape or fold changes, `bun tools/reducer-revision.ts <shape|fold>
|
|
159
|
+
<identity> --reason "…"` appends a line with a random id. The ledger merges by
|
|
160
|
+
union (`.gitattributes`), so two branches that revise the same reducer combine
|
|
161
|
+
without a conflict into a version higher than either, and versions only grow.
|
|
162
|
+
Never delete a ledger line, even to revert: a lower version would be reduced
|
|
163
|
+
again on every read. The registry integration test's revision guard enforces
|
|
164
|
+
this against the verify base (`AB_VERIFY_BASE`): it fails a change that drops a
|
|
165
|
+
base ledger line, or under which any identity both commits construct derives a
|
|
166
|
+
lower version than the base's own code did, through the ledger, a frozen legacy
|
|
167
|
+
base or a part. A deregistered identity keeps its lines and is not compared.
|
|
168
|
+
`kernel/reducer-registry.ts` lists every reducer, and its
|
|
169
|
+
integration test checks the derivation and fails when an accumulator shape
|
|
170
|
+
changes without a revision. It also holds the identity records under
|
|
171
|
+
`kernel/__snapshots__/reducer-identity-records/`: per reducer identity and
|
|
172
|
+
revision set, the accumulator digest after each deterministic test corpus.
|
|
173
|
+
Every corpus a record has covered is kept in the content-addressed
|
|
174
|
+
`reducer-identity-corpora/` archive and stays checked under that identity, so
|
|
175
|
+
corpora may change freely while a fold change without a revision still fails.
|
|
176
|
+
`AB_UPDATE_REDUCER_SHAPES=1` on that test regenerates the shapes and adds one
|
|
177
|
+
new record file; record files are only ever added, never edited or deleted. One
|
|
178
|
+
state passes the records with a notice rather than silently: after revisions
|
|
179
|
+
combine through a clean restack and before anyone regenerates, the combined
|
|
180
|
+
identity has no record of its own. A base-relative clause catches a fold change
|
|
181
|
+
there: against the verify base (`AB_VERIFY_BASE`), a reducer whose change adds
|
|
182
|
+
no revision must fold every corpus as the base's records, or failing those the
|
|
183
|
+
base's own code, did. The clause is skipped, with a notice, in two cases: when
|
|
184
|
+
no base is supplied, and when the supplied base predates the revision ledger.
|
|
185
|
+
The revision guard skips, with its own notice, in the same two cases. Either way the identity-record checks above stay in force. Current-state consumers use the typed persisted
|
|
154
186
|
read helpers in `store/reduced-reads.ts`; whole-array reducers remain pure
|
|
155
187
|
reference projections for tests and explicit historical output.
|
|
156
188
|
|
|
@@ -211,6 +243,7 @@ Published clients with a recorded published catalog identity, or without a catal
|
|
|
211
243
|
identity, receive answers projected onto their
|
|
212
244
|
frozen released contracts in `store/remote/released-reducer-values/` and stamped
|
|
213
245
|
with their released reducer versions, including projection-capable published clients.
|
|
246
|
+
The projection covers both named reducer values and historical stream seeds.
|
|
214
247
|
`reducerValueForClient` omits optional `lastEvent` fields with newer event variants,
|
|
215
248
|
including nested build state, and filters `seenTypes` to known event types while
|
|
216
249
|
preserving canonical cursor, progress, and compatibility facts. An invalid envelope
|
|
@@ -327,16 +360,67 @@ identity for the finite `builds`, `build status`, and `artifact download` read
|
|
|
327
360
|
shells: no identity retains operator authority, while any partial, malformed,
|
|
328
361
|
shared-only, or mixed identity fails closed before Store opening. Remote
|
|
329
362
|
references keep the existing token-backed client unchanged. Local references
|
|
330
|
-
are wrapped by `packages/core/src/store/phase-session.ts`, which permits
|
|
363
|
+
are wrapped by `packages/core/src/store/phase-session.ts`, which permits the exact
|
|
331
364
|
ambient build or repository resource (this is the phase-session wrapper, not the
|
|
332
365
|
operator-session scope handle in `session-handle.ts`) and rejects
|
|
333
366
|
agent-attributed event writes
|
|
334
|
-
for any session other than `AB_SESSION`.
|
|
367
|
+
for any session other than `AB_SESSION`. One read-only exception serves a
|
|
368
|
+
targeted build that is not itself a node, such as an optimization attempt or
|
|
369
|
+
another node child: it may read its target node's `buildReadFacts` value, its
|
|
370
|
+
own repository's `repositoryReadFacts` value and that repository's record, so
|
|
371
|
+
attempt context, harness protection and `--no-improvement` work in the session.
|
|
372
|
+
The grant is derived once per handle from the scoped build's own facts. Every
|
|
373
|
+
other foreign read, any unrelated build or repository, and every foreign write
|
|
374
|
+
remain refused. The wrapper deliberately allows
|
|
335
375
|
non-agent actors because phase terminals also run trusted kernel plumbing in
|
|
336
376
|
that CLI process; resource authority still applies to every operation. Generic
|
|
337
377
|
sessionless opening remains unwrapped; only those three reads use the dedicated
|
|
338
378
|
ambient-aware finite opener.
|
|
339
379
|
|
|
380
|
+
**Judge panels.** `packages/core/src/kernel/panel.ts` holds a judge panel's
|
|
381
|
+
pure half: each judge's A/B order, the candidate's score, the win rate with
|
|
382
|
+
ties counted as half, and the latest run's reduced state (`BuildState.panel`).
|
|
383
|
+
`packages/core/src/processes/panel-runner.ts` materializes each pending judge's
|
|
384
|
+
root outside any repository from a private Git directory over the workspace's
|
|
385
|
+
objects, pins every harness path, copies `ab-judge` from the harness pin and
|
|
386
|
+
removes that material before any session starts. It computes the protected
|
|
387
|
+
locations (workspace, checkout, Git common directory, main checkout, local
|
|
388
|
+
store), refuses a scratch base or root in one of them or inside any Git
|
|
389
|
+
repository with fail-closed discovery, writes the judge-only launcher, and
|
|
390
|
+
refuses an interpreter or runtime executable found only in a protected
|
|
391
|
+
location. Its loop reclaims dangling sessions, completes saved preferences and
|
|
392
|
+
launches each wave concurrently. `packages/core/src/cli/judge-entry.ts` is the
|
|
393
|
+
judge-only `ab`, bundled into one file by
|
|
394
|
+
`packages/core/src/processes/judge-launcher.ts`. `sessionEnv` in
|
|
395
|
+
`packages/core/src/ports/runner/session-env.ts` builds the judge's launch
|
|
396
|
+
environment, scrubbing every inherited value that names a protected location;
|
|
397
|
+
`judgeAmbientAliases` in `panel-runner.ts` first resolves inherited paths so a
|
|
398
|
+
symlinked spelling of one, or one embedded after a prefix such as `-I`, is
|
|
399
|
+
scrubbed too.
|
|
400
|
+
`BuildRunner.runPanel` records the run's kernel facts, the order in
|
|
401
|
+
`panel.judge-started` before each session, and `panel.judged` after it, and
|
|
402
|
+
commits a local judge's preference outbox. Its `runJudge` runs the `judge`
|
|
403
|
+
role's primary-first provider chain for one judge, opening a session stream
|
|
404
|
+
per judge session and closing it before `panel.judge-ended`; the panel loop
|
|
405
|
+
hands each launch a preflight that checks an alternate's executable against
|
|
406
|
+
the run's filtered `PATH` and protected locations before it starts. `BuildRunner.runMeasurement`
|
|
407
|
+
calls it for an attempt's panel measurement request, under the panel id `attemptPanelId`
|
|
408
|
+
derives in `packages/core/src/kernel/measurement.ts`, and records the win rate
|
|
409
|
+
in `attempt.sampled`; the dispatcher decides it against the node's current ε
|
|
410
|
+
there too (`decideSampledMeasurement`, `panelDecision`), and
|
|
411
|
+
`packages/core/src/kernel/landing-measurement.ts` classifies the recorded win
|
|
412
|
+
rate for landing. A judge session has no read authority: `packages/core/src/store/judge-authority.ts` is the shared rule (one
|
|
413
|
+
`panel.preferred` for its own panel, judge and session, while that session is
|
|
414
|
+
open). Its `appendJudgePreference` decides and appends in one conditional step
|
|
415
|
+
for every holder of the store: the hosted `build-judge` route, the kernel's
|
|
416
|
+
outbox commit and the local wrapper in `packages/core/src/store/phase-session.ts`.
|
|
417
|
+
`packages/core/src/cli/judge.ts` implements `ab judge context` (no store read)
|
|
418
|
+
and `ab judge prefer`, and any read command run with `AB_JUDGE` set fails
|
|
419
|
+
before opening a store. The node runner calls
|
|
420
|
+
`runPanel` for a panel node's starting self-comparison and for its progress
|
|
421
|
+
after each accepted attempt, selected by `baselineMeasurementDue` and
|
|
422
|
+
`progressMeasurementDue` in `packages/core/src/kernel/measurement.ts`.
|
|
423
|
+
|
|
340
424
|
**Phase decisions.** `packages/core/src/kernel/phases.ts` owns the phase table,
|
|
341
425
|
`packages/core/src/kernel/engine.ts` the deterministic transitions;
|
|
342
426
|
`packages/core/src/processes/build-runner.ts` executes the decisions. Repeated phase starts
|
|
@@ -627,18 +711,23 @@ explicitly.
|
|
|
627
711
|
`processes/workspace-preservation.ts` owns the non-destructive fence, immutable
|
|
628
712
|
checkpoint and durable receipt ordering shared by both release paths in the
|
|
629
713
|
dispatcher. `ports/workspace/commit-preservation.ts` inventories the unpublished
|
|
630
|
-
change and restores exact refs, keeping detached producer objects
|
|
631
|
-
the named branch. Provider provisioning and start failures signal
|
|
714
|
+
change and restores exact refs or store copies, keeping detached producer objects
|
|
715
|
+
separate from the named branch. Provider provisioning and start failures signal
|
|
632
716
|
`WorkspaceCleanupRequired`; they cannot delete an existing build checkout.
|
|
633
717
|
|
|
634
718
|
Before releasing or replacing a build workspace, the dispatcher confirms a
|
|
635
719
|
non-destructive execution fence for the exact workspace and execution generation.
|
|
636
720
|
It preserves unpublished branch commits and distinct detached producer candidates
|
|
637
721
|
under immutable `refs/autobuild/archive/<build>/<sha>` refs, verifies their exact
|
|
638
|
-
readback, and records `workspace.commits-preserved` before cleanup.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
722
|
+
readback, and records `workspace.commits-preserved` before cleanup. Where the
|
|
723
|
+
forge refuses an archive ref, the head is kept as a BuildStore copy instead
|
|
724
|
+
and the receipt is the decisive `workspace.commits-retained`, whose heads each
|
|
725
|
+
name either `remoteRef` or `storeBase`; a head kept by neither refuses the
|
|
726
|
+
release. Replacement provisioning restores those exact commits before starting
|
|
727
|
+
an agent, reading archive refs from the local repository with the local-git forge
|
|
728
|
+
and fetching each exact ref from the remote otherwise, and restoring store copies
|
|
729
|
+
through a dispatcher-side callback on any host, so a remote guest never holds
|
|
730
|
+
store credentials. A preserved
|
|
642
731
|
branch head that the build's latest 64 replaced heads cover, as the replaced
|
|
643
732
|
head itself or one of its ancestors, is kept only as archived objects: it is
|
|
644
733
|
never preserved or restored as the branch, and provisioning records the skip as
|
|
@@ -649,11 +738,14 @@ that exists without a provisioned checkout, records `workspace.commits-lost`,
|
|
|
649
738
|
naming known candidates and explicitly noting that any additional unpublished
|
|
650
739
|
SHAs could not be inspected. An environment that never started executing holds
|
|
651
740
|
no unpublished work: objects its checkout lacks mean nothing to preserve, so
|
|
652
|
-
cleanup records `workspace.commits-preserved`
|
|
653
|
-
heads, then releases and replaces it. Unknown fencing, inspection, transport, or
|
|
741
|
+
cleanup records `workspace.commits-preserved` (or `workspace.commits-retained`)
|
|
742
|
+
carrying forward earlier preserved heads, then releases and replaces it. Unknown fencing, inspection, transport, or
|
|
654
743
|
receipt-write outcomes leave the workspace and snapshots intact. A workspace
|
|
655
744
|
flagged by `workspace.cleanup-required` is never launched into: the dispatcher
|
|
656
|
-
releases it and provisions the next generation.
|
|
745
|
+
releases it and provisions the next generation. Provisioning cut off by a
|
|
746
|
+
recorded dispatcher teardown is the exception: the next invocation asks the
|
|
747
|
+
provider to verify and finish the same generation, and if it cannot, the
|
|
748
|
+
replacement consumes no infrastructure attempt. A preservation or release
|
|
657
749
|
failure is recorded against its build, as an infrastructure failure or janitor
|
|
658
750
|
attention, and never stops the dispatcher from advancing other builds.
|
|
659
751
|
Fencing is revalidated after restart; a saved receipt alone never authorizes
|
|
@@ -708,6 +800,29 @@ boundary in the reducer and log index, independently of reconcile identity.
|
|
|
708
800
|
The advisory `pipeline.settled` fact records that the engine reached a leaf's
|
|
709
801
|
`wait awaiting-pr`; `kernel/dispatch-capacity.ts` reads it so a finished build
|
|
710
802
|
parked for its merge decision holds no slot.
|
|
803
|
+
Reopening a settled leaf (SPEC §15.7) spans the same seams. The shared
|
|
804
|
+
`cli/build-control.ts` control appends the human `build.reopened` and, for a
|
|
805
|
+
spec, publishes the kernel's operator `spec.revised`; `ab reopen` and the
|
|
806
|
+
`builds.reopen` tool call it. `kernel/reopen.ts` holds the reduced-state
|
|
807
|
+
predicates the control's refusals, the engine's `awaiting-spec` park, capacity's
|
|
808
|
+
`reopen` slot request, landing readiness, `ab context` (`reopen.json`) and the
|
|
809
|
+
status surfaces share. The log index's `codeRestartSeq` is the code half's
|
|
810
|
+
restart boundary, so the engine re-runs implement, review, verify and finalize
|
|
811
|
+
without special cases, and the terminal guard lets the re-run finalize and
|
|
812
|
+
verify attempts complete again.
|
|
813
|
+
Slot admission order (SPEC §12) is arithmetic in `kernel/dispatch-capacity.ts`:
|
|
814
|
+
waiting entries carry the build's reduced `priority` (`build.created`,
|
|
815
|
+
`build.priority-set`), `startClaimDemand` counts pending start requests by
|
|
816
|
+
tier, `reservedAhead` counts the manual requests ahead of an urgent waiter and
|
|
817
|
+
also the urgent reservations, urgent requests and the latest admission scan's
|
|
818
|
+
`urgentWaiting` ahead of a normal waiter, `intakeCapacity` gives ordinary urgent
|
|
819
|
+
and normal claims separate budgets, and `startCapacity` gives each start tier
|
|
820
|
+
its own. The
|
|
821
|
+
dispatcher's `leafAdmission`, `nodeHasCapacity` and proposer admission defer a
|
|
822
|
+
normal waiter that fits while claims can run; `dispatch` forces that tick's
|
|
823
|
+
admission scan once per deferral key, and `admitDeferredParked` retries the
|
|
824
|
+
deferred admissions through their generic paths only after the scan completed
|
|
825
|
+
its urgent decision.
|
|
711
826
|
Ticket waits (SPEC §11) span four seams. `cli/terminals.ts` (`waitOn`, routed
|
|
712
827
|
as `ab wait-on`) appends the agent's terminal `wait.requested`; the build
|
|
713
828
|
digest marks it pending. The dispatcher's lease-sweep pass validates a pending
|
|
@@ -727,7 +842,9 @@ completes with `wait.published`; `serviceWaitRequest` enters the wait only
|
|
|
727
842
|
after that. `waitResumeRestackCycle` in the same module is the engine's
|
|
728
843
|
wait-resume restack predicate, decided ahead of the plan and code loops against
|
|
729
844
|
`leafBaseInUse` (`kernel/leaf-restack-state.ts`), which target observation
|
|
730
|
-
shares.
|
|
845
|
+
shares. `waitResumeReverifies` and `cleanWaitResumeCompletion` decide which
|
|
846
|
+
resumed completions open a new verify cycle (see "Leaf and reconcile restacking").
|
|
847
|
+
The runner's `restack()` replays published work through the guarded
|
|
731
848
|
automatic restack, fast-forwards an unpublished branch that has no commits the
|
|
732
849
|
target lacks and no uncommitted tracked changes (`advanceWaitResume`,
|
|
733
850
|
`restack.advanced`) and otherwise fails without discarding local work, and first supersedes a reconcile occurrence whose session
|
|
@@ -763,7 +880,7 @@ dispatch is tolerated. `Ticket.creationKey` is the optional stable external
|
|
|
763
880
|
create/adoption correlation, distinct from `Ticket.ref.id`; Linear projects its
|
|
764
881
|
issue UUID and file/fake preserve their idempotency metadata through create,
|
|
765
882
|
adoption, get, and list paths. Legacy/plugin tickets may omit it and dispatch
|
|
766
|
-
unchanged. The ticket-source port optionally exposes `listPage(criteria, page)` for paged operator reads. PostgreSQL counts matches and applies SQL LIMIT/OFFSET; other sources retain exhaustive-read slicing. CLI and dispatcher reads stay exhaustive. See [ticket source contract](ticket-sources.md#writing-your-own).
|
|
883
|
+
unchanged. The ticket-source port optionally exposes `listPage(criteria, page)` for paged operator reads. PostgreSQL counts matches and applies SQL LIMIT/OFFSET; the remote hosted client forwards pages over the `list-page` ticket operation; other sources retain exhaustive-read slicing. CLI and dispatcher reads stay exhaustive. See [ticket source contract](ticket-sources.md#writing-your-own).
|
|
767
884
|
|
|
768
885
|
The `github` source spans four modules. `ports/tickets/github.ts` is the
|
|
769
886
|
adapter: REST over the forge's `GitHubRequest` transport and credential order,
|
|
@@ -798,7 +915,10 @@ operations fall back to the main checkout when `localPath` is absent.
|
|
|
798
915
|
`packages/core/src/ports/workspace/git-worktree.ts` selects the branch-cut base once
|
|
799
916
|
at first creation, fetching into a build-scoped private ref; re-provisioning
|
|
800
917
|
resumes at the branch tip, so the first provisioning fact remains immutable
|
|
801
|
-
original provenance.
|
|
918
|
+
original provenance. Both providers record the verified checked-out commit as
|
|
919
|
+
that base: the worktree's HEAD after creation, and for `vercel-sandbox.ts` the
|
|
920
|
+
guest's HEAD and build branch read back after a fresh checkout or a reuse of a
|
|
921
|
+
completed sandbox. A remote workspace lost before its branch is published
|
|
802
922
|
can be freshly cut again; the latest `remote` or `local` provisioning base is
|
|
803
923
|
the fallback review boundary, while `existing` facts only describe resumes.
|
|
804
924
|
Each implementation terminal in `packages/core/src/cli/terminals.ts` records
|
|
@@ -851,7 +971,8 @@ read-only settings/policy inspection, keeping incomplete evidence unknown. Host
|
|
|
851
971
|
init validation invokes the configured registry forge outside guest probes.
|
|
852
972
|
Dispatch inspects after acquiring its repository lease and writes validated
|
|
853
973
|
`dispatcher.forge-readiness-failed` facts once per run/check for known hard
|
|
854
|
-
failures. `
|
|
974
|
+
failures. `archive-refs` is a recommendation; historical facts naming it still
|
|
975
|
+
decode. `kernel/dispatch-status.ts` retains their typed collection across ticks
|
|
855
976
|
and reloads; the independent frontend and operator query project the same warnings.
|
|
856
977
|
`ab watch` follows these repository attention events for external orchestrators.
|
|
857
978
|
See [setup](setup.md#forge-readiness) for requirements and access guidance.
|
|
@@ -882,13 +1003,38 @@ or reporting failure.
|
|
|
882
1003
|
**Stable build identity.** The forge merge seam accepts optional build identity at operation time. Both
|
|
883
1004
|
built-in adapters preserve their squash message and normalize a final
|
|
884
1005
|
`Autobuild-Build: <slug>` trailer through `packages/core/src/kernel/build-identity.ts`. The GitHub
|
|
885
|
-
adapter
|
|
886
|
-
|
|
1006
|
+
adapter derives the squash headline/body from the PR and the repository's
|
|
1007
|
+
`squash_merge_commit_title` and `squash_merge_commit_message` settings
|
|
1008
|
+
(`packages/core/src/ports/forge/github-squash-message.ts`), all read over REST;
|
|
1009
|
+
GraphQL carries only the native enable and disable mutations. The transport
|
|
1010
|
+
wrapper classifies a GraphQL 403 that says GraphQL is unavailable (Claude Code's
|
|
1011
|
+
GitHub proxy) as `GitHubGraphQLUnavailable`, after the shared rate-limit and
|
|
1012
|
+
transient classification and never as a `ForgeFailure`. Each `GitHubForge`
|
|
1013
|
+
instance memoizes availability: one read-only `rateLimit` probe decides it, and
|
|
1014
|
+
a refusal suppresses GraphQL for `GITHUB_GRAPHQL_RECHECK_MS` (30 minutes). With
|
|
1015
|
+
GraphQL unavailable, `setAutoMerge` routes a gated root leaf to `polling` or,
|
|
1016
|
+
when GitHub exposes a merge queue over REST, `human-merge`; the dispatcher
|
|
1017
|
+
records `landing.polling-selected` or `landing.human-merge-required`, squashes a
|
|
1018
|
+
clear PR through `squashMerge` with `requireClearState`, and settles when GitHub
|
|
1019
|
+
refuses that merge. A current polling fact lets a quiet tick answer from the
|
|
1020
|
+
poll's PR read alone. The janitor
|
|
887
1021
|
maintains native request message freshness after acknowledgement. A matching
|
|
888
|
-
request costs
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
1022
|
+
request costs the PR representation the poll already read plus one conditional
|
|
1023
|
+
repository read shared by every build in the tick; a PR's commit messages are
|
|
1024
|
+
read once per commit set. It needs no extra consent or pipeline read and no
|
|
1025
|
+
merge-queue read; full gate inspection, including the queue check, and
|
|
1026
|
+
refreshed durable consent/engine eligibility precede any repair. Comparison
|
|
1027
|
+
normalizes line endings and tolerates provider trimming of surrounding
|
|
1028
|
+
headline whitespace and trailing body whitespace while preserving the
|
|
1029
|
+
headline, body content, and squash method.
|
|
1030
|
+
On the same poll of a finished, open leaf, `checkPr` reads forge CI at the PR's
|
|
1031
|
+
live head through the optional `inspectHeadChecks` capability (GitHub: two
|
|
1032
|
+
ETag-conditional REST reads) and compares it with the reduced `ciFailure`
|
|
1033
|
+
already in hand, appending advisory `pr.checks-failed` or `pr.checks-cleared`
|
|
1034
|
+
only on a transition; an unchanged head reads no store rows. A read failure is
|
|
1035
|
+
unknown CI, never a janitor failure. `packages/core/src/kernel/forge-checks.ts`
|
|
1036
|
+
holds the pure classification, the failing-set digest and `currentCiFailure`,
|
|
1037
|
+
the selector every status surface and the attention predicates read.
|
|
892
1038
|
`packages/core/src/kernel/issue-keywords.ts` composes a build's sealed issue
|
|
893
1039
|
links into `Closes #N` / `Refs #N` lines, neutralizes closing keywords aimed at
|
|
894
1040
|
`refs` issues, and places the keyword paragraph before the trailer block; a
|
|
@@ -930,21 +1076,27 @@ cleanup observations. Unsupported or failed inspection leaves evidence unknown;
|
|
|
930
1076
|
a read failure also records an observation without preventing completion. Old
|
|
931
1077
|
logs need no migration and keep the same status and presentation.
|
|
932
1078
|
|
|
933
|
-
GitHub merge queues ignore squash-message overrides.
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1079
|
+
GitHub merge queues ignore squash-message overrides. Native enable, repair and
|
|
1080
|
+
the guarded direct squash read the base's effective branch rules over REST
|
|
1081
|
+
(`rules/branches/{branch}`, including organization rules) and treat a
|
|
1082
|
+
`merge_queue` rule as a queue; a quiet poll of an already matching request reads
|
|
1083
|
+
no rules. The base comes from the REST PR representation and must equal the
|
|
1084
|
+
build's base branch: a retargeted PR defers native enable and refuses the
|
|
1085
|
+
direct squash rather than following the new base.
|
|
937
1086
|
Kernel auto-merge therefore
|
|
938
|
-
returns an actionable `unproven-gate-state` deferral for queue-protected bases
|
|
939
|
-
|
|
1087
|
+
returns an actionable `unproven-gate-state` deferral for queue-protected bases,
|
|
1088
|
+
or, with GraphQL unavailable, settles the landing as awaiting a human merge; it
|
|
1089
|
+
never bypasses the queue. Human queue merges still settle normally with
|
|
940
1090
|
inspected trailer evidence when available. Expected-head guards and recurring
|
|
941
1091
|
polls bound native message freshness, but cannot prevent a push and automatic
|
|
942
1092
|
merge from both completing between polls.
|
|
943
1093
|
|
|
944
1094
|
**Agent runtimes.** `packages/core/src/ports/runner/`: `runtime.ts` (capability-carrying
|
|
945
1095
|
registry plus boundary validation), `routing.ts` (eager role resolver),
|
|
946
|
-
`production.ts` (shipped Claude/Codex/Pi registrations), `codex.ts` (direct
|
|
947
|
-
Codex `exec --json` subprocess protocol with native thread resume), `
|
|
1096
|
+
`production.ts` (shipped Claude/Codex/Pi/Antigravity registrations), `codex.ts` (direct
|
|
1097
|
+
Codex `exec --json` subprocess protocol with native thread resume), `antigravity.ts`
|
|
1098
|
+
(direct `agy` stream-json subprocess, `--conversation` native resume, no
|
|
1099
|
+
one-shot), `pi.ts` and
|
|
948
1100
|
`pi-rpc.ts` (the local pi CLI prerequisite/auth probe and long-lived headless
|
|
949
1101
|
RPC protocol, minimum version 0.84.3), `one-shot.ts` (optional tool-free
|
|
950
1102
|
non-phase completions — slug naming via `packages/core/src/cli/dispatch.ts`, skill-conflict
|
|
@@ -1071,7 +1223,14 @@ back to triage and records the requested role and missing parts. The
|
|
|
1071
1223
|
`abort.ticket-returned` checkpoint commits the move and comment, then the
|
|
1072
1224
|
repository `ticket.handed-back` report is appended before abandoned completion;
|
|
1073
1225
|
once that report exists the dispatcher writes nothing more to the ticket, so it
|
|
1074
|
-
is the safe boundary for a subsequent ticket move.
|
|
1226
|
+
is the safe boundary for a subsequent ticket move. An optimization attempt
|
|
1227
|
+
is the exception: cleanup settles it `aborted` on the node's log (or settles a
|
|
1228
|
+
merged attempt as a merge), skips the label, ticket move, comment,
|
|
1229
|
+
`abort.ticket-returned` checkpoint and `ticket.handed-back` report whatever
|
|
1230
|
+
the requested destination, and appends abandoned completion. The node's
|
|
1231
|
+
rejection sweep later moves the ticket to `tickets.rejectedState` and records
|
|
1232
|
+
`attempt.ticket-rejected` ([landing and
|
|
1233
|
+
settlement](optimization-nodes.md#landing-and-settlement)). Forge close/delete operations are
|
|
1075
1234
|
optional API 1.2 capabilities so older plugins load but leave cleanup visibly due.
|
|
1076
1235
|
AgentRunner failure causes and the exhaustion contract fixture are additive
|
|
1077
1236
|
plugin API 1.3 surfaces; legacy failures without a cause retain permanent-bit
|
|
@@ -1333,6 +1492,16 @@ and `ab context` writes them under `$AB_CONTEXT_DIR/assets/`.
|
|
|
1333
1492
|
through `repositoryReadFacts`; `processes/dispatcher.ts` retries them under the
|
|
1334
1493
|
existing repository ownership before intake. This pre-record recovery differs
|
|
1335
1494
|
from `dispatch.failed`, which completes an already established build.
|
|
1495
|
+
`kernel/ticket-starts.ts` reduces operator single-ticket start requests
|
|
1496
|
+
(`ticket.start-*`) and the durable canonical identities of hosted active builds
|
|
1497
|
+
(`ticket.identity-recorded`) into `repositoryReadFacts`. `operator/ticket-start.ts`
|
|
1498
|
+
is the one request/cancel seam behind `ab start` (`cli/ticket-start.ts`), the
|
|
1499
|
+
`tickets.start` tool and the HTTP start routes. The dispatcher's
|
|
1500
|
+
`honorStartRequests` stage runs twice per tick, for `manual` and `urgent`
|
|
1501
|
+
requests before intake and for `normal` requests after intake and the deferred
|
|
1502
|
+
parked admissions. It admits pending requests through `dispatch()` in its
|
|
1503
|
+
targeted mode, which skips the ready listing and scan checkpoint, budgets each
|
|
1504
|
+
ticket by its request's tier, but keeps every admission gate.
|
|
1336
1505
|
`kernel/build-creation.ts` derives the keyed canonical slug that the dispatcher and
|
|
1337
1506
|
the hosted server share. The optional `BuildStore.buildCreationIdentity` port says
|
|
1338
1507
|
whether a store creates at the exact slug (method absent), at that derived slug for
|
|
@@ -1447,10 +1616,12 @@ protection permissions. The fixture creates and deletes temporary branches,
|
|
|
1447
1616
|
PRs, comments, and a required-check protection rule; it never pushes to or
|
|
1448
1617
|
merges into the default branch. Use a dedicated scratch repository only.
|
|
1449
1618
|
|
|
1450
|
-
The deterministic Claude, Codex, and
|
|
1451
|
-
normal test run. Their live registrations add real
|
|
1452
|
-
coverage for successful start, continue, end,
|
|
1453
|
-
execution, and one-shot completion
|
|
1619
|
+
The deterministic Claude, Codex, Pi, and Antigravity adapter contracts run
|
|
1620
|
+
offline in every normal test run. Their live registrations add real
|
|
1621
|
+
transport/authentication smoke coverage for successful start, continue, end,
|
|
1622
|
+
environment refresh, managed CLI execution, and one-shot completion where the
|
|
1623
|
+
runtime declares it. Antigravity declares no one-shot, so its live run skips
|
|
1624
|
+
that block:
|
|
1454
1625
|
|
|
1455
1626
|
```sh
|
|
1456
1627
|
AB_RUN_LIVE_PORT_CONTRACTS=1 \
|
|
@@ -1464,6 +1635,10 @@ bun test packages/core/src/ports/runner/codex.live.integration.test.ts
|
|
|
1464
1635
|
AB_RUN_LIVE_PORT_CONTRACTS=1 \
|
|
1465
1636
|
AB_PI_CONTRACT_MODEL=openai/gpt-… \
|
|
1466
1637
|
bun test packages/core/src/ports/runner/pi.live.integration.test.ts
|
|
1638
|
+
|
|
1639
|
+
AB_RUN_LIVE_PORT_CONTRACTS=1 \
|
|
1640
|
+
AB_ANTIGRAVITY_CONTRACT_MODEL=gemini-… \
|
|
1641
|
+
bun test packages/core/src/ports/runner/antigravity.live.integration.test.ts
|
|
1467
1642
|
```
|
|
1468
1643
|
|
|
1469
1644
|
Claude uses the locally installed Claude Code CLI and its configured login; the
|
|
@@ -1540,7 +1715,11 @@ process-scoped (`kernel/guarded-forge.ts`) and record only
|
|
|
1540
1715
|
`forge.credential-limited`; the `dispatcher.forge-degraded` admission remains
|
|
1541
1716
|
for runners pinned to older releases. This exception grants no repository administration,
|
|
1542
1717
|
recovery, lease, or other journal writes. The agent-visible build-scoped Store
|
|
1543
|
-
still denies repository writes.
|
|
1718
|
+
still denies repository writes. A build-judge grant, issued only by its
|
|
1719
|
+
build's runner after `panel.judge-started`, is write-only: the request guard
|
|
1720
|
+
refuses every read before any other route logic and admits one
|
|
1721
|
+
`panel.preferred` for its exact panel, judge and session while that session is
|
|
1722
|
+
open. Ticket routes deny build grants and allow harvest grants only the reads and
|
|
1544
1723
|
runner filing operations they require. Ticket sources and assets are partitioned
|
|
1545
1724
|
by the authenticated project.
|
|
1546
1725
|
|
|
@@ -1658,6 +1837,9 @@ compatibility facade. Metadata is excluded from hosted persistence/protocols.
|
|
|
1658
1837
|
|
|
1659
1838
|
The product dispatcher owns the workspace-free node lifecycle:
|
|
1660
1839
|
spec → node.opening → node.opened → collecting → complete → verify:* → consent → merge.
|
|
1840
|
+
An optimization node measures its starting value after opening and then
|
|
1841
|
+
repeats propose → collecting: an `ab-propose` session deposits proposals and
|
|
1842
|
+
the dispatcher files each as an attempt ticket targeting the node.
|
|
1661
1843
|
The ordinary work pipeline is unchanged. `build.created` freezes kind, target
|
|
1662
1844
|
ticket/build identity and resolved parent in `baseBranch`. Integration facts
|
|
1663
1845
|
are projected by the shared reducer and digests, including collecting/empty
|
|
@@ -1687,16 +1869,35 @@ The optional grouped Forge rewrite capability owns authoritative head snapshots,
|
|
|
1687
1869
|
immutable `refs/autobuild/archive/<slug>/<sha>` publication and expected-head CAS.
|
|
1688
1870
|
Remote archives also publish commits present only on the remote: GitHub uses create-only
|
|
1689
1871
|
Git-reference REST creation when the workspace lacks the commit, retaining guarded Git
|
|
1690
|
-
pushes for local objects.
|
|
1872
|
+
pushes for local objects. `gitRewrite` takes an optional refusal fallback: when a remote
|
|
1873
|
+
archive push exits non-zero without a transient classification, GitHub creates the
|
|
1874
|
+
identical ref through the same REST call, probing the commit only after a 422 to report a
|
|
1875
|
+
local-only commit. Exact remote readback confirms publication, then a non-shallow
|
|
1691
1876
|
fetch of only that exact archive ref (without tags, configured refmap expansion or a
|
|
1692
1877
|
depth limit) restores missing commits and their missing ancestry, writes no shallow
|
|
1693
1878
|
boundary, leaves an already-shallow repository's existing boundaries unchanged, and
|
|
1694
1879
|
verifies the commits locally before returning.
|
|
1880
|
+
`kernel/history-retention.ts` retains leaf history best effort: the archive ref
|
|
1881
|
+
where the forge accepts it, else a `history-objects-<sha>` BuildStore thin pack
|
|
1882
|
+
excluding the frozen target base (`kernel/replay-retention.ts`), else one
|
|
1883
|
+
build-scoped `history-unretained` observation; `history.retained` records store,
|
|
1884
|
+
target and unretained commits. Its readers restore from the local repository,
|
|
1885
|
+
the archive ref, store copies, then the published branches, and a commit
|
|
1886
|
+
retained nowhere redoes the work (`<id>-redo`, or candidate retirement). A
|
|
1887
|
+
refusal is a plain error; `ArchiveConflictError` (an immutable ref naming a
|
|
1888
|
+
different SHA) and classified transient failures never fall back. Node writes
|
|
1889
|
+
use the same order and record `node.history-retained`; node recovery restores
|
|
1890
|
+
reserved inputs before reading them and abandons a reservation whose inputs are
|
|
1891
|
+
kept nowhere. Workspace preservation (`preserveRetained`, `retainPreservedCopy`)
|
|
1892
|
+
is strict: archive ref, else store copy, else release is refused; a reused copy
|
|
1893
|
+
keeps its saved base, which preservation retains in turn and
|
|
1894
|
+
`restoreRetainedHead` follows to a bounded depth.
|
|
1695
1895
|
GitHub uses explicit Git transport leases; local-git uses shared-database
|
|
1696
1896
|
`update-ref` CAS without network calls. Exact authoritative readback acknowledges
|
|
1697
1897
|
publication. Remote-backed local refs are caches refreshed without expected-old
|
|
1698
|
-
CAS after confirmation, even if absent or recreated; checkout files are untouched. Trusted remote publication
|
|
1699
|
-
replacement after guest teardown
|
|
1898
|
+
CAS after confirmation, even if absent or recreated; checkout files are untouched. Trusted remote publication retains history before
|
|
1899
|
+
replacement after guest teardown, through the kernel's `retain` callback over the
|
|
1900
|
+
provider's Git transport; it never uses ordinary append-only publication
|
|
1700
1901
|
for restacks. Prepared, replayed, intended and rewritten facts support recovery.
|
|
1701
1902
|
A contended rewrite preserves the observed work and retries on the same base.
|
|
1702
1903
|
|
|
@@ -1712,17 +1913,29 @@ uncommitted tracked changes; a wait
|
|
|
1712
1913
|
declared by an unintended reconcile occurrence on a moved target first abandons
|
|
1713
1914
|
that occurrence with `reconcile.superseded`, then replays onto the new target
|
|
1714
1915
|
(see Ticket waits above). `reconcile-restack.ts` shares collapse, detached replay,
|
|
1715
|
-
|
|
1916
|
+
retain-before-replacement and expected-head publication mechanics. Automatic
|
|
1716
1917
|
transactions emit `restack.*`; clean completion never starts a reconcile cycle.
|
|
1717
1918
|
Pre-PR conflicts adopt the prepared replay through ordinary reconcile. Initial
|
|
1718
1919
|
verification remains mandatory; waiting conflicts use post-reconcile policy.
|
|
1920
|
+
A conflict confined to `[[generated]]` files is first regenerated in the runner:
|
|
1921
|
+
`kernel/generated-files.ts` classifies conflicted paths by declaration,
|
|
1922
|
+
`kernel/generated-regeneration.ts` runs the commands on the reproduced conflict
|
|
1923
|
+
and commits or restores it, and `reconcile-restack.ts` (leaf) and the build
|
|
1924
|
+
runner's node-conflict path (node items) record `restack.regenerated` and
|
|
1925
|
+
`node.item-regenerated`. The engine reads only those facts.
|
|
1719
1926
|
|
|
1720
1927
|
The dispatcher observes targets without changing workspaces; execution ownership
|
|
1721
1928
|
and session settlement fence mutation. Transaction targets stay frozen while
|
|
1722
1929
|
later moves coalesce. `publication.requested` carries automatic transaction
|
|
1723
1930
|
identity through trusted remote teardown and publication. The runner settles
|
|
1724
1931
|
local resolver intent only after its session ends. Verification facts
|
|
1725
|
-
cite the cycle's base/head
|
|
1932
|
+
cite the cycle's base/head (`leafVerifiedRestack` in `kernel/verify-stages.ts`).
|
|
1933
|
+
A clean wait-resume `restack.completed` for a wait declared in `verify:*` or
|
|
1934
|
+
`finalize` is a verify cycle boundary: the log index records it as
|
|
1935
|
+
`waitResumeVerifyBoundary`, the reducer moves `verify.cycleSince`, and the
|
|
1936
|
+
engine's stage selection and cycle boundary both read it through
|
|
1937
|
+
`leafVerifyCycleInputs`. It is not a replay boundary, so the verify-entry
|
|
1938
|
+
restack does not run again. Clean awaiting-merge leaf rewrites preserve completed
|
|
1726
1939
|
verification when build-owned config is unchanged, even when the old pin commit
|
|
1727
1940
|
is no longer an ancestor. Changed config still supersedes while waiting.
|
|
1728
1941
|
Ancestry gates cycles that run further steps; those cycles capture fresh config.
|
|
@@ -1857,7 +2070,13 @@ fast-forward shape against the frozen parent. Exact authoritative head readback
|
|
|
1857
2070
|
or a durable confirmed receipt establishes publication; ancestry alone cannot
|
|
1858
2071
|
acknowledge an unconfirmed candidate. Shared status vocabulary exposes provenance
|
|
1859
2072
|
and mismatch attention in both frontends. Human forge merges remain observable
|
|
1860
|
-
escape hatches independent of completeness and verification.
|
|
2073
|
+
escape hatches independent of completeness and verification. A recorded
|
|
2074
|
+
`integration.landed` ends node verification: `integrationAdmissible` and
|
|
2075
|
+
`decideNext` stop preparation and runner work, the session bracket and stage
|
|
2076
|
+
loop cancel agent members through their existing subscriptions, and `checkPr`
|
|
2077
|
+
withdraws a live verifier lease so the runner's next heartbeat aborts a running
|
|
2078
|
+
check. Settlement waits for the open execution to end. Preparation also skips a
|
|
2079
|
+
node whose comparison is empty.
|
|
1861
2080
|
|
|
1862
2081
|
### Merge authorization
|
|
1863
2082
|
|
|
@@ -2004,12 +2223,15 @@ polls read no receipts or event rows.
|
|
|
2004
2223
|
|
|
2005
2224
|
A historical `publication.lost` does not prove that every copy of its candidate
|
|
2006
2225
|
is gone. Recovery checks the exact branch and private archive refs and retained
|
|
2007
|
-
|
|
2008
|
-
|
|
2226
|
+
store copies first. Replay copies are read in either format (chunked manifest or
|
|
2227
|
+
legacy base64 pack); a thin pack whose base is missing fetches the published target
|
|
2228
|
+
first and applies with `git index-pack --fix-thin`. An available candidate is
|
|
2229
|
+
retained best effort before guarded publication continues; a refused archive does
|
|
2230
|
+
not block it. A genuinely missing reconcile or automatic restack candidate records
|
|
2009
2231
|
`publication.candidate-retired`, abandons its obsolete request, and replays the
|
|
2010
2232
|
producing operation with a fresh transaction identity. Its frozen target,
|
|
2011
2233
|
reconcile occurrence or automatic trigger, cycle, and message survive. The
|
|
2012
|
-
retired candidate is excluded from
|
|
2234
|
+
retired candidate is excluded from retention requirements unless independently
|
|
2013
2235
|
required by proven history. This reconstruction consumes no infrastructure
|
|
2014
2236
|
attempt and no additional conflict occurrence; it needs no operator guidance.
|
|
2015
2237
|
A bare retry also clears an existing infrastructure-limit escalation through
|
|
@@ -2066,6 +2288,11 @@ clears the attention, closes the escalation unanswered and the build continues.
|
|
|
2066
2288
|
Answering it with a bare retry makes the janitor attempt on its next tick. An
|
|
2067
2289
|
episode raises at most one escalation; a new episode after recovery can raise
|
|
2068
2290
|
another. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
|
|
2291
|
+
A pending control the janitor can act on wakes it during backoff: an abort, a
|
|
2292
|
+
pause, a resume of a paused build, a queued discard or an unacknowledged landing
|
|
2293
|
+
command. A leaf's resume that only cancelled a never-acknowledged pause is not
|
|
2294
|
+
one and waits out the backoff; a node's janitor acknowledges every pending
|
|
2295
|
+
control itself, so any node command wakes it.
|
|
2069
2296
|
A dispatcher that cannot execute Git for kernel node work (a missing or
|
|
2070
2297
|
unloadable `git` for the bare clone) records no janitor failures. It records
|
|
2071
2298
|
one durable `dispatcher.kernel-git-unavailable` repository condition, node work
|
|
@@ -2074,6 +2301,25 @@ succeeds.
|
|
|
2074
2301
|
|
|
2075
2302
|
A rate limit the dispatcher classifies on its own authenticated request
|
|
2076
2303
|
records repository degradation with `resetAt`.
|
|
2304
|
+
The built-in GitHub forge also treats a successful response, 304 included,
|
|
2305
|
+
that reports `x-ratelimit-remaining: 0` with a future reset at most 65 minutes
|
|
2306
|
+
away (one hour plus five minutes of clock skew) as that quota's limit.
|
|
2307
|
+
The response keeps its result, and the process's next
|
|
2308
|
+
request for the same quota (`core`, `graphql`, …) fails as that rate limit
|
|
2309
|
+
without being sent, so cooldown follows the rules here without an avoidable
|
|
2310
|
+
refusal. Other quotas are unaffected. A missing, malformed, past or
|
|
2311
|
+
implausible reset enters no cooldown, and no later response clears one early:
|
|
2312
|
+
only the reset passing, or an explicit `forge-clear`, does. After a clear, the
|
|
2313
|
+
next request goes to GitHub as a probe, and an actual limit restores the
|
|
2314
|
+
cooldown.
|
|
2315
|
+
The first limit of an episode records an ordinary `dispatcher.forge-degraded`,
|
|
2316
|
+
which wakes `ab watch` once. A later reset inside the unexpired episode extends
|
|
2317
|
+
the cooldown durably as a degradation marked `continued` that wakes nothing; an
|
|
2318
|
+
equal or earlier reset writes nothing. A limit after the reset has passed, or
|
|
2319
|
+
after recovery, opens a new episode. A rate-limited or unreadable response on
|
|
2320
|
+
landing, gate inspection or PR polling is a typed forge failure or an unproven
|
|
2321
|
+
state, never "no checks", "ungated", "closed" or "merged"; merge-freshness
|
|
2322
|
+
inspection defers instead of recording best-effort evidence.
|
|
2077
2323
|
Forge work waits during cooldown; passing the deadline permits a recovery
|
|
2078
2324
|
request; a successful probe records automatic recovery. An authorized operator
|
|
2079
2325
|
may explicitly override erroneous recorded state with
|
|
@@ -2127,7 +2373,15 @@ using exact-resource ETags; authenticated 304s spare the REST primary quota.
|
|
|
2127
2373
|
Adapter caches are bounded and restart/eviction falls back to fresh reads.
|
|
2128
2374
|
Writes, including Git publication and rewrites, invalidate observations before
|
|
2129
2375
|
attempting the mutation so acknowledgement reads remain fresh. Leaf PR polling
|
|
2130
|
-
keeps its existing cadence.
|
|
2376
|
+
keeps its existing cadence. Gate branch and rules reads, merge-freshness
|
|
2377
|
+
protection and rulesets, landing, retarget and auto-merge PR reads, commit and
|
|
2378
|
+
history reads, merge-queue activity, summary-comment listing and branch
|
|
2379
|
+
existence revalidate the same way. Both caches hold the raw representation and
|
|
2380
|
+
every caller validates it with its own schema, so consumers of one resource
|
|
2381
|
+
share one request and one ETag; a representation that fails validation loses
|
|
2382
|
+
its ETag. Reads that must be fresh, including merge inspections, still reach
|
|
2383
|
+
GitHub every time, conditionally when an ETag is cached. Readiness diagnostics
|
|
2384
|
+
and post-mutation readbacks stay unconditional.
|
|
2131
2385
|
|
|
2132
2386
|
For node cadence, durable wakes, restart behavior and CLI evidence, see
|
|
2133
2387
|
[node polling and status](integration-tree.md#polling-and-status).
|
|
@@ -2138,6 +2392,18 @@ primary quota, REST 304s and GraphQL calls. Transport failures and historical or
|
|
|
2138
2392
|
legacy observations can remain unclassified; absent fields never imply zero.
|
|
2139
2393
|
Shared requests are attributed to their first requester; cache hits count zero.
|
|
2140
2394
|
|
|
2395
|
+
An adapter may also report the primary rate-limit headers a response carried
|
|
2396
|
+
(`resource`, `limit`, `remaining`, `resetAt`), including on 304s and limited
|
|
2397
|
+
failures; GitHub does. No extra `/rate_limit` request is made. Tick telemetry's
|
|
2398
|
+
optional `rateLimits` carries the latest reading per resource with its
|
|
2399
|
+
`observedAt`, at most eight resources and none older than a day, across ticks
|
|
2400
|
+
and dispatcher restarts, so a cooldown tick with no requests still reports the
|
|
2401
|
+
last known quota. Secondary limits carry no headers and appear only as the
|
|
2402
|
+
degradation. `ab repository status` shows them as `forgeRateLimit`: each
|
|
2403
|
+
reading, `stale` once its window has reset (current quota unknown), and
|
|
2404
|
+
`paused`/`pausedUntil` while the dispatcher's rate-limit cooldown holds forge
|
|
2405
|
+
landing and polling. Absent fields mean unknown, never full quota.
|
|
2406
|
+
|
|
2141
2407
|
Ticket-source continuity is reduced by `kernel/ticket-migrations.ts` from durable
|
|
2142
2408
|
repository `tickets.migration-recorded` facts. Import publishes only complete
|
|
2143
2409
|
mappings; current-operation resolvers leave build records and old events intact.
|
|
@@ -2169,7 +2435,8 @@ pending controls, merge intent and ended PRs refuse the no-escalation path.
|
|
|
2169
2435
|
A concurrent state change refuses publication with a retry explanation;
|
|
2170
2436
|
uncited artifacts are inert. Leaves still require an open escalation and
|
|
2171
2437
|
restart from `plan` after any unfinished reconcile resumes under the revised
|
|
2172
|
-
spec and its publication is confirmed.
|
|
2438
|
+
spec and its publication is confirmed. A settled, unmerged leaf awaiting merge
|
|
2439
|
+
revises without an escalation through `ab reopen`.
|
|
2173
2440
|
|
|
2174
2441
|
Verification stages are planned purely in `kernel/verify-stages.ts`, shared by
|
|
2175
2442
|
leaf and integration decisions in `kernel/engine.ts`. The build runner keeps
|