@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,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Pending-level tests (RFC-1488: AC-3): commits carrying X-RFC
|
|
4
|
+
trailers are resolved through the canonical RFC reader against the temp
|
|
5
|
+
repo's docs/rfcs, the highest declared versionBump wins, missing bumps fall
|
|
6
|
+
back to patch, and a missing RFC file reports FLOW-VER-03 while still
|
|
7
|
+
counting patch.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No tag selection — flow-version.test.ts owns the derived-version math.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1488: step 4 — pending-level tests (X-RFC + versionBump)</item>
|
|
14
|
+
<item>RFC-1488: steps 2-4 — release tags, pending level (X-RFC + versionBump), flow.version command</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, describe, expect, it } from "vitest";
|
|
23
|
+
|
|
24
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
25
|
+
import { collectFlowVersion } from "../handlers/flow-version.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 rfc(repo: string, id: string, versionBump: string): Promise<void> {
|
|
37
|
+
const file = `docs/rfcs/${id.toLowerCase()}-test.md`;
|
|
38
|
+
await mkdir(join(repo, "docs/rfcs"), { recursive: true });
|
|
39
|
+
await writeFile(
|
|
40
|
+
join(repo, file),
|
|
41
|
+
`---\nid: ${id}\ntitle: test\nstatus: accepted\nversionBump: ${versionBump}\n---\n\n# ${id}\n`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function commitWithTrailer(repo: string, message: string, rfcId: string | null): Promise<void> {
|
|
46
|
+
const args = ["commit", "--allow-empty", "-m", message];
|
|
47
|
+
if (rfcId !== null) args.push("--trailer", `X-RFC: ${rfcId}`);
|
|
48
|
+
const result = await gitExec(repo, args);
|
|
49
|
+
if (result.exitCode !== 0) throw new Error(`commit failed: ${result.stderr}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function repoWithTag(): Promise<string> {
|
|
53
|
+
const repo = await initRepo({ prefix: "flow-lvl-" });
|
|
54
|
+
dirs.push(repo);
|
|
55
|
+
await writeFile(join(repo, "package.json"), '{ "version": "1.0.0" }\n');
|
|
56
|
+
await gitExec(repo, ["add", "package.json"]);
|
|
57
|
+
await gitExec(repo, ["commit", "-m", "version 1.0.0"]);
|
|
58
|
+
const tag = await gitExec(repo, ["tag", "-a", "v1.0.0", "-m", "release v1.0.0"]);
|
|
59
|
+
if (tag.exitCode !== 0) throw new Error(tag.stderr);
|
|
60
|
+
return repo;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
describe("pending level via flow.version", () => {
|
|
64
|
+
it("AC-3: patch + minor trailers report level minor and the bumped nextVersion", async () => {
|
|
65
|
+
const repo = await repoWithTag();
|
|
66
|
+
await rfc(repo, "RFC-1486", "patch");
|
|
67
|
+
await rfc(repo, "RFC-1488", "minor");
|
|
68
|
+
await gitExec(repo, ["add", "docs/rfcs"]);
|
|
69
|
+
await gitExec(repo, ["commit", "-m", "rfcs"]);
|
|
70
|
+
await commitWithTrailer(repo, "patch change", "RFC-1486");
|
|
71
|
+
await commitWithTrailer(repo, "minor change", "RFC-1488");
|
|
72
|
+
|
|
73
|
+
const { data, diagnostics } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
74
|
+
expect(diagnostics.filter((d) => d.severity === "error")).toEqual([]);
|
|
75
|
+
const line = data.lines[0];
|
|
76
|
+
expect(line?.level).toBe("minor");
|
|
77
|
+
expect(line?.nextVersion).toBe("1.1.0");
|
|
78
|
+
expect(line?.rfcs).toEqual([
|
|
79
|
+
{ id: "RFC-1486", versionBump: "patch" },
|
|
80
|
+
{ id: "RFC-1488", versionBump: "minor" },
|
|
81
|
+
]);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("commits without usable trailers fall back to patch", async () => {
|
|
85
|
+
const repo = await repoWithTag();
|
|
86
|
+
await commitWithTrailer(repo, "no trailer", null);
|
|
87
|
+
|
|
88
|
+
const { data } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
89
|
+
expect(data.lines[0]?.level).toBe("patch");
|
|
90
|
+
expect(data.lines[0]?.nextVersion).toBe("1.0.1");
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("a major trailer beats minor and patch", async () => {
|
|
94
|
+
const repo = await repoWithTag();
|
|
95
|
+
await rfc(repo, "RFC-1400", "major");
|
|
96
|
+
await gitExec(repo, ["add", "docs/rfcs"]);
|
|
97
|
+
await gitExec(repo, ["commit", "-m", "rfcs"]);
|
|
98
|
+
await commitWithTrailer(repo, "breaking", "RFC-1400");
|
|
99
|
+
|
|
100
|
+
const { data } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
101
|
+
expect(data.lines[0]?.level).toBe("major");
|
|
102
|
+
expect(data.lines[0]?.nextVersion).toBe("2.0.0");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("a trailer naming a missing RFC warns FLOW-VER-03 and still counts patch", async () => {
|
|
106
|
+
const repo = await repoWithTag();
|
|
107
|
+
await commitWithTrailer(repo, "ghost", "RFC-9999");
|
|
108
|
+
|
|
109
|
+
const { data, diagnostics } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
110
|
+
const ver03 = diagnostics.filter((d) => d.ruleId === "FLOW-VER-03");
|
|
111
|
+
expect(ver03).toHaveLength(1);
|
|
112
|
+
expect(ver03[0]?.message).toContain("RFC-9999");
|
|
113
|
+
expect(data.lines[0]?.level).toBe("patch");
|
|
114
|
+
expect(data.lines[0]?.rfcs).toEqual([{ id: "RFC-9999", versionBump: null }]);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.version behavior tests (RFC-1488: AC-1, AC-2, AC-4 plus
|
|
4
|
+
FLOW-VER-01/04): annotated baseline tags in throwaway repos anchor the
|
|
5
|
+
derived version `X.Y.Z+N.<head9>`, per-line path filtering counts
|
|
6
|
+
commits correctly, a clean line at its tag reports `none`, and the
|
|
7
|
+
diagnostics surface reports missing baselines and unknown --line ids.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No level math — flow-version-level.test.ts owns AC-3.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1488: step 4 — flow.version tests</item>
|
|
14
|
+
<item>RFC-1488: steps 2-4 — release tags, pending level (X-RFC + versionBump), flow.version command</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
|
+
<item>RFC-1490: step 1 — explicit ref param on tag/level helpers + W1-2 +0.<hash>.dirty shape (AC-12)</item>
|
|
17
|
+
</CHANGE_SUMMARY>
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
21
|
+
import { join } from "node:path";
|
|
22
|
+
|
|
23
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
24
|
+
|
|
25
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
26
|
+
import { collectFlowVersion } from "../handlers/flow-version.ts";
|
|
27
|
+
import { gitExec, initRepo } from "./helpers.ts";
|
|
28
|
+
|
|
29
|
+
const dirs: string[] = [];
|
|
30
|
+
|
|
31
|
+
afterEach(async () => {
|
|
32
|
+
for (const dir of dirs.splice(0)) {
|
|
33
|
+
await rm(dir, { recursive: true, force: true });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
async function writeAndCommit(repo: string, file: string, content: string, message = "c"): Promise<void> {
|
|
38
|
+
await mkdir(join(repo, file.split("/").slice(0, -1).join("/")), { recursive: true });
|
|
39
|
+
await writeFile(join(repo, file), content);
|
|
40
|
+
await gitExec(repo, ["add", file]);
|
|
41
|
+
const result = await gitExec(repo, ["commit", "-m", message]);
|
|
42
|
+
if (result.exitCode !== 0) throw new Error(`commit failed: ${result.stderr}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function annotatedTag(repo: string, name: string, at?: string): Promise<void> {
|
|
46
|
+
const args = ["tag", "-a", name, "-m", `release ${name}\n\nschema: forge/release-tag@1\nline: repo\nversion: ${name.replace(/^v|^[^@]*@/, "")}\nlevel: baseline\nprevious: null\nrfcs: []\nfingerprints: {}`];
|
|
47
|
+
if (at !== undefined) args.push(at);
|
|
48
|
+
const result = await gitExec(repo, args);
|
|
49
|
+
if (result.exitCode !== 0) throw new Error(`tag ${name} failed: ${result.stderr}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function repoWithRootVersion(version: string): Promise<string> {
|
|
53
|
+
const repo = await initRepo({ prefix: "flow-ver-" });
|
|
54
|
+
dirs.push(repo);
|
|
55
|
+
await writeAndCommit(repo, "package.json", `{ "version": "${version}" }\n`, `version ${version}`);
|
|
56
|
+
return repo;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
describe("collectFlowVersion", () => {
|
|
60
|
+
it("AC-1: HEAD three commits after v1.2.0 reports derived 1.2.0+3.<head9>", async () => {
|
|
61
|
+
const repo = await repoWithRootVersion("1.2.0");
|
|
62
|
+
await annotatedTag(repo, "v1.2.0");
|
|
63
|
+
for (let i = 0; i < 3; i += 1) {
|
|
64
|
+
await writeAndCommit(repo, `file-${i}.txt`, `${i}\n`, `post ${i}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const { data, diagnostics } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
68
|
+
expect(diagnostics.filter((d) => d.severity === "error")).toEqual([]);
|
|
69
|
+
const line = data.lines[0];
|
|
70
|
+
expect(line?.id).toBe("repo");
|
|
71
|
+
expect(line?.lastTag).toBe("v1.2.0");
|
|
72
|
+
expect(line?.lastVersion).toBe("1.2.0");
|
|
73
|
+
expect(line?.commitsSince).toBe(3);
|
|
74
|
+
expect(line?.dirty).toBe(false);
|
|
75
|
+
expect(line?.derived).toBe(`1.2.0+3.${line.head}`);
|
|
76
|
+
expect(line?.head).toHaveLength(9);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("AC-2: only commits under the package line's paths count toward commitsSince", async () => {
|
|
80
|
+
const repo = await repoWithRootVersion("1.0.0");
|
|
81
|
+
await mkdir(join(repo, "packages/forge"), { recursive: true });
|
|
82
|
+
await writeFile(join(repo, "pnpm-workspace.yaml"), "packages:\n - 'packages/*'\n");
|
|
83
|
+
await writeFile(join(repo, "packages/forge/package.json"), '{ "version": "9.0.0" }\n');
|
|
84
|
+
await writeFile(join(repo, "packages/forge/extract.config.yaml"), "forgePlugin: true\n");
|
|
85
|
+
await writeAndCommit(repo, "x.txt", "x\n", "workspace");
|
|
86
|
+
await annotatedTag(repo, "forge@9.0.0");
|
|
87
|
+
|
|
88
|
+
for (let i = 0; i < 5; i += 1) {
|
|
89
|
+
if (i < 2) {
|
|
90
|
+
await writeAndCommit(repo, `packages/forge/f${i}.ts`, `${i}\n`, `forge ${i}`);
|
|
91
|
+
} else {
|
|
92
|
+
await writeAndCommit(repo, `root-${i}.txt`, `${i}\n`, `root ${i}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const { data } = await collectFlowVersion(repo, ambientIo, "forge");
|
|
97
|
+
const line = data.lines[0];
|
|
98
|
+
expect(line?.id).toBe("forge");
|
|
99
|
+
expect(line?.lastTag).toBe("forge@9.0.0");
|
|
100
|
+
expect(line?.commitsSince).toBe(2);
|
|
101
|
+
expect(line?.derived).toBe(`9.0.0+2.${line.head}`);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("AC-4: a line with no commits since its tag reports none and the tag version", async () => {
|
|
105
|
+
const repo = await repoWithRootVersion("1.2.0");
|
|
106
|
+
await annotatedTag(repo, "v1.2.0");
|
|
107
|
+
|
|
108
|
+
const { data } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
109
|
+
const line = data.lines[0];
|
|
110
|
+
expect(line?.commitsSince).toBe(0);
|
|
111
|
+
expect(line?.level).toBe("none");
|
|
112
|
+
expect(line?.derived).toBe("1.2.0");
|
|
113
|
+
expect(line?.nextVersion).toBeNull();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("untagged line reports derived null and FLOW-VER-01 pointing at flow.install", async () => {
|
|
117
|
+
const repo = await repoWithRootVersion("1.0.0");
|
|
118
|
+
const { data, diagnostics } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
119
|
+
const line = data.lines[0];
|
|
120
|
+
expect(line?.derived).toBeNull();
|
|
121
|
+
expect(line?.lastTag).toBeNull();
|
|
122
|
+
expect(line?.level).toBe("patch"); // commits exist on the line, nothing tagged yet
|
|
123
|
+
const ver01 = diagnostics.filter((d) => d.ruleId === "FLOW-VER-01");
|
|
124
|
+
expect(ver01).toHaveLength(1);
|
|
125
|
+
expect(ver01[0]?.message).toContain("flow.install");
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("unknown --line id fails with FLOW-VER-04 listing known lines", async () => {
|
|
129
|
+
const repo = await repoWithRootVersion("1.0.0");
|
|
130
|
+
const { data, diagnostics } = await collectFlowVersion(repo, ambientIo, "nope");
|
|
131
|
+
expect(data.lines).toEqual([]);
|
|
132
|
+
const ver04 = diagnostics.filter((d) => d.ruleId === "FLOW-VER-04");
|
|
133
|
+
expect(ver04).toHaveLength(1);
|
|
134
|
+
expect(ver04[0]?.severity).toBe("error");
|
|
135
|
+
expect(ver04[0]?.message).toContain("repo");
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it("tracked modification inside the line's paths marks the line dirty", async () => {
|
|
139
|
+
const repo = await repoWithRootVersion("1.2.0");
|
|
140
|
+
await annotatedTag(repo, "v1.2.0");
|
|
141
|
+
await writeFile(join(repo, "package.json"), '{ "version": "1.2.0" } // dirty\n');
|
|
142
|
+
|
|
143
|
+
const { data } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
144
|
+
expect(data.lines[0]?.dirty).toBe(true);
|
|
145
|
+
expect(data.lines[0]?.derived).toMatch(/^1\.2\.0\+0\.[0-9a-f]{9}\.dirty$/);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("listLineTags with an explicit ref resolves tags on that ref, not HEAD", async () => {
|
|
149
|
+
const repo = await repoWithRootVersion("1.2.0");
|
|
150
|
+
await annotatedTag(repo, "v1.2.0");
|
|
151
|
+
await gitExec(repo, ["checkout", "-b", "side"]);
|
|
152
|
+
await gitExec(repo, ["commit", "--allow-empty", "-m", "side"]);
|
|
153
|
+
const { discoverReleaseLines } = await import("../release-lines.ts");
|
|
154
|
+
const { listLineTags } = await import("../release-tags.ts");
|
|
155
|
+
const { lines } = await discoverReleaseLines(repo, ambientIo);
|
|
156
|
+
const tags = await listLineTags(repo, lines[0]!, ambientIo, "main");
|
|
157
|
+
expect(tags.lastTag?.name).toBe("v1.2.0");
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("lightweight tags never anchor a line", async () => {
|
|
161
|
+
const repo = await repoWithRootVersion("1.2.0");
|
|
162
|
+
const lw = await gitExec(repo, ["tag", "v0.9.0"]);
|
|
163
|
+
if (lw.exitCode !== 0) throw new Error(lw.stderr);
|
|
164
|
+
await annotatedTag(repo, "v1.2.0");
|
|
165
|
+
|
|
166
|
+
const { data } = await collectFlowVersion(repo, ambientIo, "repo");
|
|
167
|
+
expect(data.lines[0]?.lastTag).toBe("v1.2.0");
|
|
168
|
+
});
|
|
169
|
+
});
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Throwaway-repository scaffolding for os/flow tests (RFC-1486): every
|
|
4
|
+
git command runs inside a fresh repo under the OS temp dir — never against the
|
|
5
|
+
enclosing workspace — and the guard hook is installed exactly the way
|
|
6
|
+
flow.install does it (committed hooks dir + core.hooksPath).</purpose>
|
|
7
|
+
<non-goals>
|
|
8
|
+
<item>No production code — test scaffolding only.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<KEY_DECISIONS>
|
|
12
|
+
<item>Hooks live in <repo>/hooks (committed), never .git/hooks — worktrees check out committed content (AUDIT-RFC-1486-G1).</item>
|
|
13
|
+
<item>FORGE_FLOW_OP is always set explicitly ("" for the unset cases) so a leaked outer value cannot make tests non-deterministic.</item>
|
|
14
|
+
</KEY_DECISIONS>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-1486: review r1 — committed-state adoption gate, uncommitted-hook committedness, step-failure trail, idempotency declaration, lazy asset resolution</item>
|
|
17
|
+
<item>RFC-1490: pre-merge-commit guard mode + per-mode op vocabulary; amends the wave-1 guard RFC's backmerge escape (AC-11)</item>
|
|
18
|
+
<item>RFC-1491: step 2 — pre-push guard mode, install steps pre-push + markers, FLOW-10</item>
|
|
19
|
+
<item>RFC-1491: step 5 — flow.push atomic outbound path + extract publication</item>
|
|
20
|
+
<item>RFC-1502: steps 1-5 — release-prepare hook, pre-tag extract verification, ordered steps</item>
|
|
21
|
+
<history>RFC-1486</history>
|
|
22
|
+
</CHANGE_SUMMARY>
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { chmod, copyFile, mkdir, mkdtemp, writeFile } from "node:fs/promises";
|
|
26
|
+
import { tmpdir } from "node:os";
|
|
27
|
+
import { join } from "node:path";
|
|
28
|
+
|
|
29
|
+
import type { ExecResult } from "../../../src/types.ts";
|
|
30
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
31
|
+
import {
|
|
32
|
+
GUARD_BEGIN_MARKER,
|
|
33
|
+
GUARD_END_MARKER,
|
|
34
|
+
MANAGED_BLOCK,
|
|
35
|
+
managedBlock,
|
|
36
|
+
resolveGuardAssetPath,
|
|
37
|
+
} from "../guard-files.ts";
|
|
38
|
+
|
|
39
|
+
const PREMERGE_MANAGED_BLOCK = managedBlock("pre-merge-commit");
|
|
40
|
+
const PREPUSH_MANAGED_BLOCK = managedBlock("pre-push");
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
GUARD_BEGIN_MARKER,
|
|
44
|
+
GUARD_END_MARKER,
|
|
45
|
+
MANAGED_BLOCK,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** Absolute path of the shipped guard asset — resolved on first use. */
|
|
49
|
+
export const GUARD_ASSET = resolveGuardAssetPath();
|
|
50
|
+
|
|
51
|
+
export function gitExec(
|
|
52
|
+
repo: string,
|
|
53
|
+
args: string[],
|
|
54
|
+
env?: Record<string, string>,
|
|
55
|
+
): Promise<ExecResult> {
|
|
56
|
+
return ambientIo.exec("git", ["-C", repo, ...args], { env });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* `git init` in a fresh temp dir with deterministic local config (no global
|
|
61
|
+
* git config may leak in). `seedCommit` creates a root commit — skipped for
|
|
62
|
+
* unborn-HEAD cases.
|
|
63
|
+
*/
|
|
64
|
+
export async function initRepo(opts?: {
|
|
65
|
+
branch?: string;
|
|
66
|
+
seedCommit?: boolean;
|
|
67
|
+
prefix?: string;
|
|
68
|
+
}): Promise<string> {
|
|
69
|
+
const dir = await mkdtemp(join(tmpdir(), opts?.prefix ?? "flow-test-"));
|
|
70
|
+
const init = await gitExec(dir, ["init", "-b", opts?.branch ?? "main"]);
|
|
71
|
+
if (init.exitCode !== 0) throw new Error(`git init failed: ${init.stderr}`);
|
|
72
|
+
await gitExec(dir, ["config", "user.email", "flow-test@example.invalid"]);
|
|
73
|
+
await gitExec(dir, ["config", "user.name", "flow-test"]);
|
|
74
|
+
await gitExec(dir, ["config", "commit.gpgsign", "false"]);
|
|
75
|
+
if (opts?.seedCommit !== false) {
|
|
76
|
+
await writeFile(join(dir, "seed.txt"), "seed\n");
|
|
77
|
+
await gitExec(dir, ["add", "seed.txt"]);
|
|
78
|
+
const seed = await gitExec(dir, ["commit", "-m", "seed"]);
|
|
79
|
+
if (seed.exitCode !== 0) throw new Error(`seed commit failed: ${seed.stderr}`);
|
|
80
|
+
}
|
|
81
|
+
return dir;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Install the guard the way flow.install does it: hooks/flow-guard.sh byte
|
|
86
|
+
* copy of the asset, hooks/pre-commit carrying the managed block right after
|
|
87
|
+
* the shebang, core.hooksPath pointing at the committed dir.
|
|
88
|
+
*/
|
|
89
|
+
export async function installGuard(repo: string): Promise<void> {
|
|
90
|
+
const hooksDir = join(repo, "hooks");
|
|
91
|
+
await mkdir(hooksDir, { recursive: true });
|
|
92
|
+
await copyFile(resolveGuardAssetPath(), join(hooksDir, "flow-guard.sh"));
|
|
93
|
+
await writeFile(join(hooksDir, "pre-commit"), `#!/bin/sh\n${MANAGED_BLOCK}`);
|
|
94
|
+
await writeFile(join(hooksDir, "pre-merge-commit"), `#!/bin/sh\n${PREMERGE_MANAGED_BLOCK}`);
|
|
95
|
+
await writeFile(join(hooksDir, "pre-push"), `#!/bin/sh\n${PREPUSH_MANAGED_BLOCK}`);
|
|
96
|
+
await chmod(join(hooksDir, "flow-guard.sh"), 0o755);
|
|
97
|
+
await chmod(join(hooksDir, "pre-commit"), 0o755);
|
|
98
|
+
await chmod(join(hooksDir, "pre-merge-commit"), 0o755);
|
|
99
|
+
await chmod(join(hooksDir, "pre-push"), 0o755);
|
|
100
|
+
const hooksPath = await gitExec(repo, ["config", "core.hooksPath", "hooks"]);
|
|
101
|
+
if (hooksPath.exitCode !== 0) {
|
|
102
|
+
throw new Error(`core.hooksPath failed: ${hooksPath.stderr}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Attempt a commit; env overrides merge over process.env (set "" to neutralize). */
|
|
107
|
+
export function tryCommit(
|
|
108
|
+
repo: string,
|
|
109
|
+
env?: Record<string, string>,
|
|
110
|
+
): Promise<ExecResult> {
|
|
111
|
+
return gitExec(repo, ["commit", "--allow-empty", "-m", "probe"], env);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Invoke the installed guard directly with HEAD on the current branch. */
|
|
115
|
+
export function runGuardDirect(
|
|
116
|
+
repo: string,
|
|
117
|
+
env?: Record<string, string>,
|
|
118
|
+
): Promise<ExecResult> {
|
|
119
|
+
return ambientIo.exec("sh", [join(repo, "hooks", "flow-guard.sh"), "pre-commit"], {
|
|
120
|
+
cwd: repo,
|
|
121
|
+
env,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Governed repo (forge.yaml + develop) wired to a fresh bare origin, both
|
|
127
|
+
* branches fully pushed — the RFC-1491 fixture shape (digest/push/hold).
|
|
128
|
+
* The repo lives inside its own parent dir so extract destinations anchored
|
|
129
|
+
* at dirname(primary) stay per-test isolated.
|
|
130
|
+
*/
|
|
131
|
+
export async function initRepoWithOrigin(
|
|
132
|
+
dirs: string[],
|
|
133
|
+
opts?: { prefix?: string; fakeExtract?: boolean },
|
|
134
|
+
): Promise<{ repo: string; origin: string; extractLog: string; parent: string }> {
|
|
135
|
+
const parent = await mkdtemp(join(tmpdir(), opts?.prefix ?? "flow-origin-"));
|
|
136
|
+
dirs.push(parent);
|
|
137
|
+
const repo = join(parent, "repo");
|
|
138
|
+
const origin = join(parent, "origin.git");
|
|
139
|
+
const extractLog = join(parent, "extract.log");
|
|
140
|
+
|
|
141
|
+
await mkdir(repo, { recursive: true });
|
|
142
|
+
const init = await gitExec(repo, ["init", "-b", "main"]);
|
|
143
|
+
if (init.exitCode !== 0) throw new Error(`git init failed: ${init.stderr}`);
|
|
144
|
+
await gitExec(repo, ["config", "user.email", "flow-test@example.invalid"]);
|
|
145
|
+
await gitExec(repo, ["config", "user.name", "flow-test"]);
|
|
146
|
+
await gitExec(repo, ["config", "commit.gpgsign", "false"]);
|
|
147
|
+
await writeFile(join(repo, "forge.yaml"), 'schema: "forge/workspace@1"\n');
|
|
148
|
+
await writeFile(
|
|
149
|
+
join(repo, "pnpm-workspace.yaml"),
|
|
150
|
+
"packages:\n - packages/*\n",
|
|
151
|
+
);
|
|
152
|
+
await writeFile(join(repo, "seed.txt"), "seed\n");
|
|
153
|
+
await gitExec(repo, ["add", "-A"]);
|
|
154
|
+
const seed = await gitExec(repo, ["commit", "-m", "seed"]);
|
|
155
|
+
if (seed.exitCode !== 0) throw new Error(`seed commit failed: ${seed.stderr}`);
|
|
156
|
+
await gitExec(repo, ["branch", "develop", "HEAD"]);
|
|
157
|
+
|
|
158
|
+
const bare = await gitExec(parent, ["init", "--bare", "-b", "develop", "origin.git"]);
|
|
159
|
+
if (bare.exitCode !== 0) throw new Error(`bare init failed: ${bare.stderr}`);
|
|
160
|
+
await gitExec(repo, ["remote", "add", "origin", origin]);
|
|
161
|
+
await gitExec(repo, ["switch", "develop"]);
|
|
162
|
+
const push = await gitExec(repo, ["push", "-u", "origin", "develop", "main"]);
|
|
163
|
+
if (push.exitCode !== 0) throw new Error(`initial push failed: ${push.stderr}`);
|
|
164
|
+
|
|
165
|
+
if (opts?.fakeExtract) await installFakeRepoExtract(repo, extractLog);
|
|
166
|
+
return { repo, origin, extractLog, parent };
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A fake `<repo>/node_modules/.bin/repo-extract`: logs argv to `log`, then
|
|
171
|
+
* materializes the destination exactly like resolveExtractDest does — a
|
|
172
|
+
* git repo at <parent>/<destBase|packages>/<destName> with one export
|
|
173
|
+
* commit and a bare `origin` at <parent>/extract-origins/<destName>.git.
|
|
174
|
+
* A `--dest <dir>` argument overrides the computed destination (RFC-1502's
|
|
175
|
+
* pre-tag verify extracts into a scratch). Set FAKE_EXTRACT_FAIL=1 in its
|
|
176
|
+
* env — or drop a `.fail-extract` marker in the caller's cwd — to make it
|
|
177
|
+
* exit 3 (FLOW-PUSH-05 / FLOW-CUT-13 tests).
|
|
178
|
+
*/
|
|
179
|
+
export async function installFakeRepoExtract(
|
|
180
|
+
repo: string,
|
|
181
|
+
log: string,
|
|
182
|
+
): Promise<string> {
|
|
183
|
+
const bin = join(repo, "node_modules", ".bin");
|
|
184
|
+
await mkdir(bin, { recursive: true });
|
|
185
|
+
const script = join(bin, "repo-extract");
|
|
186
|
+
await writeFile(
|
|
187
|
+
script,
|
|
188
|
+
`#!/bin/sh
|
|
189
|
+
set -eu
|
|
190
|
+
echo "$@" >> ${JSON.stringify(log)}
|
|
191
|
+
if [ "\${FAKE_EXTRACT_FAIL:-0}" = "1" ] || [ -f "$PWD/.fail-extract" ]; then
|
|
192
|
+
echo "fake extract failure" >&2
|
|
193
|
+
exit 3
|
|
194
|
+
fi
|
|
195
|
+
cfg=""; ref=""; destOverride=""
|
|
196
|
+
while [ $# -gt 0 ]; do
|
|
197
|
+
case "$1" in
|
|
198
|
+
--config) cfg="$2"; shift 2 ;;
|
|
199
|
+
--ref) ref="$2"; shift 2 ;;
|
|
200
|
+
--dest) destOverride="$2"; shift 2 ;;
|
|
201
|
+
*) shift ;;
|
|
202
|
+
esac
|
|
203
|
+
done
|
|
204
|
+
lineDir=$(dirname "$cfg")
|
|
205
|
+
destName=$(grep '^destName:' "$lineDir/extract.config.yaml" | sed 's/^destName: *//' | tr -d ' ')
|
|
206
|
+
destBase=$(grep '^destBase:' "$lineDir/extract.config.yaml" | sed 's/^destBase: *//' | tr -d ' ')
|
|
207
|
+
destBase=\${destBase:-packages}
|
|
208
|
+
dest="\${destOverride:-$(dirname "$PWD")/$destBase/$destName}"
|
|
209
|
+
mkdir -p "$dest"
|
|
210
|
+
if [ ! -d "$dest/.git" ]; then git -C "$dest" init -b main >/dev/null; fi
|
|
211
|
+
# A CI runner has no global git identity; publish's reconcile merge commits
|
|
212
|
+
# in the destination, so the destination carries its own.
|
|
213
|
+
git -C "$dest" config user.email t@t
|
|
214
|
+
git -C "$dest" config user.name t
|
|
215
|
+
echo "export $ref" > "$dest/export.txt"
|
|
216
|
+
git -C "$dest" add export.txt
|
|
217
|
+
git -C "$dest" -c user.email=t@t -c user.name=t commit -q -m "export $ref"
|
|
218
|
+
dorigin="$(dirname "$PWD")/extract-origins/$destName.git"
|
|
219
|
+
mkdir -p "$(dirname "$dorigin")"
|
|
220
|
+
if [ ! -f "$dorigin/HEAD" ]; then git init --bare -b main "$dorigin" >/dev/null; fi
|
|
221
|
+
git -C "$dest" remote remove origin 2>/dev/null || true
|
|
222
|
+
git -C "$dest" remote add origin "$dorigin"
|
|
223
|
+
`,
|
|
224
|
+
);
|
|
225
|
+
await chmod(script, 0o755);
|
|
226
|
+
return script;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** Switch to a branch, creating it when it does not exist yet. */
|
|
230
|
+
export async function checkoutOrCreate(repo: string, name: string): Promise<void> {
|
|
231
|
+
const exists =
|
|
232
|
+
(await gitExec(repo, ["branch", "--list", name])).stdout.trim().length > 0;
|
|
233
|
+
const result = exists
|
|
234
|
+
? await gitExec(repo, ["switch", name])
|
|
235
|
+
: await gitExec(repo, ["switch", "-c", name]);
|
|
236
|
+
if (result.exitCode !== 0) {
|
|
237
|
+
throw new Error(`switch to ${name} failed: ${result.stderr}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>isFlowAdopted (RFC-1494 step 1): the public adoption test moved to
|
|
4
|
+
os/flow/index.ts — governed + develop exists + the pre-commit managed block
|
|
5
|
+
committed on develop. A worktree-local or uncommitted block does not count.</purpose>
|
|
6
|
+
<non-goals>
|
|
7
|
+
<item>No flow.cut behavior — flow-cut.test.ts owns the command.</item>
|
|
8
|
+
</non-goals>
|
|
9
|
+
</MODULE_CONTRACT>
|
|
10
|
+
<CHANGE_SUMMARY>
|
|
11
|
+
<item>RFC-1494: step 1 — isFlowAdopted public export tests</item>
|
|
12
|
+
<item>RFC-1494: step 1 — isFlowAdopted public export</item>
|
|
13
|
+
</CHANGE_SUMMARY>
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { describe, expect, it } from "vitest";
|
|
17
|
+
|
|
18
|
+
import { isFlowAdopted } from "../index.ts";
|
|
19
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
20
|
+
import { gitExec, initRepo, installGuard } from "./helpers.ts";
|
|
21
|
+
|
|
22
|
+
const io = ambientIo;
|
|
23
|
+
|
|
24
|
+
describe("isFlowAdopted (RFC-1494)", () => {
|
|
25
|
+
it("returns false for an ungoverned repository", async () => {
|
|
26
|
+
const repo = await initRepo();
|
|
27
|
+
expect(await isFlowAdopted(repo, io)).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("returns false for a governed repository without develop", async () => {
|
|
31
|
+
const repo = await initRepo();
|
|
32
|
+
await gitExec(repo, ["config", "user.email", "flow-test@example.invalid"]);
|
|
33
|
+
await ambientIo.writeFile(
|
|
34
|
+
`${repo}/forge.yaml`,
|
|
35
|
+
'schema: "forge/workspace@1"\n',
|
|
36
|
+
);
|
|
37
|
+
expect(await isFlowAdopted(repo, io)).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("returns false when develop exists but the managed block is not committed", async () => {
|
|
41
|
+
const repo = await initRepo();
|
|
42
|
+
await ambientIo.writeFile(
|
|
43
|
+
`${repo}/forge.yaml`,
|
|
44
|
+
'schema: "forge/workspace@1"\n',
|
|
45
|
+
);
|
|
46
|
+
await gitExec(repo, ["add", "forge.yaml"]);
|
|
47
|
+
await gitExec(repo, ["commit", "-m", "forge config"]);
|
|
48
|
+
await gitExec(repo, ["branch", "develop", "HEAD"]);
|
|
49
|
+
// Guard installed in the worktree only — never committed to develop.
|
|
50
|
+
await installGuard(repo);
|
|
51
|
+
expect(await isFlowAdopted(repo, io)).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("returns true when develop carries the committed managed block", async () => {
|
|
55
|
+
const repo = await initRepo();
|
|
56
|
+
await ambientIo.writeFile(
|
|
57
|
+
`${repo}/forge.yaml`,
|
|
58
|
+
'schema: "forge/workspace@1"\n',
|
|
59
|
+
);
|
|
60
|
+
await gitExec(repo, ["add", "forge.yaml"]);
|
|
61
|
+
await gitExec(repo, ["commit", "-m", "forge config"]);
|
|
62
|
+
await installGuard(repo);
|
|
63
|
+
await gitExec(repo, ["add", "hooks"]);
|
|
64
|
+
const adopt = await gitExec(repo, ["commit", "-m", "chore: adopt forge flow guard"], {
|
|
65
|
+
FORGE_FLOW_OP: "install",
|
|
66
|
+
});
|
|
67
|
+
if (adopt.exitCode !== 0) throw new Error(`adoption commit failed: ${adopt.stderr}`);
|
|
68
|
+
await gitExec(repo, ["branch", "-f", "develop", "HEAD"]);
|
|
69
|
+
expect(await isFlowAdopted(repo, io)).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
});
|