@warpgogol/forge 9.1.1 → 9.3.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/CHANGELOG.md +56 -0
- package/bin/cli.ts +5 -3
- package/dist/bin/cli.js +5 -3
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts +6 -0
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +23 -15
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-journal.js +9 -1
- package/dist/os/checks/handlers/counters-journal.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +32 -39
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/lock-holder.d.ts +32 -0
- package/dist/os/core/lock-holder.d.ts.map +1 -0
- package/dist/os/core/lock-holder.js +81 -0
- package/dist/os/core/lock-holder.js.map +1 -0
- package/dist/os/core/stamp-lock.d.ts +30 -0
- package/dist/os/core/stamp-lock.d.ts.map +1 -0
- package/dist/os/core/stamp-lock.js +112 -0
- package/dist/os/core/stamp-lock.js.map +1 -0
- package/dist/os/flow/branch-name.d.ts +56 -0
- package/dist/os/flow/branch-name.d.ts.map +1 -0
- package/dist/os/flow/branch-name.js +108 -0
- package/dist/os/flow/branch-name.js.map +1 -0
- package/dist/os/flow/digest.d.ts +92 -0
- package/dist/os/flow/digest.d.ts.map +1 -0
- package/dist/os/flow/digest.js +663 -0
- package/dist/os/flow/digest.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts +3 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -0
- package/dist/os/flow/flow.module.js +771 -0
- package/dist/os/flow/flow.module.js.map +1 -0
- package/dist/os/flow/git.d.ts +68 -0
- package/dist/os/flow/git.d.ts.map +1 -0
- package/dist/os/flow/git.js +257 -0
- package/dist/os/flow/git.js.map +1 -0
- package/dist/os/flow/guard-files.d.ts +50 -0
- package/dist/os/flow/guard-files.d.ts.map +1 -0
- package/dist/os/flow/guard-files.js +147 -0
- package/dist/os/flow/guard-files.js.map +1 -0
- package/dist/os/flow/handlers/flow-backmerge.d.ts +27 -0
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-backmerge.js +332 -0
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -0
- package/dist/os/flow/handlers/flow-check.d.ts +42 -0
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-check.js +347 -0
- package/dist/os/flow/handlers/flow-check.js.map +1 -0
- package/dist/os/flow/handlers/flow-cut.d.ts +71 -0
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-cut.js +722 -0
- package/dist/os/flow/handlers/flow-cut.js.map +1 -0
- package/dist/os/flow/handlers/flow-digest.d.ts +5 -0
- package/dist/os/flow/handlers/flow-digest.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-digest.js +116 -0
- package/dist/os/flow/handlers/flow-digest.js.map +1 -0
- package/dist/os/flow/handlers/flow-discard.d.ts +22 -0
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-discard.js +204 -0
- package/dist/os/flow/handlers/flow-discard.js.map +1 -0
- package/dist/os/flow/handlers/flow-fix.d.ts +47 -0
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-fix.js +532 -0
- package/dist/os/flow/handlers/flow-fix.js.map +1 -0
- package/dist/os/flow/handlers/flow-hold.d.ts +32 -0
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-hold.js +359 -0
- package/dist/os/flow/handlers/flow-hold.js.map +1 -0
- package/dist/os/flow/handlers/flow-install.d.ts +92 -0
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-install.js +883 -0
- package/dist/os/flow/handlers/flow-install.js.map +1 -0
- package/dist/os/flow/handlers/flow-integrate.d.ts +35 -0
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-integrate.js +436 -0
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -0
- package/dist/os/flow/handlers/flow-open.d.ts +63 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-open.js +294 -0
- package/dist/os/flow/handlers/flow-open.js.map +1 -0
- package/dist/os/flow/handlers/flow-publication-retire.d.ts +17 -0
- package/dist/os/flow/handlers/flow-publication-retire.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-publication-retire.js +132 -0
- package/dist/os/flow/handlers/flow-publication-retire.js.map +1 -0
- package/dist/os/flow/handlers/flow-push.d.ts +29 -0
- package/dist/os/flow/handlers/flow-push.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-push.js +397 -0
- package/dist/os/flow/handlers/flow-push.js.map +1 -0
- package/dist/os/flow/handlers/flow-status.d.ts +65 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-status.js +193 -0
- package/dist/os/flow/handlers/flow-status.js.map +1 -0
- package/dist/os/flow/handlers/flow-unhold.d.ts +20 -0
- package/dist/os/flow/handlers/flow-unhold.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-unhold.js +158 -0
- package/dist/os/flow/handlers/flow-unhold.js.map +1 -0
- package/dist/os/flow/handlers/flow-version.d.ts +39 -0
- package/dist/os/flow/handlers/flow-version.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-version.js +122 -0
- package/dist/os/flow/handlers/flow-version.js.map +1 -0
- package/dist/os/flow/index.d.ts +30 -0
- package/dist/os/flow/index.d.ts.map +1 -0
- package/dist/os/flow/index.js +83 -0
- package/dist/os/flow/index.js.map +1 -0
- package/dist/os/flow/line-version.d.ts +23 -0
- package/dist/os/flow/line-version.d.ts.map +1 -0
- package/dist/os/flow/line-version.js +83 -0
- package/dist/os/flow/line-version.js.map +1 -0
- package/dist/os/flow/locks.d.ts +39 -0
- package/dist/os/flow/locks.d.ts.map +1 -0
- package/dist/os/flow/locks.js +177 -0
- package/dist/os/flow/locks.js.map +1 -0
- package/dist/os/flow/markers.d.ts +49 -0
- package/dist/os/flow/markers.d.ts.map +1 -0
- package/dist/os/flow/markers.js +112 -0
- package/dist/os/flow/markers.js.map +1 -0
- package/dist/os/flow/publication-order.d.ts +25 -0
- package/dist/os/flow/publication-order.d.ts.map +1 -0
- package/dist/os/flow/publication-order.js +75 -0
- package/dist/os/flow/publication-order.js.map +1 -0
- package/dist/os/flow/publish.d.ts +46 -0
- package/dist/os/flow/publish.d.ts.map +1 -0
- package/dist/os/flow/publish.js +209 -0
- package/dist/os/flow/publish.js.map +1 -0
- package/dist/os/flow/registry.d.ts +142 -0
- package/dist/os/flow/registry.d.ts.map +1 -0
- package/dist/os/flow/registry.js +199 -0
- package/dist/os/flow/registry.js.map +1 -0
- package/dist/os/flow/release-level.d.ts +23 -0
- package/dist/os/flow/release-level.d.ts.map +1 -0
- package/dist/os/flow/release-level.js +102 -0
- package/dist/os/flow/release-level.js.map +1 -0
- package/dist/os/flow/release-lines.d.ts +25 -0
- package/dist/os/flow/release-lines.d.ts.map +1 -0
- package/dist/os/flow/release-lines.js +172 -0
- package/dist/os/flow/release-lines.js.map +1 -0
- package/dist/os/flow/release-tags.d.ts +73 -0
- package/dist/os/flow/release-tags.d.ts.map +1 -0
- package/dist/os/flow/release-tags.js +167 -0
- package/dist/os/flow/release-tags.js.map +1 -0
- package/dist/os/flow/repo-kind.d.ts +41 -0
- package/dist/os/flow/repo-kind.d.ts.map +1 -0
- package/dist/os/flow/repo-kind.js +92 -0
- package/dist/os/flow/repo-kind.js.map +1 -0
- package/dist/os/flow/scripts.d.ts +20 -0
- package/dist/os/flow/scripts.d.ts.map +1 -0
- package/dist/os/flow/scripts.js +50 -0
- package/dist/os/flow/scripts.js.map +1 -0
- package/dist/os/flow/semver.d.ts +21 -0
- package/dist/os/flow/semver.d.ts.map +1 -0
- package/dist/os/flow/semver.js +73 -0
- package/dist/os/flow/semver.js.map +1 -0
- package/dist/os/flow/task-files.d.ts +11 -0
- package/dist/os/flow/task-files.d.ts.map +1 -0
- package/dist/os/flow/task-files.js +51 -0
- package/dist/os/flow/task-files.js.map +1 -0
- package/dist/os/flow/tests/helpers.d.ts +55 -0
- package/dist/os/flow/tests/helpers.d.ts.map +1 -0
- package/dist/os/flow/tests/helpers.js +193 -0
- package/dist/os/flow/tests/helpers.js.map +1 -0
- package/dist/os/flow/version-files.d.ts +21 -0
- package/dist/os/flow/version-files.d.ts.map +1 -0
- package/dist/os/flow/version-files.js +94 -0
- package/dist/os/flow/version-files.js.map +1 -0
- package/dist/os/flow/worktree-path.d.ts +31 -0
- package/dist/os/flow/worktree-path.d.ts.map +1 -0
- package/dist/os/flow/worktree-path.js +80 -0
- package/dist/os/flow/worktree-path.js.map +1 -0
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +44 -51
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/lockfile.d.ts +21 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -0
- package/dist/os/mission/lockfile.js +76 -0
- package/dist/os/mission/lockfile.js.map +1 -0
- package/dist/os/mission/mission.module.d.ts.map +1 -1
- package/dist/os/mission/mission.module.js +2 -1
- package/dist/os/mission/mission.module.js.map +1 -1
- package/dist/os/program/handlers/seal.d.ts.map +1 -1
- package/dist/os/program/handlers/seal.js +1 -1
- package/dist/os/program/handlers/seal.js.map +1 -1
- package/dist/os/program/handlers/validate.d.ts.map +1 -1
- package/dist/os/program/handlers/validate.js +1 -1
- package/dist/os/program/handlers/validate.js.map +1 -1
- package/dist/os/program/program.module.d.ts.map +1 -1
- package/dist/os/program/program.module.js +2 -1
- package/dist/os/program/program.module.js.map +1 -1
- package/dist/os/program/schemas.d.ts +4 -6
- package/dist/os/program/schemas.d.ts.map +1 -1
- package/dist/os/program/schemas.js +16 -6
- package/dist/os/program/schemas.js.map +1 -1
- package/dist/os/program/state.d.ts +0 -1
- package/dist/os/program/state.d.ts.map +1 -1
- package/dist/os/program/state.js +1 -7
- package/dist/os/program/state.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts +21 -0
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +62 -13
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts +19 -0
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +65 -12
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts +6 -0
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +24 -19
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +2 -5
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +10 -8
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +15 -5
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/index.d.ts +2 -2
- package/dist/os/rfc/index.d.ts.map +1 -1
- package/dist/os/rfc/index.js +5 -2
- package/dist/os/rfc/index.js.map +1 -1
- package/dist/os/rfc/probe-batch.d.ts +71 -0
- package/dist/os/rfc/probe-batch.d.ts.map +1 -0
- package/dist/os/rfc/probe-batch.js +251 -0
- package/dist/os/rfc/probe-batch.js.map +1 -0
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +16 -2
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +21 -10
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
- package/dist/os/rfc/verification-refresh.js +20 -13
- package/dist/os/rfc/verification-refresh.js.map +1 -1
- package/dist/os/system/handlers/outbox-validate.d.ts +8 -0
- package/dist/os/system/handlers/outbox-validate.d.ts.map +1 -0
- package/dist/os/system/handlers/outbox-validate.js +102 -0
- package/dist/os/system/handlers/outbox-validate.js.map +1 -0
- package/dist/os/system/handlers/system-map-validate.d.ts +13 -0
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -0
- package/dist/os/system/handlers/system-map-validate.js +78 -0
- package/dist/os/system/handlers/system-map-validate.js.map +1 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts +10 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -0
- package/dist/os/system/handlers/system-outbox-scan.js +195 -0
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -0
- package/dist/os/system/handlers/system-task-collect.d.ts +13 -0
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-collect.js +238 -0
- package/dist/os/system/handlers/system-task-collect.js.map +1 -0
- package/dist/os/system/handlers/system-task-create.d.ts +32 -0
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-create.js +216 -0
- package/dist/os/system/handlers/system-task-create.js.map +1 -0
- package/dist/os/system/handlers/system-task-dispatch.d.ts +14 -0
- package/dist/os/system/handlers/system-task-dispatch.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-dispatch.js +290 -0
- package/dist/os/system/handlers/system-task-dispatch.js.map +1 -0
- package/dist/os/system/handlers/system-task-move.d.ts +12 -0
- package/dist/os/system/handlers/system-task-move.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-move.js +217 -0
- package/dist/os/system/handlers/system-task-move.js.map +1 -0
- package/dist/os/system/handlers/system-task-status.d.ts +20 -0
- package/dist/os/system/handlers/system-task-status.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-status.js +139 -0
- package/dist/os/system/handlers/system-task-status.js.map +1 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts +12 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -0
- package/dist/os/system/handlers/system-versionset-record.js +332 -0
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -0
- package/dist/os/system/index.d.ts +6 -0
- package/dist/os/system/index.d.ts.map +1 -0
- package/dist/os/system/index.js +18 -0
- package/dist/os/system/index.js.map +1 -0
- package/dist/os/system/outbox-schema.d.ts +30 -0
- package/dist/os/system/outbox-schema.d.ts.map +1 -0
- package/dist/os/system/outbox-schema.js +29 -0
- package/dist/os/system/outbox-schema.js.map +1 -0
- package/dist/os/system/repo.d.ts +64 -0
- package/dist/os/system/repo.d.ts.map +1 -0
- package/dist/os/system/repo.js +364 -0
- package/dist/os/system/repo.js.map +1 -0
- package/dist/os/system/scenario-schemas.d.ts +26 -0
- package/dist/os/system/scenario-schemas.d.ts.map +1 -0
- package/dist/os/system/scenario-schemas.js +53 -0
- package/dist/os/system/scenario-schemas.js.map +1 -0
- package/dist/os/system/schemas.d.ts +63 -0
- package/dist/os/system/schemas.d.ts.map +1 -0
- package/dist/os/system/schemas.js +83 -0
- package/dist/os/system/schemas.js.map +1 -0
- package/dist/os/system/system.module.d.ts +3 -0
- package/dist/os/system/system.module.d.ts.map +1 -0
- package/dist/os/system/system.module.js +429 -0
- package/dist/os/system/system.module.js.map +1 -0
- package/dist/os/system/task-schemas.d.ts +108 -0
- package/dist/os/system/task-schemas.d.ts.map +1 -0
- package/dist/os/system/task-schemas.js +152 -0
- package/dist/os/system/task-schemas.js.map +1 -0
- package/dist/os/system/task-store.d.ts +41 -0
- package/dist/os/system/task-store.d.ts.map +1 -0
- package/dist/os/system/task-store.js +142 -0
- package/dist/os/system/task-store.js.map +1 -0
- package/dist/os/system/tests/helpers.d.ts +30 -0
- package/dist/os/system/tests/helpers.d.ts.map +1 -0
- package/dist/os/system/tests/helpers.js +178 -0
- package/dist/os/system/tests/helpers.js.map +1 -0
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +21 -7
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.js +2 -82
- package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
- package/dist/src/config/forge-config.d.ts +0 -3
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +2 -4
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/agents-generate.js +49 -4
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/create.d.ts +13 -0
- package/dist/src/onboarding/create.d.ts.map +1 -1
- package/dist/src/onboarding/create.js +95 -9
- package/dist/src/onboarding/create.js.map +1 -1
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +2 -47
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts +5 -0
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +70 -1
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/types.d.ts +9 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +2 -2
- package/docs/branch-model.md +98 -0
- package/docs/maintainers/publishing.md +10 -8
- package/docs/reference/cli.md +0 -3
- package/os/adr/handlers/implement-stamp-lock.test.ts +90 -0
- package/os/adr/handlers/implement-stamp.ts +29 -20
- package/os/checks/handlers/counters-journal.test.ts +10 -0
- package/os/checks/handlers/counters-journal.ts +8 -1
- package/os/core/core.module.ts +38 -39
- package/os/core/lock-holder.ts +88 -0
- package/os/core/stamp-lock.ts +142 -0
- package/os/flow/assets/flow-guard.sh +176 -0
- package/os/flow/branch-name.ts +139 -0
- package/os/flow/digest.ts +803 -0
- package/os/flow/flow.module.ts +796 -0
- package/os/flow/git.ts +342 -0
- package/os/flow/guard-files.ts +172 -0
- package/os/flow/handlers/flow-backmerge.ts +488 -0
- package/os/flow/handlers/flow-check.ts +450 -0
- package/os/flow/handlers/flow-cut.ts +1025 -0
- package/os/flow/handlers/flow-digest.ts +130 -0
- package/os/flow/handlers/flow-discard.ts +310 -0
- package/os/flow/handlers/flow-fix.ts +703 -0
- package/os/flow/handlers/flow-hold.ts +500 -0
- package/os/flow/handlers/flow-install.ts +1185 -0
- package/os/flow/handlers/flow-integrate.ts +623 -0
- package/os/flow/handlers/flow-open.ts +447 -0
- package/os/flow/handlers/flow-publication-retire.ts +156 -0
- package/os/flow/handlers/flow-push.ts +488 -0
- package/os/flow/handlers/flow-status.ts +283 -0
- package/os/flow/handlers/flow-unhold.ts +220 -0
- package/os/flow/handlers/flow-version.ts +196 -0
- package/os/flow/index.ts +102 -0
- package/os/flow/line-version.ts +113 -0
- package/os/flow/locks.ts +227 -0
- package/os/flow/markers.ts +135 -0
- package/os/flow/publication-order.ts +99 -0
- package/os/flow/publish.ts +272 -0
- package/os/flow/registry.ts +269 -0
- package/os/flow/release-level.ts +139 -0
- package/os/flow/release-lines.ts +208 -0
- package/os/flow/release-tags.ts +232 -0
- package/os/flow/repo-kind.ts +117 -0
- package/os/flow/scripts.ts +75 -0
- package/os/flow/semver.ts +82 -0
- package/os/flow/task-files.ts +59 -0
- package/os/flow/tests/branch-name.test.ts +136 -0
- package/os/flow/tests/fixtures/branch-names.yaml +56 -0
- package/os/flow/tests/flow-backmerge.test.ts +267 -0
- package/os/flow/tests/flow-check-version.test.ts +138 -0
- package/os/flow/tests/flow-check.test.ts +213 -0
- package/os/flow/tests/flow-cut-prepare.test.ts +298 -0
- package/os/flow/tests/flow-cut.rerun.test.ts +95 -0
- package/os/flow/tests/flow-cut.test.ts +323 -0
- package/os/flow/tests/flow-digest.test.ts +313 -0
- package/os/flow/tests/flow-discard.test.ts +220 -0
- package/os/flow/tests/flow-fix.test.ts +359 -0
- package/os/flow/tests/flow-guard-merge.test.ts +100 -0
- package/os/flow/tests/flow-guard-parity.test.ts +115 -0
- package/os/flow/tests/flow-guard-push.test.ts +100 -0
- package/os/flow/tests/flow-guard.test.ts +135 -0
- package/os/flow/tests/flow-hold.test.ts +465 -0
- package/os/flow/tests/flow-install-baseline.rerun.test.ts +73 -0
- package/os/flow/tests/flow-install-baseline.test.ts +164 -0
- package/os/flow/tests/flow-install-markers.test.ts +161 -0
- package/os/flow/tests/flow-install.rerun.test.ts +212 -0
- package/os/flow/tests/flow-install.test.ts +330 -0
- package/os/flow/tests/flow-integrate.rerun.test.ts +92 -0
- package/os/flow/tests/flow-integrate.test.ts +229 -0
- package/os/flow/tests/flow-open.test.ts +200 -0
- package/os/flow/tests/flow-publication-retire.test.ts +191 -0
- package/os/flow/tests/flow-push-publish.test.ts +282 -0
- package/os/flow/tests/flow-push-supersede.test.ts +221 -0
- package/os/flow/tests/flow-push.test.ts +160 -0
- package/os/flow/tests/flow-stale.test.ts +136 -0
- package/os/flow/tests/flow-status.test.ts +93 -0
- package/os/flow/tests/flow-task-files.test.ts +59 -0
- package/os/flow/tests/flow-version-level.test.ts +116 -0
- package/os/flow/tests/flow-version.test.ts +169 -0
- package/os/flow/tests/helpers.ts +239 -0
- package/os/flow/tests/is-flow-adopted.test.ts +71 -0
- package/os/flow/tests/locks.test.ts +219 -0
- package/os/flow/tests/publication-order.test.ts +102 -0
- package/os/flow/tests/registry.test.ts +150 -0
- package/os/flow/tests/repository-line-version.test.ts +100 -0
- package/os/flow/tests/scripts.test.ts +97 -0
- package/os/flow/tests/state-roots.test.ts +127 -0
- package/os/flow/tests/version-files.test.ts +145 -0
- package/os/flow/version-files.ts +115 -0
- package/os/flow/worktree-path.ts +107 -0
- package/os/mission/handlers/archive.test.ts +108 -36
- package/os/mission/handlers/archive.ts +46 -51
- package/os/mission/lockfile.ts +84 -0
- package/os/mission/mission.module.ts +2 -1
- package/os/program/handlers/seal.ts +1 -1
- package/os/program/handlers/validate.ts +1 -1
- package/os/program/program.module.ts +2 -1
- package/os/program/schemas.ts +51 -34
- package/os/program/state.ts +1 -9
- package/os/rfc/acceptance.ts +84 -19
- package/os/rfc/frontmatter-io.ts +78 -12
- package/os/rfc/handlers/implement-stamp-lock.test.ts +133 -0
- package/os/rfc/handlers/implement-stamp-stale.test.ts +22 -0
- package/os/rfc/handlers/implement-stamp.ts +30 -24
- package/os/rfc/handlers/validate-rules.test.ts +9 -6
- package/os/rfc/handlers/validate-rules.ts +12 -10
- package/os/rfc/handlers/validate.ts +17 -5
- package/os/rfc/index.ts +13 -1
- package/os/rfc/probe-batch.ts +329 -0
- package/os/rfc/rfc.module.ts +19 -2
- package/os/rfc/verification-emit-check.test.ts +22 -0
- package/os/rfc/verification-emit-freshness.test.ts +22 -0
- package/os/rfc/verification-emit.test.ts +22 -0
- package/os/rfc/verification-evidence.ts +21 -16
- package/os/rfc/verification-refresh.test.ts +22 -0
- package/os/rfc/verification-refresh.ts +20 -18
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +9 -0
- package/os/system/handlers/outbox-validate.ts +120 -0
- package/os/system/handlers/system-map-validate.ts +107 -0
- package/os/system/handlers/system-outbox-scan.ts +320 -0
- package/os/system/handlers/system-task-collect.ts +305 -0
- package/os/system/handlers/system-task-create.ts +271 -0
- package/os/system/handlers/system-task-dispatch.ts +387 -0
- package/os/system/handlers/system-task-move.ts +353 -0
- package/os/system/handlers/system-task-status.ts +176 -0
- package/os/system/handlers/system-versionset-record.ts +476 -0
- package/os/system/index.ts +47 -0
- package/os/system/outbox-schema.ts +47 -0
- package/os/system/repo.ts +451 -0
- package/os/system/scenario-schemas.ts +62 -0
- package/os/system/schemas.ts +102 -0
- package/os/system/system.module.ts +449 -0
- package/os/system/task-schemas.ts +190 -0
- package/os/system/task-store.ts +184 -0
- package/os/system/tests/helpers.ts +189 -0
- package/os/system/tests/outbox-validate.test.ts +92 -0
- package/os/system/tests/system-map-validate.test.ts +321 -0
- package/os/system/tests/system-outbox-scan.test.ts +273 -0
- package/os/system/tests/system-profile.test.ts +90 -0
- package/os/system/tests/system-task-collect.test.ts +293 -0
- package/os/system/tests/system-task-dispatch.test.ts +279 -0
- package/os/system/tests/system-task-status.test.ts +153 -0
- package/os/system/tests/system-task.test.ts +330 -0
- package/os/system/tests/system-versionset.test.ts +314 -0
- package/os/werkstatt/handlers/werkstatt-lock-recover.ts +22 -5
- package/os/werkstatt/handlers/werkstatt-operation-validate.ts +1 -1
- package/os/werkstatt/werkstatt.module.ts +2 -85
- package/package.json +49 -1
- package/profiles/forge-shell.yaml +22 -10
- package/profiles/godot-game.yaml +24 -13
- package/profiles/knowledge.yaml +19 -0
- package/profiles/phaser-game.yaml +25 -13
- package/profiles/site-workshop.yaml +27 -10
- package/profiles/system.yaml +650 -0
- package/profiles/typescript.yaml +26 -9
- package/skills/fo/fo-outbox/SKILL.md +71 -0
- package/skills/fo/fo-session-retro/SKILL.md +18 -7
- package/skills/fo/fo-step-commit/SKILL.md +2 -1
- package/skills/fo/fo-system-dispatch/SKILL.md +65 -0
- package/skills/fo/fo-task-run/SKILL.md +75 -0
- package/src/config/forge-config.ts +2 -6
- package/src/index.ts +19 -4
- package/src/onboarding/agents-generate.ts +49 -5
- package/src/onboarding/create.ts +101 -9
- package/src/onboarding/doctor.ts +2 -51
- package/src/onboarding/upgrade.ts +86 -1
- package/src/tests/agents-generate-flow.test.ts +132 -0
- package/src/tests/create-flow.test.ts +114 -0
- package/src/tests/create.test.ts +22 -21
- package/src/tests/doctor-autonomy.test.ts +2 -1
- package/src/tests/fixtures/agents-generate-business-before.txt +6 -0
- package/src/tests/implement-stamp.test.ts +26 -3
- package/src/tests/profile-flow-hooks.test.ts +77 -0
- package/src/tests/profile-schema.test.ts +2 -1
- package/src/tests/program-schemas.test.ts +66 -6
- package/src/tests/program-spec-node.test.ts +1 -5
- package/src/tests/rfc-evidence-sync.test.ts +22 -0
- package/src/tests/rfc-implement-stamp-governance.test.ts +25 -1
- package/src/tests/rfc-verification-verdict-ingest.test.ts +22 -0
- package/src/tests/upgrade-flow.test.ts +174 -0
- package/src/types.ts +11 -2
- package/dist/os/werkstatt/handlers/session-close.d.ts +0 -13
- package/dist/os/werkstatt/handlers/session-close.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/session-close.js +0 -56
- package/dist/os/werkstatt/handlers/session-close.js.map +0 -1
- package/dist/os/werkstatt/handlers/session-engine.d.ts +0 -3
- package/dist/os/werkstatt/handlers/session-engine.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/session-engine.js +0 -28
- package/dist/os/werkstatt/handlers/session-engine.js.map +0 -1
- package/dist/os/werkstatt/handlers/session-open.d.ts +0 -10
- package/dist/os/werkstatt/handlers/session-open.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/session-open.js +0 -46
- package/dist/os/werkstatt/handlers/session-open.js.map +0 -1
- package/dist/os/werkstatt/handlers/session-status.d.ts +0 -9
- package/dist/os/werkstatt/handlers/session-status.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/session-status.js +0 -34
- package/dist/os/werkstatt/handlers/session-status.js.map +0 -1
- package/os/werkstatt/handlers/session-close.ts +0 -82
- package/os/werkstatt/handlers/session-engine.ts +0 -34
- package/os/werkstatt/handlers/session-open.ts +0 -68
- package/os/werkstatt/handlers/session-status.ts +0 -55
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.push — the only outbound path (RFC-1491): refuse preflight
|
|
4
|
+
FLOW-PUSH-01/02/03/06/07, run the atomic push of develop+main+tags under
|
|
5
|
+
FORGE_FLOW_OP=push, journal the push, then publish the package-line tags
|
|
6
|
+
(pushed now plus journal-scoped pending, minus baseline) through
|
|
7
|
+
repo-extract with a single ours-merge reconcile — never force-push, never
|
|
8
|
+
a manual push path.</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>No digest computation beyond collectDigest — digest.ts owns the shape.</item>
|
|
11
|
+
<item>No real repo-extract in tests — fixtures install a fake binary.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<KEY_DECISIONS>
|
|
15
|
+
<item>The digest must be quoted: a recomputed digestId mismatch refuses FLOW-PUSH-02 and names the new id, so the operator always pushes what they reviewed.</item>
|
|
16
|
+
<item>A rerun with an empty develop/main/tag digest skips the push but still retries pendingPublications — publication retries are journal-scoped to this machine's pushes only (AUDIT-RFC-1491-G1).</item>
|
|
17
|
+
<item>Publication failures are FLOW-PUSH-05 per tag; the command continues with the next tag and exits non-zero at the end.</item>
|
|
18
|
+
</KEY_DECISIONS>
|
|
19
|
+
<CHANGE_SUMMARY>
|
|
20
|
+
<item>RFC-1491: step 5 — flow.push atomic outbound path + extract publication</item>
|
|
21
|
+
<item>RFC-1491: independent-review pass — shared lock constants, publishable pending filter, declared rules, hold ordering, sha-pinned refspecs</item>
|
|
22
|
+
<item>RFC-1501: one argv-shaped read-only git allowlist for the recording and read-only adapters (RFC-1501)
|
|
23
|
+
|
|
24
|
+
READ_ONLY_GIT_QUERIES / isReadOnlyGitQuery replace the recording adapter's
|
|
25
|
+
first-argument allowlist; the read-only adapter and the static scan use the same
|
|
26
|
+
table. The kernel forwards --dry-run into commands that declare a dry-run flag,
|
|
27
|
+
and flow.push / flow.hold dry-runs no longer fetch. The switch-over runbook goes
|
|
28
|
+
back to werkstatt run flow.install --dry-run.</item>
|
|
29
|
+
<item>RFC-1503: steps 1-5 — highest-per-line pending selection, publish-superseded/publish-retired journal events, flow.publication.retire</item>
|
|
30
|
+
<item>RFC-1503: review r1 — FLOW-07 on retire journal failure, journal re-read before publish, publication-order unit tests, stale catalog/inventory regen</item>
|
|
31
|
+
<history>RFC-1491</history>
|
|
32
|
+
</CHANGE_SUMMARY>
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import { join } from "node:path";
|
|
36
|
+
|
|
37
|
+
import type {
|
|
38
|
+
Diagnostic,
|
|
39
|
+
ForgeCommandInput,
|
|
40
|
+
ForgeCommandResult,
|
|
41
|
+
ForgeRuntimeContext,
|
|
42
|
+
WorkspaceIO,
|
|
43
|
+
} from "../../../src/types.ts";
|
|
44
|
+
import { resolveIo } from "../../../src/utils/io.ts";
|
|
45
|
+
import { collectDigest, lineForTag, versionOfTag } from "../digest.ts";
|
|
46
|
+
import {
|
|
47
|
+
git,
|
|
48
|
+
requireGit,
|
|
49
|
+
topLevel,
|
|
50
|
+
} from "../git.ts";
|
|
51
|
+
import { markerIsValid } from "../markers.ts";
|
|
52
|
+
import { publishTag, tagAnnotationLevel, type PublicationRow } from "../publish.ts";
|
|
53
|
+
import { planPublications, type PublicationPlanEntry } from "../publication-order.ts";
|
|
54
|
+
import {
|
|
55
|
+
appendJournal,
|
|
56
|
+
commonGitDir,
|
|
57
|
+
FlowRegistrySchemaError,
|
|
58
|
+
readJournal,
|
|
59
|
+
} from "../registry.ts";
|
|
60
|
+
import { discoverReleaseLines, type ReleaseLine } from "../release-lines.ts";
|
|
61
|
+
import { primaryWorktree } from "../worktree-path.ts";
|
|
62
|
+
|
|
63
|
+
export interface FlowPushData {
|
|
64
|
+
digestId: string;
|
|
65
|
+
pushed: boolean;
|
|
66
|
+
refs: string[];
|
|
67
|
+
publications: PublicationRow[];
|
|
68
|
+
/** RFC-1503: pending tags superseded this run — `{ tag, by }`. */
|
|
69
|
+
superseded: Array<{ tag: string; by: string }>;
|
|
70
|
+
/** RFC-1503: tags with a publish-retired journal record (informational). */
|
|
71
|
+
retired: string[];
|
|
72
|
+
diagnostics: Diagnostic[];
|
|
73
|
+
/** RFC-1501: whether the preflight digest fetched origin; absent on early refusals. */
|
|
74
|
+
fetched?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function refuse(ruleId: string, message: string, fixHint?: string): FlowPushData {
|
|
78
|
+
return {
|
|
79
|
+
digestId: "",
|
|
80
|
+
pushed: false,
|
|
81
|
+
refs: [],
|
|
82
|
+
publications: [],
|
|
83
|
+
superseded: [],
|
|
84
|
+
retired: [],
|
|
85
|
+
diagnostics: [{ ruleId, severity: "error", message, fixHint }],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Core of flow.push — callable in tests. Every refusal is a diagnostic in
|
|
91
|
+
* the returned data; nothing leaves the machine unless pushed: true.
|
|
92
|
+
*/
|
|
93
|
+
export async function pushFlow(
|
|
94
|
+
repoRoot: string,
|
|
95
|
+
io: WorkspaceIO,
|
|
96
|
+
opts: { digest: string; dryRun: boolean; now?: Date },
|
|
97
|
+
): Promise<FlowPushData> {
|
|
98
|
+
const common = await commonGitDir(io, repoRoot);
|
|
99
|
+
const primary = await primaryWorktree(io, repoRoot);
|
|
100
|
+
|
|
101
|
+
// --- preflight -------------------------------------------------------------
|
|
102
|
+
// RFC-1501: a dry-run never fetches — `git fetch origin --prune` rewrites
|
|
103
|
+
// and prunes remote-tracking refs. It judges the digest exactly like
|
|
104
|
+
// `flow.digest --no-fetch`; a real push still fetches first.
|
|
105
|
+
const digest = await collectDigest(repoRoot, io, { fetch: !opts.dryRun });
|
|
106
|
+
const noOrigin = digest.diagnostics.find(
|
|
107
|
+
(d) => d.ruleId === "FLOW-PUSH-01" && d.severity === "error",
|
|
108
|
+
);
|
|
109
|
+
if (noOrigin !== undefined) {
|
|
110
|
+
return refuse("FLOW-PUSH-01", noOrigin.message, "add an 'origin' remote first");
|
|
111
|
+
}
|
|
112
|
+
if (digest.digestId !== opts.digest) {
|
|
113
|
+
return refuse(
|
|
114
|
+
"FLOW-PUSH-02",
|
|
115
|
+
`the digest is stale — the current digestId is ${digest.digestId}, not ${opts.digest}`,
|
|
116
|
+
`run flow.digest, review the new state and re-run flow.push --digest ${digest.digestId}`,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
for (const [branch, remote] of [
|
|
121
|
+
["develop", digest.develop.remote],
|
|
122
|
+
["main", digest.main.remote],
|
|
123
|
+
] as const) {
|
|
124
|
+
if (remote === null) continue;
|
|
125
|
+
const ancestor = await git(repoRoot, io, [
|
|
126
|
+
"merge-base",
|
|
127
|
+
"--is-ancestor",
|
|
128
|
+
remote,
|
|
129
|
+
branch,
|
|
130
|
+
]);
|
|
131
|
+
if (ancestor.exitCode !== 0) {
|
|
132
|
+
return refuse(
|
|
133
|
+
"FLOW-PUSH-03",
|
|
134
|
+
`origin/${branch} is not an ancestor of ${branch} — someone pushed elsewhere`,
|
|
135
|
+
"fetch, inspect the divergence and reconcile before pushing",
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const { lines } = await discoverReleaseLines(repoRoot, io);
|
|
141
|
+
|
|
142
|
+
// Publications (RFC-1503): candidates = package-line tags pushed now +
|
|
143
|
+
// journal-scoped pending, minus baseline annotations; per line only the
|
|
144
|
+
// highest version is attempted — lower ones supersede, retired tags drop.
|
|
145
|
+
const journalEvents = await readJournal(io, common);
|
|
146
|
+
const publishedTags = new Set(
|
|
147
|
+
journalEvents.filter((e) => e.event === "publish").map((e) => e.branch),
|
|
148
|
+
);
|
|
149
|
+
const retiredTags = new Set(
|
|
150
|
+
journalEvents.filter((e) => e.event === "publish-retired").map((e) => e.branch),
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
const publicationTags = new Map<string, ReleaseLine>();
|
|
154
|
+
const addCandidate = (tag: string, lineId: string | null): void => {
|
|
155
|
+
const line =
|
|
156
|
+
(lineId === null ? null : lines.find((l) => l.id === lineId)) ?? lineForTag(lines, tag);
|
|
157
|
+
if (line !== null && line.id !== "repo") publicationTags.set(tag, line);
|
|
158
|
+
};
|
|
159
|
+
for (const tag of digest.tags) addCandidate(tag, null);
|
|
160
|
+
for (const pending of digest.pendingPublications) addCandidate(pending.tag, pending.line);
|
|
161
|
+
for (const sup of digest.supersededPublications) addCandidate(sup.tag, sup.line);
|
|
162
|
+
|
|
163
|
+
const baselineSkipped: PublicationRow[] = [];
|
|
164
|
+
const planCandidates: PublicationPlanEntry[] = [];
|
|
165
|
+
for (const [tag, line] of [...publicationTags.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
166
|
+
const level = await tagAnnotationLevel(repoRoot, io, tag);
|
|
167
|
+
if (level === "baseline") {
|
|
168
|
+
baselineSkipped.push({
|
|
169
|
+
tag,
|
|
170
|
+
line: line.id,
|
|
171
|
+
status: "skipped-baseline",
|
|
172
|
+
dest: null,
|
|
173
|
+
verify: null,
|
|
174
|
+
reconciled: false,
|
|
175
|
+
destHead: null,
|
|
176
|
+
});
|
|
177
|
+
} else {
|
|
178
|
+
planCandidates.push({ tag, line: line.id });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
let plan = planPublications(planCandidates, publishedTags, retiredTags, (tag, lineId) =>
|
|
182
|
+
versionOfTag(lines, tag, lineId),
|
|
183
|
+
);
|
|
184
|
+
let publishable: Array<{ tag: string; line: ReleaseLine }> = plan.attempt.map((p) => ({
|
|
185
|
+
tag: p.tag,
|
|
186
|
+
line: lines.find((l) => l.id === p.line)!,
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
for (const { line } of publishable) {
|
|
190
|
+
const dir = line.paths[0]!;
|
|
191
|
+
if (!(await markerIsValid(join(primary, dir, "forge.generated.yaml"), io))) {
|
|
192
|
+
return refuse(
|
|
193
|
+
"FLOW-PUSH-06",
|
|
194
|
+
`package line ${line.id} has no valid forge.generated.yaml in ${dir} — it must not be published`,
|
|
195
|
+
"re-run flow.install to restore the marker, or remove the line's tags",
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const extractBin = join(primary, "node_modules", ".bin", "repo-extract");
|
|
201
|
+
if (publishable.length > 0 && !(await io.exists(extractBin))) {
|
|
202
|
+
return refuse(
|
|
203
|
+
"FLOW-PUSH-07",
|
|
204
|
+
`${extractBin} is missing while ${publishable.length} tag(s) wait to publish`,
|
|
205
|
+
"install the workspace dependencies so repo-extract is linked",
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Sha-pinned refspecs — the push ships exactly the reviewed tips; a local
|
|
210
|
+
// branch that moved since the digest stays local instead of sneaking in.
|
|
211
|
+
const refspecs = [
|
|
212
|
+
`${digest.develop.local}:refs/heads/develop`,
|
|
213
|
+
`${digest.main.local}:refs/heads/main`,
|
|
214
|
+
...digest.tags.map((t) => `refs/tags/${t}:refs/tags/${t}`),
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
if (opts.dryRun) {
|
|
218
|
+
return {
|
|
219
|
+
digestId: digest.digestId,
|
|
220
|
+
fetched: digest.fetched,
|
|
221
|
+
pushed: false,
|
|
222
|
+
refs: refspecs,
|
|
223
|
+
publications: [
|
|
224
|
+
...baselineSkipped,
|
|
225
|
+
...publishable.map(
|
|
226
|
+
(p): PublicationRow => ({
|
|
227
|
+
tag: p.tag,
|
|
228
|
+
line: p.line.id,
|
|
229
|
+
status: "pending",
|
|
230
|
+
dest: null,
|
|
231
|
+
verify: null,
|
|
232
|
+
reconciled: false,
|
|
233
|
+
destHead: null,
|
|
234
|
+
}),
|
|
235
|
+
),
|
|
236
|
+
],
|
|
237
|
+
superseded: plan.superseded.map((s) => ({
|
|
238
|
+
tag: s.tag,
|
|
239
|
+
by: s.by ?? plan.attempt.find((a) => a.line === s.line)?.tag ?? "",
|
|
240
|
+
})),
|
|
241
|
+
retired: [...retiredTags].sort((a, b) => a.localeCompare(b)),
|
|
242
|
+
diagnostics: [],
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// --- push ------------------------------------------------------------------
|
|
247
|
+
const hasRefs = digest.develop.ahead > 0 || digest.main.ahead > 0 || digest.tags.length > 0;
|
|
248
|
+
const journalWarnings: string[] = [];
|
|
249
|
+
let pushed = false;
|
|
250
|
+
if (hasRefs) {
|
|
251
|
+
const push = await git(repoRoot, io, ["push", "--atomic", "origin", ...refspecs], {
|
|
252
|
+
env: { FORGE_FLOW_OP: "push" },
|
|
253
|
+
});
|
|
254
|
+
if (push.exitCode !== 0) {
|
|
255
|
+
return {
|
|
256
|
+
digestId: digest.digestId,
|
|
257
|
+
fetched: digest.fetched,
|
|
258
|
+
pushed: false,
|
|
259
|
+
refs: refspecs,
|
|
260
|
+
publications: [],
|
|
261
|
+
superseded: [],
|
|
262
|
+
retired: [...retiredTags].sort((a, b) => a.localeCompare(b)),
|
|
263
|
+
diagnostics: [
|
|
264
|
+
{
|
|
265
|
+
ruleId: "FLOW-PUSH-04",
|
|
266
|
+
severity: "error",
|
|
267
|
+
message: `git push --atomic failed — nothing was updated: ${push.stderr.trim().split("\n").slice(-1)[0] ?? "unknown error"}`,
|
|
268
|
+
fixHint: "inspect the remote error, reconcile, and re-run with a fresh digest",
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
pushed = true;
|
|
274
|
+
try {
|
|
275
|
+
await appendJournal(io, common, {
|
|
276
|
+
event: "push",
|
|
277
|
+
branch: "develop",
|
|
278
|
+
sha: digest.develop.local,
|
|
279
|
+
base: digest.develop.remote ?? undefined,
|
|
280
|
+
detail: digest.tags.join(" "),
|
|
281
|
+
});
|
|
282
|
+
} catch (error) {
|
|
283
|
+
journalWarnings.push(
|
|
284
|
+
`push journal record could not be appended — pending-publication retries for ${digest.tags.join(", ") || "no tags"} are lost: ${String(error)}`,
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// --- publications ------------------------------------------------------------
|
|
290
|
+
// RFC-1503 review r1 F-5: re-read the journal after the push — a retire or
|
|
291
|
+
// supersede record appended meanwhile must drop the tag from this run's
|
|
292
|
+
// attempts. The window can only be narrowed, not closed: appendJournal
|
|
293
|
+
// takes no push-spanning lock.
|
|
294
|
+
const freshJournal = await readJournal(io, common);
|
|
295
|
+
const freshPublished = new Set(
|
|
296
|
+
freshJournal.filter((e) => e.event === "publish").map((e) => e.branch),
|
|
297
|
+
);
|
|
298
|
+
const freshRetired = new Set(
|
|
299
|
+
freshJournal.filter((e) => e.event === "publish-retired").map((e) => e.branch),
|
|
300
|
+
);
|
|
301
|
+
const freshSuperseded = new Set(
|
|
302
|
+
freshJournal.filter((e) => e.event === "publish-superseded").map((e) => e.branch),
|
|
303
|
+
);
|
|
304
|
+
if (
|
|
305
|
+
freshPublished.size !== publishedTags.size ||
|
|
306
|
+
freshRetired.size !== retiredTags.size
|
|
307
|
+
) {
|
|
308
|
+
for (const tag of freshPublished) publishedTags.add(tag);
|
|
309
|
+
for (const tag of freshRetired) retiredTags.add(tag);
|
|
310
|
+
plan = planPublications(
|
|
311
|
+
planCandidates.filter((c) => !freshSuperseded.has(c.tag)),
|
|
312
|
+
publishedTags,
|
|
313
|
+
retiredTags,
|
|
314
|
+
(tag, lineId) => versionOfTag(lines, tag, lineId),
|
|
315
|
+
);
|
|
316
|
+
publishable = plan.attempt.map((p) => ({
|
|
317
|
+
tag: p.tag,
|
|
318
|
+
line: lines.find((l) => l.id === p.line)!,
|
|
319
|
+
}));
|
|
320
|
+
} else {
|
|
321
|
+
plan = {
|
|
322
|
+
attempt: plan.attempt,
|
|
323
|
+
superseded: plan.superseded.filter((s) => !freshSuperseded.has(s.tag)),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const publications: PublicationRow[] = [...baselineSkipped];
|
|
328
|
+
const supersededOut: Array<{ tag: string; by: string }> = [];
|
|
329
|
+
const diagnostics: Diagnostic[] = journalWarnings.map(
|
|
330
|
+
(message): Diagnostic => ({
|
|
331
|
+
ruleId: "FLOW-07",
|
|
332
|
+
severity: "warning",
|
|
333
|
+
message,
|
|
334
|
+
}),
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
const recordSuperseded = async (tag: string, by: string): Promise<void> => {
|
|
338
|
+
try {
|
|
339
|
+
await appendJournal(io, common, {
|
|
340
|
+
event: "publish-superseded",
|
|
341
|
+
branch: tag,
|
|
342
|
+
sha: "",
|
|
343
|
+
detail: by,
|
|
344
|
+
});
|
|
345
|
+
supersededOut.push({ tag, by });
|
|
346
|
+
} catch (error) {
|
|
347
|
+
diagnostics.push({
|
|
348
|
+
ruleId: "FLOW-07",
|
|
349
|
+
severity: "warning",
|
|
350
|
+
message: `publish-superseded record for ${tag} could not be appended — the tag stays pending and will be re-evaluated on the next push: ${String(error)}`,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
// Superseded on sight — a pending tag at or below the line's newest
|
|
356
|
+
// published version is never extracted (RFC-1503 AC-3).
|
|
357
|
+
for (const sup of plan.superseded) {
|
|
358
|
+
if (sup.by !== null) await recordSuperseded(sup.tag, sup.by);
|
|
359
|
+
}
|
|
360
|
+
// Shadowed candidates — superseded only once their line's highest tag
|
|
361
|
+
// actually publishes (RFC-1503 AC-2).
|
|
362
|
+
const shadowed = new Map<string, string[]>();
|
|
363
|
+
for (const sup of plan.superseded) {
|
|
364
|
+
if (sup.by === null) {
|
|
365
|
+
const list = shadowed.get(sup.line) ?? [];
|
|
366
|
+
list.push(sup.tag);
|
|
367
|
+
shadowed.set(sup.line, list);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
for (const { tag, line } of publishable) {
|
|
372
|
+
const row = await publishTag(primary, io, { line, tag });
|
|
373
|
+
publications.push(row);
|
|
374
|
+
if (row.status === "failed") {
|
|
375
|
+
diagnostics.push({
|
|
376
|
+
ruleId: "FLOW-PUSH-05",
|
|
377
|
+
severity: "error",
|
|
378
|
+
message: `publication of ${tag} (${line.id}) failed: ${row.error ?? "unknown"}`,
|
|
379
|
+
fixHint: "fix the extract or destination, then re-run flow.push with a fresh digest — pending publications are retried",
|
|
380
|
+
});
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
if (row.status === "published") {
|
|
384
|
+
try {
|
|
385
|
+
await appendJournal(io, common, {
|
|
386
|
+
event: "publish",
|
|
387
|
+
branch: tag,
|
|
388
|
+
sha: row.destHead ?? "",
|
|
389
|
+
detail: row.dest ?? "",
|
|
390
|
+
});
|
|
391
|
+
} catch (error) {
|
|
392
|
+
diagnostics.push({
|
|
393
|
+
ruleId: "FLOW-07",
|
|
394
|
+
severity: "warning",
|
|
395
|
+
message: `publish journal record for ${tag} could not be appended — the tag will be retried as pending: ${String(error)}`,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
for (const low of shadowed.get(line.id) ?? []) {
|
|
399
|
+
await recordSuperseded(low, tag);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return {
|
|
405
|
+
digestId: digest.digestId,
|
|
406
|
+
fetched: digest.fetched,
|
|
407
|
+
pushed,
|
|
408
|
+
refs: refspecs,
|
|
409
|
+
publications,
|
|
410
|
+
superseded: supersededOut,
|
|
411
|
+
retired: [...freshRetired].sort((a, b) => a.localeCompare(b)),
|
|
412
|
+
diagnostics,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export async function runFlowPush(
|
|
417
|
+
input: ForgeCommandInput,
|
|
418
|
+
context: ForgeRuntimeContext,
|
|
419
|
+
): Promise<ForgeCommandResult<FlowPushData>> {
|
|
420
|
+
const { workspaceRoot, logger, outputFormat } = context;
|
|
421
|
+
const io: WorkspaceIO = resolveIo(context.io);
|
|
422
|
+
await requireGit(io);
|
|
423
|
+
|
|
424
|
+
const repoRoot = await topLevel(workspaceRoot, io);
|
|
425
|
+
if (repoRoot === null) {
|
|
426
|
+
throw new Error("flow.push must run inside a git repository");
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const digestFlag = typeof input.flags["digest"] === "string" ? input.flags["digest"] : "";
|
|
430
|
+
if (digestFlag.length === 0) {
|
|
431
|
+
return {
|
|
432
|
+
data: refuse(
|
|
433
|
+
"FLOW-PUSH-02",
|
|
434
|
+
"--digest <id> is required — run flow.digest first and quote its digestId",
|
|
435
|
+
),
|
|
436
|
+
exitCode: 1,
|
|
437
|
+
summary: "[flow.push] missing --digest",
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
let data: FlowPushData;
|
|
442
|
+
try {
|
|
443
|
+
data = await pushFlow(repoRoot, io, {
|
|
444
|
+
digest: digestFlag,
|
|
445
|
+
dryRun: input.flags["dry-run"] === true,
|
|
446
|
+
});
|
|
447
|
+
} catch (error) {
|
|
448
|
+
if (error instanceof FlowRegistrySchemaError) {
|
|
449
|
+
data = refuse("FLOW-07", error.message);
|
|
450
|
+
} else {
|
|
451
|
+
throw error;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const errors = data.diagnostics.filter((d) => d.severity === "error");
|
|
455
|
+
const publishedCount = data.publications.filter((p) => p.status === "published").length;
|
|
456
|
+
|
|
457
|
+
if (outputFormat === "pretty") {
|
|
458
|
+
for (const d of data.diagnostics) {
|
|
459
|
+
if (d.severity === "error") logger.error(` ${d.ruleId}: ${d.message}`);
|
|
460
|
+
else logger.warn(` ${d.ruleId}: ${d.message}`);
|
|
461
|
+
}
|
|
462
|
+
if (data.pushed) {
|
|
463
|
+
logger.info(` pushed: ${data.refs.join(", ")}`);
|
|
464
|
+
}
|
|
465
|
+
for (const pub of data.publications) {
|
|
466
|
+
if (pub.status === "published") {
|
|
467
|
+
logger.info(` published ${pub.tag} → ${pub.dest}${pub.reconciled ? " (reconciled)" : ""}`);
|
|
468
|
+
} else if (pub.status === "skipped-baseline") {
|
|
469
|
+
logger.info(` skipped baseline tag ${pub.tag}`);
|
|
470
|
+
} else if (pub.status === "pending") {
|
|
471
|
+
logger.info(` would publish ${pub.tag} (dry-run)`);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
for (const sup of data.superseded) {
|
|
475
|
+
logger.info(` superseded ${sup.tag} by ${sup.by}`);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return {
|
|
480
|
+
data,
|
|
481
|
+
exitCode: errors.length > 0 ? 1 : 0,
|
|
482
|
+
summary: input.flags["dry-run"] === true
|
|
483
|
+
? `[flow.push] dry-run — ${data.refs.length} ref(s), ${data.publications.length} publication candidate(s)`
|
|
484
|
+
: data.pushed || publishedCount > 0
|
|
485
|
+
? `[flow.push] pushed ${data.refs.length} ref(s), ${publishedCount} publication(s)`
|
|
486
|
+
: `[flow.push] refused — ${errors.length} error(s)`,
|
|
487
|
+
};
|
|
488
|
+
}
|