@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,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>AC-2/AC-3/AC-4: the installed POSIX guard refuses commits on
|
|
4
|
+
develop/main (FLOW-GUARD-01), non-conforming names (FLOW-GUARD-02), detached
|
|
5
|
+
HEAD outside rebase/cherry-pick (FLOW-GUARD-03) and unknown FORGE_FLOW_OP
|
|
6
|
+
values (FLOW-GUARD-04); it allows conforming auto branches, generated repos,
|
|
7
|
+
the closed FORGE_FLOW_OP vocabulary and the unborn develop — proven by real
|
|
8
|
+
`git commit` runs through core.hooksPath in throwaway repos.</purpose>
|
|
9
|
+
</MODULE_CONTRACT>
|
|
10
|
+
<CHANGE_SUMMARY>
|
|
11
|
+
<item>RFC-1486: step 2 — guard behavior tests</item>
|
|
12
|
+
<item>RFC-1486: step 2 — POSIX guard asset + behavior/parity tests</item>
|
|
13
|
+
<item>RFC-1490: pre-merge-commit guard mode + per-mode op vocabulary; amends the wave-1 guard RFC's backmerge escape (AC-11)</item>
|
|
14
|
+
</CHANGE_SUMMARY>
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { mkdir, rm } from "node:fs/promises";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
|
|
20
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
21
|
+
|
|
22
|
+
import { writeFile } from "node:fs/promises";
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
gitExec,
|
|
26
|
+
initRepo,
|
|
27
|
+
installGuard,
|
|
28
|
+
tryCommit,
|
|
29
|
+
} from "./helpers.ts";
|
|
30
|
+
|
|
31
|
+
const dirs: string[] = [];
|
|
32
|
+
|
|
33
|
+
afterEach(async () => {
|
|
34
|
+
for (const dir of dirs.splice(0)) {
|
|
35
|
+
await rm(dir, { recursive: true, force: true });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
async function repoWithGuard(opts?: {
|
|
40
|
+
branch?: string;
|
|
41
|
+
seedCommit?: boolean;
|
|
42
|
+
}): Promise<string> {
|
|
43
|
+
const dir = await initRepo(opts);
|
|
44
|
+
dirs.push(dir);
|
|
45
|
+
await installGuard(dir);
|
|
46
|
+
return dir;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function expectRefusal(result: { exitCode: number | null; stderr: string }, rule: string) {
|
|
50
|
+
expect(result.exitCode).toBe(1);
|
|
51
|
+
expect(result.stderr).toContain(`${rule}:`);
|
|
52
|
+
expect(result.stderr).toContain("remedy:");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe("flow-guard.sh via core.hooksPath", () => {
|
|
56
|
+
it("refuses a commit on develop with FLOW-GUARD-01 (AC-2)", async () => {
|
|
57
|
+
const repo = await repoWithGuard();
|
|
58
|
+
await gitExec(repo, ["switch", "-c", "develop"]);
|
|
59
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "" }), "FLOW-GUARD-01");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("refuses a commit on main with FLOW-GUARD-01", async () => {
|
|
63
|
+
const repo = await repoWithGuard();
|
|
64
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "" }), "FLOW-GUARD-01");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("refuses a commit on feature/x with FLOW-GUARD-02 (AC-3)", async () => {
|
|
68
|
+
const repo = await repoWithGuard();
|
|
69
|
+
await gitExec(repo, ["switch", "-c", "feature/x"]);
|
|
70
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "" }), "FLOW-GUARD-02");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("allows a commit on a conforming auto branch", async () => {
|
|
74
|
+
const repo = await repoWithGuard();
|
|
75
|
+
await gitExec(repo, ["switch", "-c", "auto/session-261101-01-guard-test"]);
|
|
76
|
+
const result = await tryCommit(repo, { FORGE_FLOW_OP: "" });
|
|
77
|
+
expect(result.exitCode).toBe(0);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("refuses a commit on a detached HEAD with FLOW-GUARD-03", async () => {
|
|
81
|
+
const repo = await repoWithGuard();
|
|
82
|
+
await gitExec(repo, ["switch", "--detach"]);
|
|
83
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "" }), "FLOW-GUARD-03");
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("allows a detached HEAD while a rebase is in progress", async () => {
|
|
87
|
+
const repo = await repoWithGuard();
|
|
88
|
+
await gitExec(repo, ["switch", "--detach"]);
|
|
89
|
+
// A rebase-merge directory inside the git dir marks an in-flight rebase.
|
|
90
|
+
const gitDir = join(repo, ".git", "rebase-merge");
|
|
91
|
+
await mkdir(gitDir, { recursive: true });
|
|
92
|
+
const result = await tryCommit(repo, { FORGE_FLOW_OP: "" });
|
|
93
|
+
expect(result.exitCode).toBe(0);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("allows the adoption commit: FORGE_FLOW_OP=install on develop", async () => {
|
|
97
|
+
const repo = await repoWithGuard();
|
|
98
|
+
await gitExec(repo, ["switch", "-c", "develop"]);
|
|
99
|
+
const result = await tryCommit(repo, { FORGE_FLOW_OP: "install" });
|
|
100
|
+
expect(result.exitCode).toBe(0);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("refuses FORGE_FLOW_OP=backmerge on develop with FLOW-GUARD-04 (retired, RFC-1490)", async () => {
|
|
104
|
+
const repo = await repoWithGuard();
|
|
105
|
+
await gitExec(repo, ["switch", "-c", "develop"]);
|
|
106
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "backmerge" }), "FLOW-GUARD-04");
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("refuses an unknown FORGE_FLOW_OP with FLOW-GUARD-04, before branch checks", async () => {
|
|
110
|
+
const repo = await repoWithGuard();
|
|
111
|
+
// On main — a bogus op must surface FLOW-GUARD-04, not FLOW-GUARD-01.
|
|
112
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "bogus" }), "FLOW-GUARD-04");
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("exempts a repository carrying forge.generated.yaml (AC-4)", async () => {
|
|
116
|
+
const repo = await repoWithGuard();
|
|
117
|
+
await writeFile(
|
|
118
|
+
join(repo, "forge.generated.yaml"),
|
|
119
|
+
'schema: "forge/generated@1"\ngenerator: "extract"\nsource: "werkstatt"\n',
|
|
120
|
+
);
|
|
121
|
+
const result = await tryCommit(repo, { FORGE_FLOW_OP: "" });
|
|
122
|
+
expect(result.exitCode).toBe(0);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("allows the repository's first commit on an unborn develop", async () => {
|
|
126
|
+
const repo = await repoWithGuard({ branch: "develop", seedCommit: false });
|
|
127
|
+
const result = await tryCommit(repo, { FORGE_FLOW_OP: "" });
|
|
128
|
+
expect(result.exitCode).toBe(0);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("still refuses the first commit on an unborn main", async () => {
|
|
132
|
+
const repo = await repoWithGuard({ branch: "main", seedCommit: false });
|
|
133
|
+
expectRefusal(await tryCommit(repo, { FORGE_FLOW_OP: "" }), "FLOW-GUARD-01");
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.hold / flow.unhold tests (RFC-1491, AC-7/8/9): holding item A
|
|
4
|
+
replays the tail so develop keeps B's work without A's; the registry holds
|
|
5
|
+
an entry with held.tip = A's tip and worktree null; the next digest still
|
|
6
|
+
attributes B through journal rewrites; FLOW-HOLD-02 on a local release tag,
|
|
7
|
+
FLOW-HOLD-03 on an open branch based above, FLOW-HOLD-07 on a conflicting
|
|
8
|
+
replay; unhold recreates the worktree and integrate lands A again; the
|
|
9
|
+
48-character held slug truncates correctly.</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>No push/publication coverage — flow-push tests own that.</item>
|
|
12
|
+
<item>Never touches the enclosing repository — all fixtures are mkdtemp repos.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-1491: step 4 — flow.hold/unhold tests</item>
|
|
17
|
+
<item>RFC-1491: step 4 — flow.hold replay + flow.unhold worktree restore</item>
|
|
18
|
+
<item>RFC-1491: independent-review pass — shared lock constants, publishable pending filter, declared rules, hold ordering, sha-pinned refspecs</item>
|
|
19
|
+
<item>RFC-1491: digest segments develop by first-parent chain; hold of the topmost item skips the empty replay
|
|
20
|
+
|
|
21
|
+
Steering-session verification of wave 2 found two outbound defects:
|
|
22
|
+
- flow.digest attributed items by index spans over the date-ordered tail; after a fix release and its back-merge, the fix cut record (whose range lives on main) claimed the develop integration that shared its base, so the operator saw 'feat: dev work' labelled as the fix release. Segments now follow develop's first-parent chain and item commit counts come from the base..tip range.
|
|
23
|
+
- flow.hold on the item at the tip of develop ran cherry-pick on an empty range and refused FLOW-HOLD-07. An empty tail now resets develop to the item's base.</item>
|
|
24
|
+
<item>RFC-1501: one argv-shaped read-only git allowlist for the recording and read-only adapters (RFC-1501)
|
|
25
|
+
|
|
26
|
+
READ_ONLY_GIT_QUERIES / isReadOnlyGitQuery replace the recording adapter's
|
|
27
|
+
first-argument allowlist; the read-only adapter and the static scan use the same
|
|
28
|
+
table. The kernel forwards --dry-run into commands that declare a dry-run flag,
|
|
29
|
+
and flow.push / flow.hold dry-runs no longer fetch. The switch-over runbook goes
|
|
30
|
+
back to werkstatt run flow.install --dry-run.</item>
|
|
31
|
+
</CHANGE_SUMMARY>
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
35
|
+
import { tmpdir } from "node:os";
|
|
36
|
+
import { join } from "node:path";
|
|
37
|
+
|
|
38
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
39
|
+
|
|
40
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
41
|
+
import { collectDigest } from "../digest.ts";
|
|
42
|
+
import { holdFlowItem, heldBranchName } from "../handlers/flow-hold.ts";
|
|
43
|
+
import { unholdFlowBranch } from "../handlers/flow-unhold.ts";
|
|
44
|
+
import { integrateFlowBranch } from "../handlers/flow-integrate.ts";
|
|
45
|
+
import { openFlowBranch } from "../handlers/flow-open.ts";
|
|
46
|
+
import { releaseTagAnnotation, writeReleaseTag } from "../release-tags.ts";
|
|
47
|
+
import { commonGitDir, readRegistry } from "../registry.ts";
|
|
48
|
+
import { gitExec, initRepo } from "./helpers.ts";
|
|
49
|
+
|
|
50
|
+
const NOW = new Date("2026-11-02T12:00:00Z");
|
|
51
|
+
|
|
52
|
+
const dirs: string[] = [];
|
|
53
|
+
afterEach(async () => {
|
|
54
|
+
for (const dir of dirs.splice(0)) {
|
|
55
|
+
await rm(dir, { recursive: true, force: true });
|
|
56
|
+
}
|
|
57
|
+
}, 20_000);
|
|
58
|
+
|
|
59
|
+
/** Governed repo with a bare origin — fully pushed, empty tail. */
|
|
60
|
+
async function repoWithOrigin(): Promise<{ repo: string; origin: string }> {
|
|
61
|
+
const repo = await initRepo({ prefix: "flow-hold-" });
|
|
62
|
+
dirs.push(repo);
|
|
63
|
+
await writeFile(join(repo, "forge.yaml"), 'schema: "forge/workspace@1"\n');
|
|
64
|
+
await gitExec(repo, ["add", "forge.yaml"]);
|
|
65
|
+
await gitExec(repo, ["commit", "-m", "forge.yaml"]);
|
|
66
|
+
await gitExec(repo, ["branch", "develop", "HEAD"]);
|
|
67
|
+
|
|
68
|
+
const origin = await mkdtemp(join(tmpdir(), "flow-hold-origin-"));
|
|
69
|
+
dirs.push(origin);
|
|
70
|
+
await gitExec(origin, ["init", "--bare", "-b", "develop", "."]);
|
|
71
|
+
await gitExec(repo, ["remote", "add", "origin", origin]);
|
|
72
|
+
await gitExec(repo, ["switch", "develop"]);
|
|
73
|
+
const push = await gitExec(repo, ["push", "-u", "origin", "develop", "main"]);
|
|
74
|
+
if (push.exitCode !== 0) throw new Error(`initial push failed: ${push.stderr}`);
|
|
75
|
+
return { repo, origin };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function openSession(repo: string, slug: string) {
|
|
79
|
+
const data = await openFlowBranch(repo, ambientIo, {
|
|
80
|
+
kind: "session",
|
|
81
|
+
slug,
|
|
82
|
+
brief: null,
|
|
83
|
+
owner: null,
|
|
84
|
+
dryRun: false,
|
|
85
|
+
now: NOW,
|
|
86
|
+
});
|
|
87
|
+
expect(data.diagnostics).toEqual([]);
|
|
88
|
+
dirs.push(data.worktree!);
|
|
89
|
+
return data;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function commitIn(worktree: string, file: string, content: string): Promise<void> {
|
|
93
|
+
await writeFile(join(worktree, file), content);
|
|
94
|
+
await gitExec(worktree, ["add", file]);
|
|
95
|
+
const r = await gitExec(worktree, ["commit", "-m", `add ${file}`]);
|
|
96
|
+
if (r.exitCode !== 0) throw new Error(`commit failed: ${r.stderr}`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function integrate(repo: string, branch: string): Promise<void> {
|
|
100
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
101
|
+
branch,
|
|
102
|
+
dryRun: false,
|
|
103
|
+
now: NOW,
|
|
104
|
+
});
|
|
105
|
+
expect(data.diagnostics).toEqual([]);
|
|
106
|
+
expect(data.integrated).toBe(true);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Two integrated branches: A adds a.txt, B adds b.txt — A below B on the tail. */
|
|
110
|
+
async function twoIntegrated(repo: string): Promise<{
|
|
111
|
+
a: { branch: string; tip: string };
|
|
112
|
+
b: { branch: string; tip: string };
|
|
113
|
+
}> {
|
|
114
|
+
const a = await openSession(repo, "alpha");
|
|
115
|
+
await commitIn(a.worktree!, "a.txt", "a\n");
|
|
116
|
+
const aTip = (await gitExec(a.worktree!, ["rev-parse", "HEAD"])).stdout.trim();
|
|
117
|
+
await integrate(repo, a.branch!);
|
|
118
|
+
|
|
119
|
+
const b = await openSession(repo, "beta");
|
|
120
|
+
await commitIn(b.worktree!, "b.txt", "b\n");
|
|
121
|
+
const bTip = (await gitExec(b.worktree!, ["rev-parse", "HEAD"])).stdout.trim();
|
|
122
|
+
await integrate(repo, b.branch!);
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
a: { branch: a.branch!, tip: aTip },
|
|
126
|
+
b: { branch: b.branch!, tip: bTip },
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function digestItemFor(repo: string, branch: string) {
|
|
131
|
+
const data = await collectDigest(repo, ambientIo, { fetch: false });
|
|
132
|
+
const item = data.items.find((i) => i.branch === branch);
|
|
133
|
+
expect(item).toBeDefined();
|
|
134
|
+
return item!;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
describe("flow.hold", () => {
|
|
138
|
+
it("replays the tail without the held item; held branch keeps A's tip (AC-7, AC-8)", async () => {
|
|
139
|
+
const { repo } = await repoWithOrigin();
|
|
140
|
+
const { a, b } = await twoIntegrated(repo);
|
|
141
|
+
const item = await digestItemFor(repo, a.branch);
|
|
142
|
+
|
|
143
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
144
|
+
item: item.id,
|
|
145
|
+
reason: "not ready",
|
|
146
|
+
dryRun: false,
|
|
147
|
+
now: NOW,
|
|
148
|
+
});
|
|
149
|
+
expect(data.diagnostics).toEqual([]);
|
|
150
|
+
expect(data.held).toBe(true);
|
|
151
|
+
expect(data.branch).toMatch(/^auto\/session-\d{6}-\d{2}-held-alpha$/);
|
|
152
|
+
|
|
153
|
+
// AC-7: develop keeps b.txt, loses a.txt.
|
|
154
|
+
const tree = await gitExec(repo, ["ls-tree", "--name-only", "develop"]);
|
|
155
|
+
expect(tree.stdout).toContain("b.txt");
|
|
156
|
+
expect(tree.stdout).not.toContain("a.txt");
|
|
157
|
+
// The held branch still carries A's work.
|
|
158
|
+
expect((await gitExec(repo, ["rev-parse", data.branch!])).stdout.trim()).toBe(a.tip);
|
|
159
|
+
expect((await gitExec(repo, ["cat-file", "-e", `${data.branch}:a.txt`])).exitCode).toBe(0);
|
|
160
|
+
|
|
161
|
+
// AC-8: registry entry — held.tip = A's tip, worktree null.
|
|
162
|
+
const common = await commonGitDir(ambientIo, repo);
|
|
163
|
+
const registry = await readRegistry(ambientIo, common);
|
|
164
|
+
const held = registry.branches.find((br) => br.name === data.branch);
|
|
165
|
+
expect(held?.held?.tip).toBe(a.tip);
|
|
166
|
+
expect(held?.held?.reason).toBe("not ready");
|
|
167
|
+
expect(held?.held?.riskCategory).toBe("other");
|
|
168
|
+
expect(held?.worktree).toBeNull();
|
|
169
|
+
|
|
170
|
+
// The next digest still attributes B through the journal rewrites.
|
|
171
|
+
const after = await collectDigest(repo, ambientIo, { fetch: false });
|
|
172
|
+
const bItem = after.items.find((i) => i.branch === b.branch);
|
|
173
|
+
expect(bItem).toBeDefined();
|
|
174
|
+
expect(bItem!.kind).toBe("integration");
|
|
175
|
+
// And A is gone from the tail.
|
|
176
|
+
expect(after.items.find((i) => i.branch === a.branch)).toBeUndefined();
|
|
177
|
+
expect(after.held.map((h) => h.branch)).toContain(data.branch);
|
|
178
|
+
}, 90_000);
|
|
179
|
+
|
|
180
|
+
it("--dry-run never fetches — remote-tracking refs stay unchanged (RFC-1501)", async () => {
|
|
181
|
+
const { repo, origin } = await repoWithOrigin();
|
|
182
|
+
const { a } = await twoIntegrated(repo);
|
|
183
|
+
const item = await digestItemFor(repo, a.branch);
|
|
184
|
+
// origin gains a commit after the repository's last fetch.
|
|
185
|
+
const other = await mkdtemp(join(tmpdir(), "flow-hold-other-"));
|
|
186
|
+
dirs.push(other);
|
|
187
|
+
expect((await gitExec(other, ["clone", "-q", "-b", "develop", origin, "."])).exitCode).toBe(0);
|
|
188
|
+
await gitExec(other, ["config", "user.email", "flow-test@example.invalid"]);
|
|
189
|
+
await gitExec(other, ["config", "user.name", "flow-test"]);
|
|
190
|
+
await commitIn(other, "foreign.txt", "f\n");
|
|
191
|
+
expect((await gitExec(other, ["push", "-q", "origin", "develop"])).exitCode).toBe(0);
|
|
192
|
+
|
|
193
|
+
const tracking = async () =>
|
|
194
|
+
(await gitExec(repo, ["for-each-ref", "--format=%(refname) %(objectname)", "refs/remotes"]))
|
|
195
|
+
.stdout;
|
|
196
|
+
const before = await tracking();
|
|
197
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
198
|
+
item: item.id,
|
|
199
|
+
reason: "dry-run probe",
|
|
200
|
+
dryRun: true,
|
|
201
|
+
now: NOW,
|
|
202
|
+
});
|
|
203
|
+
expect(data.diagnostics).toEqual([]);
|
|
204
|
+
expect(await tracking()).toBe(before);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("holds the topmost item — empty tail above it — by resetting develop to its base", async () => {
|
|
208
|
+
const { repo } = await repoWithOrigin();
|
|
209
|
+
const { b } = await twoIntegrated(repo);
|
|
210
|
+
const item = await digestItemFor(repo, b.branch);
|
|
211
|
+
|
|
212
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
213
|
+
item: item.id,
|
|
214
|
+
reason: "top of the tail",
|
|
215
|
+
dryRun: false,
|
|
216
|
+
now: NOW,
|
|
217
|
+
});
|
|
218
|
+
expect(data.diagnostics).toEqual([]);
|
|
219
|
+
expect(data.held).toBe(true);
|
|
220
|
+
expect(data.rewrites).toEqual([]);
|
|
221
|
+
expect((await gitExec(repo, ["rev-parse", "develop"])).stdout.trim()).toBe(item.base);
|
|
222
|
+
expect((await gitExec(repo, ["rev-parse", data.branch!])).stdout.trim()).toBe(b.tip);
|
|
223
|
+
}, 90_000);
|
|
224
|
+
|
|
225
|
+
it("refuses FLOW-HOLD-02 when a local release tag sits above the item (AC-9)", async () => {
|
|
226
|
+
const { repo } = await repoWithOrigin();
|
|
227
|
+
const { a } = await twoIntegrated(repo);
|
|
228
|
+
const tip = (await gitExec(repo, ["rev-parse", "develop"])).stdout.trim();
|
|
229
|
+
await writeReleaseTag(repo, ambientIo, {
|
|
230
|
+
name: "v0.2.0",
|
|
231
|
+
target: tip,
|
|
232
|
+
annotation: releaseTagAnnotation({
|
|
233
|
+
tag: "v0.2.0",
|
|
234
|
+
line: "repo",
|
|
235
|
+
version: "0.2.0",
|
|
236
|
+
level: "minor",
|
|
237
|
+
previous: "v0.1.0",
|
|
238
|
+
rfcs: [],
|
|
239
|
+
fingerprints: {},
|
|
240
|
+
}),
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
const item = await digestItemFor(repo, a.branch);
|
|
244
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
245
|
+
item: item.id,
|
|
246
|
+
reason: "late",
|
|
247
|
+
dryRun: false,
|
|
248
|
+
now: NOW,
|
|
249
|
+
});
|
|
250
|
+
expect(data.held).toBe(false);
|
|
251
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-02");
|
|
252
|
+
expect(data.diagnostics[0]?.message).toContain("v0.2.0");
|
|
253
|
+
}, 90_000);
|
|
254
|
+
|
|
255
|
+
it("refuses FLOW-HOLD-03 while an open branch is based above the item", async () => {
|
|
256
|
+
const { repo } = await repoWithOrigin();
|
|
257
|
+
const { a } = await twoIntegrated(repo);
|
|
258
|
+
// Session C opens now — its baseSha is the current develop tip, above A's base.
|
|
259
|
+
const c = await openSession(repo, "gamma");
|
|
260
|
+
const item = await digestItemFor(repo, a.branch);
|
|
261
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
262
|
+
item: item.id,
|
|
263
|
+
reason: "late",
|
|
264
|
+
dryRun: false,
|
|
265
|
+
now: NOW,
|
|
266
|
+
});
|
|
267
|
+
expect(data.held).toBe(false);
|
|
268
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-03");
|
|
269
|
+
expect(data.diagnostics[0]?.message).toContain(c.branch);
|
|
270
|
+
}, 90_000);
|
|
271
|
+
|
|
272
|
+
it("refuses FLOW-HOLD-07 on a replay conflict — tree and refs unchanged", async () => {
|
|
273
|
+
const { repo } = await repoWithOrigin();
|
|
274
|
+
// A creates a.txt; B edits the same file — B cannot apply without A.
|
|
275
|
+
const a = await openSession(repo, "alpha");
|
|
276
|
+
await commitIn(a.worktree!, "a.txt", "from A\n");
|
|
277
|
+
const aTip = (await gitExec(a.worktree!, ["rev-parse", "HEAD"])).stdout.trim();
|
|
278
|
+
await integrate(repo, a.branch!);
|
|
279
|
+
|
|
280
|
+
const b = await openSession(repo, "beta");
|
|
281
|
+
await commitIn(b.worktree!, "a.txt", "from B — needs A\n");
|
|
282
|
+
await integrate(repo, b.branch!);
|
|
283
|
+
|
|
284
|
+
const developBefore = (await gitExec(repo, ["rev-parse", "develop"])).stdout.trim();
|
|
285
|
+
const item = await digestItemFor(repo, a.branch!);
|
|
286
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
287
|
+
item: item.id,
|
|
288
|
+
reason: "conflict probe",
|
|
289
|
+
dryRun: false,
|
|
290
|
+
now: NOW,
|
|
291
|
+
});
|
|
292
|
+
expect(data.held).toBe(false);
|
|
293
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-07");
|
|
294
|
+
expect(data.diagnostics[0]?.message).toContain("a.txt");
|
|
295
|
+
|
|
296
|
+
// Nothing moved — develop, the branches and the tree are unchanged.
|
|
297
|
+
expect((await gitExec(repo, ["rev-parse", "develop"])).stdout.trim()).toBe(developBefore);
|
|
298
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:a.txt"])).exitCode).toBe(0);
|
|
299
|
+
const common = await commonGitDir(ambientIo, repo);
|
|
300
|
+
const registry = await readRegistry(ambientIo, common);
|
|
301
|
+
expect(registry.branches.every((br) => br.held === null)).toBe(true);
|
|
302
|
+
expect(await gitExec(repo, ["worktree", "list"])).toMatchObject({ exitCode: 0 });
|
|
303
|
+
expect((await gitExec(repo, ["worktree", "list"])).stdout).not.toContain("hold-worktree");
|
|
304
|
+
void aTip;
|
|
305
|
+
}, 90_000);
|
|
306
|
+
|
|
307
|
+
it("refuses FLOW-HOLD-04 while the primary checkout is dirty", async () => {
|
|
308
|
+
const { repo } = await repoWithOrigin();
|
|
309
|
+
const { a } = await twoIntegrated(repo);
|
|
310
|
+
// A tracked modification — `reset --keep` refuses on it, so HOLD-04 does.
|
|
311
|
+
await writeFile(join(repo, "forge.yaml"), 'schema: "forge/workspace@1"\ndirty: true\n');
|
|
312
|
+
|
|
313
|
+
const item = await digestItemFor(repo, a.branch);
|
|
314
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
315
|
+
item: item.id,
|
|
316
|
+
reason: "dirty probe",
|
|
317
|
+
dryRun: false,
|
|
318
|
+
now: NOW,
|
|
319
|
+
});
|
|
320
|
+
expect(data.held).toBe(false);
|
|
321
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-04");
|
|
322
|
+
}, 90_000);
|
|
323
|
+
|
|
324
|
+
it("refuses FLOW-HOLD-05 on an unattributed item", async () => {
|
|
325
|
+
const { repo } = await repoWithOrigin();
|
|
326
|
+
const { a } = await twoIntegrated(repo);
|
|
327
|
+
// A direct develop commit has no journal record — unattributed tail.
|
|
328
|
+
await writeFile(join(repo, "loose.txt"), "loose\n");
|
|
329
|
+
await gitExec(repo, ["add", "loose.txt"]);
|
|
330
|
+
await gitExec(repo, ["commit", "-m", "unattributed"]);
|
|
331
|
+
|
|
332
|
+
const digest = await collectDigest(repo, ambientIo, { fetch: false });
|
|
333
|
+
const unattributed = digest.items.find((i) => i.kind === "unattributed");
|
|
334
|
+
expect(unattributed).toBeDefined();
|
|
335
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
336
|
+
item: unattributed!.id,
|
|
337
|
+
reason: "kind probe",
|
|
338
|
+
dryRun: false,
|
|
339
|
+
now: NOW,
|
|
340
|
+
});
|
|
341
|
+
expect(data.held).toBe(false);
|
|
342
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-05");
|
|
343
|
+
void a;
|
|
344
|
+
}, 90_000);
|
|
345
|
+
|
|
346
|
+
it("refuses FLOW-HOLD-06 while a merge commit sits above the item", async () => {
|
|
347
|
+
const { repo } = await repoWithOrigin();
|
|
348
|
+
const { a } = await twoIntegrated(repo);
|
|
349
|
+
// A merge commit on develop above B — replay cannot reorder it.
|
|
350
|
+
await gitExec(repo, ["switch", "-c", "tmp-merge", "develop~1"]);
|
|
351
|
+
await writeFile(join(repo, "merge-side.txt"), "side\n");
|
|
352
|
+
await gitExec(repo, ["add", "merge-side.txt"]);
|
|
353
|
+
await gitExec(repo, ["commit", "-m", "merge side"]);
|
|
354
|
+
await gitExec(repo, ["switch", "develop"]);
|
|
355
|
+
await gitExec(repo, ["merge", "--no-ff", "-m", "merge tmp", "tmp-merge"]);
|
|
356
|
+
|
|
357
|
+
const item = await digestItemFor(repo, a.branch);
|
|
358
|
+
const data = await holdFlowItem(repo, ambientIo, {
|
|
359
|
+
item: item.id,
|
|
360
|
+
reason: "merge probe",
|
|
361
|
+
dryRun: false,
|
|
362
|
+
now: NOW,
|
|
363
|
+
});
|
|
364
|
+
expect(data.held).toBe(false);
|
|
365
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-06");
|
|
366
|
+
}, 90_000);
|
|
367
|
+
|
|
368
|
+
it("integrate on a held branch refuses FLOW-INT-11", async () => {
|
|
369
|
+
const { repo } = await repoWithOrigin();
|
|
370
|
+
const { a } = await twoIntegrated(repo);
|
|
371
|
+
const item = await digestItemFor(repo, a.branch);
|
|
372
|
+
const held = await holdFlowItem(repo, ambientIo, {
|
|
373
|
+
item: item.id,
|
|
374
|
+
reason: "pause",
|
|
375
|
+
dryRun: false,
|
|
376
|
+
now: NOW,
|
|
377
|
+
});
|
|
378
|
+
expect(held.held).toBe(true);
|
|
379
|
+
|
|
380
|
+
const integrated = await integrateFlowBranch(repo, ambientIo, {
|
|
381
|
+
branch: held.branch!,
|
|
382
|
+
dryRun: false,
|
|
383
|
+
now: NOW,
|
|
384
|
+
});
|
|
385
|
+
expect(integrated.integrated).toBe(false);
|
|
386
|
+
expect(integrated.diagnostics[0]?.ruleId).toBe("FLOW-INT-11");
|
|
387
|
+
expect(integrated.diagnostics[0]?.message).toContain("pause");
|
|
388
|
+
}, 120_000);
|
|
389
|
+
|
|
390
|
+
it("unhold recreates the worktree and integrate lands A again", async () => {
|
|
391
|
+
const { repo } = await repoWithOrigin();
|
|
392
|
+
const { a } = await twoIntegrated(repo);
|
|
393
|
+
const item = await digestItemFor(repo, a.branch);
|
|
394
|
+
const held = await holdFlowItem(repo, ambientIo, {
|
|
395
|
+
item: item.id,
|
|
396
|
+
reason: "pause",
|
|
397
|
+
dryRun: false,
|
|
398
|
+
now: NOW,
|
|
399
|
+
});
|
|
400
|
+
expect(held.held).toBe(true);
|
|
401
|
+
|
|
402
|
+
const unheld = await unholdFlowBranch(repo, ambientIo, {
|
|
403
|
+
branch: held.branch!,
|
|
404
|
+
dryRun: false,
|
|
405
|
+
now: NOW,
|
|
406
|
+
});
|
|
407
|
+
expect(unheld.diagnostics).toEqual([]);
|
|
408
|
+
expect(unheld.unheld).toBe(true);
|
|
409
|
+
expect(unheld.worktree).not.toBeNull();
|
|
410
|
+
dirs.push(unheld.worktree!);
|
|
411
|
+
|
|
412
|
+
const common = await commonGitDir(ambientIo, repo);
|
|
413
|
+
const registry = await readRegistry(ambientIo, common);
|
|
414
|
+
const entry = registry.branches.find((br) => br.name === held.branch);
|
|
415
|
+
expect(entry?.held).toBeNull();
|
|
416
|
+
expect(entry?.worktree).toBe(unheld.worktree);
|
|
417
|
+
|
|
418
|
+
// Integrating the unheld branch brings a.txt back.
|
|
419
|
+
const integrated = await integrateFlowBranch(repo, ambientIo, {
|
|
420
|
+
branch: held.branch!,
|
|
421
|
+
dryRun: false,
|
|
422
|
+
now: NOW,
|
|
423
|
+
});
|
|
424
|
+
expect(integrated.diagnostics).toEqual([]);
|
|
425
|
+
expect(integrated.integrated).toBe(true);
|
|
426
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:a.txt"])).exitCode).toBe(0);
|
|
427
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:b.txt"])).exitCode).toBe(0);
|
|
428
|
+
}, 120_000);
|
|
429
|
+
|
|
430
|
+
it("refuses FLOW-HOLD-08 on an unheld or unknown branch", async () => {
|
|
431
|
+
const { repo } = await repoWithOrigin();
|
|
432
|
+
const a = await openSession(repo, "alpha");
|
|
433
|
+
const unheld = await unholdFlowBranch(repo, ambientIo, {
|
|
434
|
+
branch: a.branch!,
|
|
435
|
+
dryRun: false,
|
|
436
|
+
now: NOW,
|
|
437
|
+
});
|
|
438
|
+
expect(unheld.unheld).toBe(false);
|
|
439
|
+
expect(unheld.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-08");
|
|
440
|
+
|
|
441
|
+
const missing = await unholdFlowBranch(repo, ambientIo, {
|
|
442
|
+
branch: "auto/session-260101-99-nope",
|
|
443
|
+
dryRun: false,
|
|
444
|
+
now: NOW,
|
|
445
|
+
});
|
|
446
|
+
expect(missing.diagnostics[0]?.ruleId).toBe("FLOW-HOLD-08");
|
|
447
|
+
}, 60_000);
|
|
448
|
+
|
|
449
|
+
it("heldBranchName truncates a 48-char slug to held-<43> and drops a dangling dash", async () => {
|
|
450
|
+
const slug48 = "a".repeat(48);
|
|
451
|
+
const name = heldBranchName(
|
|
452
|
+
`auto/session-261102-03-${slug48}`,
|
|
453
|
+
[],
|
|
454
|
+
NOW,
|
|
455
|
+
);
|
|
456
|
+
expect(name).toBe(`auto/session-261102-01-held-${"a".repeat(43)}`);
|
|
457
|
+
const parsed = (await import("../branch-name.ts")).parseFlowBranch(name!);
|
|
458
|
+
expect(parsed?.slug).toHaveLength(48);
|
|
459
|
+
|
|
460
|
+
const slugDash = `${"b".repeat(42)}-tail`; // char 43 is '-'
|
|
461
|
+
expect(slugDash[42]).toBe("-");
|
|
462
|
+
const dashed = heldBranchName(`auto/task-261102-02-${slugDash}`, [], NOW);
|
|
463
|
+
expect(dashed).toBe(`auto/task-261102-01-held-${"b".repeat(42)}`);
|
|
464
|
+
});
|
|
465
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.install baseline rerun identity (RFC-1488: AC-6): after the
|
|
4
|
+
first run created the baseline tags, a second run must leave the repository's
|
|
5
|
+
tag set byte-identical — every line's version file already equals its last
|
|
6
|
+
tag, so the tags step skips.</purpose>
|
|
7
|
+
<non-goals>
|
|
8
|
+
<item>No first-run coverage — flow-install-baseline.test.ts owns it.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<CHANGE_SUMMARY>
|
|
12
|
+
<item>RFC-1488: step 5 — baseline rerun identity test</item>
|
|
13
|
+
<item>RFC-1488: steps 5-6 — flow.install baseline tags step, flow.check FLOW-08/FLOW-09</item>
|
|
14
|
+
<item>RFC-1488: AC-6 rerun timeout, AC-8 'release line' wording</item>
|
|
15
|
+
<item>RFC-1488: review r1 — parse guard, door/rules metadata, id-exact RFC binding, refname precision, FLOW-09 top-level anchor, test cleanup</item>
|
|
16
|
+
</CHANGE_SUMMARY>
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
|
|
22
|
+
import { afterEach, expect, it } from "vitest";
|
|
23
|
+
|
|
24
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
25
|
+
import { executeInstall, planInstall } from "../handlers/flow-install.ts";
|
|
26
|
+
import { gitExec, initRepo } from "./helpers.ts";
|
|
27
|
+
|
|
28
|
+
const dirs: string[] = [];
|
|
29
|
+
|
|
30
|
+
afterEach(async () => {
|
|
31
|
+
for (const dir of dirs.splice(0)) {
|
|
32
|
+
await rm(dir, { recursive: true, force: true });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
async function listTagsWithObjects(repo: string): Promise<string> {
|
|
37
|
+
const r = await gitExec(repo, [
|
|
38
|
+
"for-each-ref",
|
|
39
|
+
"refs/tags",
|
|
40
|
+
"--format=%(refname) %(objectname) %(*objectname)",
|
|
41
|
+
]);
|
|
42
|
+
return r.stdout.trim().split("\n").sort().join("\n");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Two full plan+execute cycles exceed the repo-root vitest default (5s).
|
|
46
|
+
it("AC-6: a second flow.install leaves the tag set identical", { timeout: 30000 }, async () => {
|
|
47
|
+
const repo = await initRepo({ prefix: "flow-rerun-" });
|
|
48
|
+
dirs.push(repo);
|
|
49
|
+
await mkdir(join(repo, "packages/pbp"), { recursive: true });
|
|
50
|
+
await writeFile(join(repo, "pnpm-workspace.yaml"), "packages:\n - 'packages/*'\n");
|
|
51
|
+
await writeFile(join(repo, "packages/pbp/extract.config.yaml"), "forgePlugin: false\n");
|
|
52
|
+
await writeFile(join(repo, "packages/pbp/package.json"), '{ "version": "2.1.0" }\n');
|
|
53
|
+
await writeFile(join(repo, "package.json"), '{ "version": "1.0.0" }\n');
|
|
54
|
+
await writeFile(join(repo, "forge.yaml"), "name: test\n");
|
|
55
|
+
await gitExec(repo, ["add", "."]);
|
|
56
|
+
await gitExec(repo, ["commit", "-m", "versions"]);
|
|
57
|
+
|
|
58
|
+
const first = await planInstall(repo, ambientIo);
|
|
59
|
+
expect(first.refusal).toBeNull();
|
|
60
|
+
await executeInstall(first, ambientIo);
|
|
61
|
+
const tagsAfterFirst = await listTagsWithObjects(repo);
|
|
62
|
+
expect(tagsAfterFirst).toContain("refs/tags/v1.0.0");
|
|
63
|
+
expect(tagsAfterFirst).toContain("refs/tags/pbp@2.1.0");
|
|
64
|
+
|
|
65
|
+
// Second run — same repo, same plan approval path.
|
|
66
|
+
const second = await planInstall(repo, ambientIo);
|
|
67
|
+
expect(second.refusal).toBeNull();
|
|
68
|
+
expect(second.tagPlans).toEqual([]);
|
|
69
|
+
expect(second.steps.find((s) => s.step === "tags")?.detail).toContain("no baseline tags");
|
|
70
|
+
await executeInstall(second, ambientIo);
|
|
71
|
+
|
|
72
|
+
expect(await listTagsWithObjects(repo)).toBe(tagsAfterFirst);
|
|
73
|
+
});
|