@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,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Tag reading for release lines (RFC-1488): list the annotated tags
|
|
4
|
+
reachable from HEAD that match a line's tag prefix (`v*` | `<pkg>@*`),
|
|
5
|
+
pick the semantically highest one (not the nearest — a stale older tag must
|
|
6
|
+
never hide a higher baseline) and expose the reachable set for evidence.
|
|
7
|
+
Lightweight tags are invisible to release lines by design.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No tag creation — flow.install's baseline step owns that, and it is the only writer.</item>
|
|
10
|
+
<item>No version math — semver.ts and release-level.ts own it.</item>
|
|
11
|
+
</non-goals>
|
|
12
|
+
</MODULE_CONTRACT>
|
|
13
|
+
<KEY_DECISIONS>
|
|
14
|
+
<item>`--merged HEAD` scopes to reachable tags only: a tag on an abandoned side branch must not become the baseline.</item>
|
|
15
|
+
<item>`%(objecttype)` + `%(*objectname)` distinguishes annotated (`tag`) from lightweight (`commit`) — only annotated tags carry a line.</item>
|
|
16
|
+
<item>Highest reachable wins over nearest: the historical `forge@0.15.0` predates real `forge@9.x` tags and must not lower the reported version.</item>
|
|
17
|
+
<item>listLegacyTags (RFC-1498) is reporting-only: one for-each-ref pass with NUL-delimited records (contents is multi-line) classifies prefix+semver-matching tags the reader does not honour — never rewrites them.</item>
|
|
18
|
+
<item>RELEASE_TAG_SCHEMA_LINE is exported (RFC-1511): the annotation contract stays in one place — os/system consumers import it rather than duplicating the regex.</item>
|
|
19
|
+
</KEY_DECISIONS>
|
|
20
|
+
<CHANGE_SUMMARY>
|
|
21
|
+
<item>RFC-1490: step 4 — ordinary flow.cut (release branch, verified versions, gate, main swap, tags, resume)</item>
|
|
22
|
+
<item>RFC-1490: independent-review pass — lock-held planning, fix-branch verification, spec-shaped data, coverage</item>
|
|
23
|
+
<item>RFC-1498: step 3 — legacy-tags report in flow.install
|
|
24
|
+
|
|
25
|
+
listLegacyTags scans refs/tags in a single for-each-ref pass carrying objecttype and NUL-delimited contents: a tag whose name matches a line grammar (tagPrefix + strict semver) is pre-program when it is lightweight, or annotated but its body lacks the schema forge/release-tag@1 line. flow.install gains an informational legacy-tags plan step listing every such tag as name (kind) — never a refusal, nothing is deleted or rewritten; execution simply marks the step done. Tests AC-5 (a lightweight v1.2.2 and a schema-less annotated lib at 0.1.0 appear with their kinds) and AC-6 (installation proceeds and both tags remain). Compass metadata updated.</item>
|
|
26
|
+
<item>RFC-1511: accept recorded products map in verified gate, guard folders lookup and exec edges (RFC-1511 review r1)</item>
|
|
27
|
+
<item>RFC-1511: record KEY_DECISIONS for exported tag-schema regex and exec edge handling (RFC-1511 review r1)</item>
|
|
28
|
+
<history>RFC-1488, RFC-1490</history>
|
|
29
|
+
</CHANGE_SUMMARY>
|
|
30
|
+
*/
|
|
31
|
+
import { git } from "./git.js";
|
|
32
|
+
import { compareVersions, parseVersion } from "./semver.js";
|
|
33
|
+
const NULL_FIELD = "";
|
|
34
|
+
/**
|
|
35
|
+
* Annotated tags reachable from HEAD matching `line.tagPrefix`, newest first.
|
|
36
|
+
* Format: `<refname:short>\x1f<objecttype>\x1f<*objectname>\x1f<creatordate>`.
|
|
37
|
+
* Lightweight tags (`objecttype` = commit/blob) are dropped; a non-semver
|
|
38
|
+
* suffix after the prefix (e.g. `v-next`) is dropped too.
|
|
39
|
+
*/
|
|
40
|
+
async function listAnnotated(repoRoot, line, io, ref) {
|
|
41
|
+
const head = await git(repoRoot, io, ["rev-parse", "--verify", "-q", ref]);
|
|
42
|
+
if (head.exitCode !== 0)
|
|
43
|
+
return []; // unborn branch — nothing reachable
|
|
44
|
+
const sep = "\x1f";
|
|
45
|
+
// %(refname) (full form) — %(refname:short) would hide a tag sharing its
|
|
46
|
+
// name with a branch (shortening is ambiguous by design).
|
|
47
|
+
const format = `%(refname)${sep}%(objecttype)${sep}%(*objectname)${sep}%(creatordate:iso-strict)`;
|
|
48
|
+
const result = await git(repoRoot, io, [
|
|
49
|
+
"for-each-ref",
|
|
50
|
+
`refs/tags/${line.tagPrefix}*`,
|
|
51
|
+
`--format=${format}`,
|
|
52
|
+
"--sort=-creatordate",
|
|
53
|
+
"--merged",
|
|
54
|
+
ref,
|
|
55
|
+
]);
|
|
56
|
+
if (result.exitCode !== 0)
|
|
57
|
+
return [];
|
|
58
|
+
const rows = [];
|
|
59
|
+
for (const raw of result.stdout.split("\n")) {
|
|
60
|
+
const line_ = raw.trimEnd();
|
|
61
|
+
if (!line_)
|
|
62
|
+
continue;
|
|
63
|
+
const [refname = "", objecttype = "", peeled = "", creatordate = ""] = line_.split(sep);
|
|
64
|
+
if (objecttype !== "tag")
|
|
65
|
+
continue; // annotated only
|
|
66
|
+
const name = refname.startsWith("refs/tags/") ? refname.slice("refs/tags/".length) : refname;
|
|
67
|
+
const versionText = name.startsWith(line.tagPrefix)
|
|
68
|
+
? name.slice(line.tagPrefix.length)
|
|
69
|
+
: NULL_FIELD;
|
|
70
|
+
if (!versionText || parseVersion(versionText) === null)
|
|
71
|
+
continue;
|
|
72
|
+
rows.push({ name, objecttype, peeled, creatordate });
|
|
73
|
+
}
|
|
74
|
+
return rows;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Read a line's tag state: `lastTag` is the highest-version annotated
|
|
78
|
+
* reachable tag for its prefix, `reachable` the full matching set newest
|
|
79
|
+
* first. Null/empty when the line was never tagged.
|
|
80
|
+
*/
|
|
81
|
+
export async function listLineTags(repoRoot, line, io, ref = "HEAD") {
|
|
82
|
+
const rows = await listAnnotated(repoRoot, line, io, ref);
|
|
83
|
+
let lastTag = null;
|
|
84
|
+
for (const row of rows) {
|
|
85
|
+
const version = parseVersion(row.name.slice(line.tagPrefix.length));
|
|
86
|
+
if (version === null)
|
|
87
|
+
continue;
|
|
88
|
+
if (lastTag === null || compareVersions(version, lastTag.version) > 0) {
|
|
89
|
+
lastTag = { name: row.name, version };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return { lastTag, reachable: rows.map((r) => r.name) };
|
|
93
|
+
}
|
|
94
|
+
export const RELEASE_TAG_SCHEMA_LINE = /^schema:\s*forge\/release-tag@1\s*$/m;
|
|
95
|
+
/**
|
|
96
|
+
* Pre-program tags (RFC-1498): every tag whose name matches a discovered
|
|
97
|
+
* line's grammar (tagPrefix + strict semver) but that the release-line
|
|
98
|
+
* reader does not honour — lightweight tags, and annotated tags whose
|
|
99
|
+
* body lacks the `schema: forge/release-tag@1` line. One `for-each-ref`
|
|
100
|
+
* pass; %00 delimits records because %(contents) is multi-line.
|
|
101
|
+
*/
|
|
102
|
+
export async function listLegacyTags(repoRoot, lines, io) {
|
|
103
|
+
const sep = "\x1f";
|
|
104
|
+
const format = `%(refname)${sep}%(objecttype)${sep}%(contents)%00`;
|
|
105
|
+
const result = await git(repoRoot, io, ["for-each-ref", "refs/tags", `--format=${format}`]);
|
|
106
|
+
if (result.exitCode !== 0)
|
|
107
|
+
return [];
|
|
108
|
+
const legacy = [];
|
|
109
|
+
for (const rec of result.stdout.split("\x00")) {
|
|
110
|
+
const firstSep = rec.indexOf(sep);
|
|
111
|
+
const secondSep = firstSep === -1 ? -1 : rec.indexOf(sep, firstSep + 1);
|
|
112
|
+
if (firstSep === -1 || secondSep === -1)
|
|
113
|
+
continue;
|
|
114
|
+
const refname = rec.slice(0, firstSep).replace(/^\s+/, "");
|
|
115
|
+
const objecttype = rec.slice(firstSep + 1, secondSep);
|
|
116
|
+
const contents = rec.slice(secondSep + 1);
|
|
117
|
+
const name = refname.startsWith("refs/tags/") ? refname.slice("refs/tags/".length) : refname;
|
|
118
|
+
const line = lines.find((l) => name.startsWith(l.tagPrefix) &&
|
|
119
|
+
parseVersion(name.slice(l.tagPrefix.length)) !== null);
|
|
120
|
+
if (line === undefined)
|
|
121
|
+
continue;
|
|
122
|
+
if (objecttype === "tag") {
|
|
123
|
+
if (!RELEASE_TAG_SCHEMA_LINE.test(contents)) {
|
|
124
|
+
legacy.push({ name, line: line.id, kind: "annotated-without-schema" });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
legacy.push({ name, line: line.id, kind: "lightweight" });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return legacy;
|
|
132
|
+
}
|
|
133
|
+
/** Short (9-char) form of a full commit hash — derived-version metadata. */
|
|
134
|
+
export function shortHash(hash) {
|
|
135
|
+
return hash.slice(0, 9);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* forge/release-tag@1 annotation body (RFC-1488). `previous`/`rfcs`/`fingerprints`
|
|
139
|
+
* come from the cut's pendingLevel and the fingerprint hook.
|
|
140
|
+
*/
|
|
141
|
+
export function releaseTagAnnotation(fields) {
|
|
142
|
+
const fp = Object.entries(fields.fingerprints)
|
|
143
|
+
.map(([k, v]) => ` ${k}: ${/^[A-Za-z0-9._/+@-]+$/.test(v) ? v : JSON.stringify(v)}`)
|
|
144
|
+
.join("\n");
|
|
145
|
+
return [
|
|
146
|
+
`release ${fields.tag}`,
|
|
147
|
+
"",
|
|
148
|
+
"schema: forge/release-tag@1",
|
|
149
|
+
`line: ${fields.line}`,
|
|
150
|
+
`version: ${fields.version}`,
|
|
151
|
+
`level: ${fields.level}`,
|
|
152
|
+
`previous: ${fields.previous ?? "null"}`,
|
|
153
|
+
`rfcs: [${fields.rfcs.map((r) => `"${r}"`).join(", ")}]`,
|
|
154
|
+
fp.length > 0 ? `fingerprints:\n${fp}` : "fingerprints: {}",
|
|
155
|
+
].join("\n");
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Create an annotated release tag at `target` with the given annotation
|
|
159
|
+
* body via `git tag -a <name> <target> -m <annotation>`. Callers build the
|
|
160
|
+
* forge/release-tag@1 text; this is the single tag-writing seam (flow.install
|
|
161
|
+
* baselines and flow.cut releases share it).
|
|
162
|
+
*/
|
|
163
|
+
export async function writeReleaseTag(repoRoot, io, spec) {
|
|
164
|
+
const result = await git(repoRoot, io, ["tag", "-a", spec.name, spec.target, "-m", spec.annotation]);
|
|
165
|
+
return { exitCode: result.exitCode, stderr: result.stderr };
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=release-tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-tags.js","sourceRoot":"","sources":["../../../os/flow/release-tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE;AAGF,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAe,MAAM,aAAa,CAAC;AAgBzE,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;;;;;GAKG;AACH,KAAK,UAAU,aAAa,CAC1B,QAAgB,EAChB,IAAiB,EACjB,EAAe,EACf,GAAW;IAEX,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3E,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC,CAAC,oCAAoC;IACxE,MAAM,GAAG,GAAG,MAAM,CAAC;IACnB,yEAAyE;IACzE,0DAA0D;IAC1D,MAAM,MAAM,GAAG,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,2BAA2B,CAAC;IAClG,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE;QACrC,cAAc;QACd,aAAa,IAAI,CAAC,SAAS,GAAG;QAC9B,YAAY,MAAM,EAAE;QACpB,qBAAqB;QACrB,UAAU;QACV,GAAG;KACJ,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,MAAM,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AEpB,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACrG,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
3
|
+
export declare const GENERATED_MARKER_FILE = "forge.generated.yaml";
|
|
4
|
+
export declare const FORGE_CONFIG_FILE = "forge.yaml";
|
|
5
|
+
export declare const generatedMarkerSchema: z.ZodObject<{
|
|
6
|
+
schema: z.ZodLiteral<"forge/generated@1">;
|
|
7
|
+
generator: z.ZodString;
|
|
8
|
+
source: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type GeneratedMarker = z.infer<typeof generatedMarkerSchema>;
|
|
11
|
+
export type RepoKind = {
|
|
12
|
+
kind: "governed";
|
|
13
|
+
} | {
|
|
14
|
+
kind: "exempt";
|
|
15
|
+
marker: GeneratedMarker;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "ungoverned";
|
|
18
|
+
};
|
|
19
|
+
export type RepoKindDetection = {
|
|
20
|
+
ok: true;
|
|
21
|
+
repoKind: RepoKind;
|
|
22
|
+
}
|
|
23
|
+
/** The marker exists but fails forge/generated@1 — FLOW-05 material. */
|
|
24
|
+
| {
|
|
25
|
+
ok: false;
|
|
26
|
+
reason: "invalid-marker";
|
|
27
|
+
detail: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Detect the repository kind from committed/working state only (DNA-105) —
|
|
31
|
+
* the working-tree marker for non-bare repositories, `HEAD:<file>` for bare
|
|
32
|
+
* ones. Never consults process-global state.
|
|
33
|
+
*/
|
|
34
|
+
export declare function detectRepoKind(repoRoot: string, io: WorkspaceIO): Promise<RepoKindDetection>;
|
|
35
|
+
/**
|
|
36
|
+
* Read a file at the repository top level: from the working tree for non-bare
|
|
37
|
+
* repositories, from `git show HEAD:<name>` for bare ones. Returns null when
|
|
38
|
+
* the file does not exist.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readRepoRootFile(repoRoot: string, name: string, io: WorkspaceIO, bare: boolean): Promise<string | null>;
|
|
41
|
+
//# sourceMappingURL=repo-kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-kind.d.ts","sourceRoot":"","sources":["../../../os/flow/repo-kind.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAC5D,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,eAAO,MAAM,qBAAqB;;;;kBAMvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAE3B,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE;AAClC,wEAAwE;GACtE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,iBAAiB,CAAC,CA+B5B;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYxB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Repository-kind detection for the fixed branch model (RFC-1486) —
|
|
4
|
+
classifies a repository as governed (forge.yaml, no marker), exempt
|
|
5
|
+
(forge.generated.yaml carrying the forge/generated@1 schema) or ungoverned.
|
|
6
|
+
Generated repositories are never blocked by the guard or by flow.check.</purpose>
|
|
7
|
+
<non-goals>
|
|
8
|
+
<item>No flow.check rule evaluation — handlers turn detection results into diagnostics.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<KEY_DECISIONS>
|
|
12
|
+
<item>A marker that fails the schema is a structured error (FLOW-05 material), never an exemption — implicit exemption by malformed file would silently unprotect a governed repo.</item>
|
|
13
|
+
<item>Bare repositories read root files via `git show HEAD:<name>` — they carry no working tree.</item>
|
|
14
|
+
</KEY_DECISIONS>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-1486: step 1 — fixed branch-model grammar, marker detection contracts, git helpers</item>
|
|
17
|
+
<item>RFC-1486: step 1 — branch grammar, marker detection, git helpers</item>
|
|
18
|
+
<item>RFC-1486: review r1 — committed-state adoption gate, uncommitted-hook committedness, step-failure trail, idempotency declaration, lazy asset resolution</item>
|
|
19
|
+
<item>RFC-1491: independent-review pass — shared lock constants, publishable pending filter, declared rules, hold ordering, sha-pinned refspecs</item>
|
|
20
|
+
</CHANGE_SUMMARY>
|
|
21
|
+
*/
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
import { parse as yamlParse } from "yaml";
|
|
24
|
+
import { z } from "zod";
|
|
25
|
+
import { isBare } from "./git.js";
|
|
26
|
+
export const GENERATED_MARKER_FILE = "forge.generated.yaml";
|
|
27
|
+
export const FORGE_CONFIG_FILE = "forge.yaml";
|
|
28
|
+
export const generatedMarkerSchema = z
|
|
29
|
+
.object({
|
|
30
|
+
schema: z.literal("forge/generated@1"),
|
|
31
|
+
generator: z.string().min(1),
|
|
32
|
+
source: z.string().min(1),
|
|
33
|
+
})
|
|
34
|
+
.strict();
|
|
35
|
+
/**
|
|
36
|
+
* Detect the repository kind from committed/working state only (DNA-105) —
|
|
37
|
+
* the working-tree marker for non-bare repositories, `HEAD:<file>` for bare
|
|
38
|
+
* ones. Never consults process-global state.
|
|
39
|
+
*/
|
|
40
|
+
export async function detectRepoKind(repoRoot, io) {
|
|
41
|
+
const bare = await isBare(repoRoot, io);
|
|
42
|
+
const markerText = await readRepoRootFile(repoRoot, GENERATED_MARKER_FILE, io, bare);
|
|
43
|
+
if (markerText !== null) {
|
|
44
|
+
let markerData;
|
|
45
|
+
try {
|
|
46
|
+
markerData = yamlParse(markerText);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
ok: false,
|
|
51
|
+
reason: "invalid-marker",
|
|
52
|
+
detail: `${GENERATED_MARKER_FILE} is not parseable YAML: ${error instanceof Error ? error.message : String(error)}`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const parsed = generatedMarkerSchema.safeParse(markerData);
|
|
56
|
+
if (!parsed.success) {
|
|
57
|
+
return {
|
|
58
|
+
ok: false,
|
|
59
|
+
reason: "invalid-marker",
|
|
60
|
+
detail: `${GENERATED_MARKER_FILE} fails the forge/generated@1 schema: ${parsed.error.issues
|
|
61
|
+
.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`)
|
|
62
|
+
.join("; ")}`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return { ok: true, repoKind: { kind: "exempt", marker: parsed.data } };
|
|
66
|
+
}
|
|
67
|
+
const forgeConfig = await readRepoRootFile(repoRoot, FORGE_CONFIG_FILE, io, bare);
|
|
68
|
+
return {
|
|
69
|
+
ok: true,
|
|
70
|
+
repoKind: forgeConfig !== null ? { kind: "governed" } : { kind: "ungoverned" },
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Read a file at the repository top level: from the working tree for non-bare
|
|
75
|
+
* repositories, from `git show HEAD:<name>` for bare ones. Returns null when
|
|
76
|
+
* the file does not exist.
|
|
77
|
+
*/
|
|
78
|
+
export async function readRepoRootFile(repoRoot, name, io, bare) {
|
|
79
|
+
if (bare) {
|
|
80
|
+
// Adoption state lives on develop in the fixed branch model — HEAD on a
|
|
81
|
+
// bare repository may point at main, which carries no markers/hooks.
|
|
82
|
+
for (const ref of ["refs/heads/develop", "HEAD"]) {
|
|
83
|
+
const result = await io.exec("git", ["-C", repoRoot, "show", `${ref}:${name}`]);
|
|
84
|
+
if (result.exitCode === 0)
|
|
85
|
+
return result.stdout;
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
const path = join(repoRoot, name);
|
|
90
|
+
return (await io.exists(path)) ? io.readFile(path) : null;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=repo-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-kind.js","sourceRoot":"","sources":["../../../os/flow/repo-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;EAoBE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MA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ACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAClC,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
2
|
+
export type FlowScriptName = "worktree-setup" | "integration-gate" | "worktree-teardown" | "release-prepare" | "release-fingerprints" | "extract-verify";
|
|
3
|
+
export interface FlowScriptResult {
|
|
4
|
+
status: "done" | "skipped" | "failed";
|
|
5
|
+
exitCode: number | null;
|
|
6
|
+
stderrTail: string;
|
|
7
|
+
/** stdout truncated to 64 KiB with a trailing `…[truncated]` marker. */
|
|
8
|
+
stdout: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Run `<primary>/hooks/<name>.sh` with cwd inside `cwd` (the branch
|
|
12
|
+
* worktree). The script bytes always come from the primary checkout — the
|
|
13
|
+
* develop version, already integrated.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runFlowScript(io: WorkspaceIO, name: FlowScriptName, opts: {
|
|
16
|
+
primary: string;
|
|
17
|
+
cwd: string;
|
|
18
|
+
env: Record<string, string>;
|
|
19
|
+
}): Promise<FlowScriptResult>;
|
|
20
|
+
//# sourceMappingURL=scripts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../os/flow/scripts.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,CAAC;AAErB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAkB3B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Repository hook-script runner for the session lifecycle (RFC-1487):
|
|
4
|
+
worktree-setup.sh, integration-gate.sh and worktree-teardown.sh are optional
|
|
5
|
+
repository conventions executed from the PRIMARY worktree — never from the
|
|
6
|
+
branch worktree, so a session cannot weaken its own gate — with cwd set to
|
|
7
|
+
the branch worktree and the declared FLOW_* environment.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No lifecycle decisions — handlers map a non-zero exit to their own diagnostics.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<KEY_DECISIONS>
|
|
13
|
+
<item>Scripts run as `sh <primary>/hooks/<name>.sh` through io.exec with an argument vector — no shell interpolation (DNA-89, AUDIT-RFC-1487-G1).</item>
|
|
14
|
+
<item>Absent script → skipped; a script present in the branch worktree but absent in the primary is skipped identically — only develop's version gates.</item>
|
|
15
|
+
<item>stderrTail is the last 40 lines — enough for the report without flooding it (DNA-106).</item>
|
|
16
|
+
</KEY_DECISIONS>
|
|
17
|
+
<CHANGE_SUMMARY>
|
|
18
|
+
<item>RFC-1487: step 2 — primary-side hook-script runner</item>
|
|
19
|
+
<item>RFC-1490: step 4 — ordinary flow.cut (release branch, verified versions, gate, main swap, tags, resume)</item>
|
|
20
|
+
<item>RFC-1491: step 5 — flow.push atomic outbound path + extract publication</item>
|
|
21
|
+
<item>RFC-1502: step 2 — release-prepare hook name</item>
|
|
22
|
+
</CHANGE_SUMMARY>
|
|
23
|
+
*/
|
|
24
|
+
import { join } from "node:path";
|
|
25
|
+
const STDERR_TAIL_LINES = 40;
|
|
26
|
+
const STDOUT_CAP = 64 * 1024;
|
|
27
|
+
/**
|
|
28
|
+
* Run `<primary>/hooks/<name>.sh` with cwd inside `cwd` (the branch
|
|
29
|
+
* worktree). The script bytes always come from the primary checkout — the
|
|
30
|
+
* develop version, already integrated.
|
|
31
|
+
*/
|
|
32
|
+
export async function runFlowScript(io, name, opts) {
|
|
33
|
+
const scriptPath = join(opts.primary, "hooks", `${name}.sh`);
|
|
34
|
+
if (!(await io.exists(scriptPath))) {
|
|
35
|
+
return { status: "skipped", exitCode: null, stderrTail: "", stdout: "" };
|
|
36
|
+
}
|
|
37
|
+
const result = await io.exec("sh", [scriptPath], { cwd: opts.cwd, env: opts.env });
|
|
38
|
+
const tail = result.stderr
|
|
39
|
+
.split("\n")
|
|
40
|
+
.filter((line) => line.length > 0)
|
|
41
|
+
.slice(-STDERR_TAIL_LINES)
|
|
42
|
+
.join("\n");
|
|
43
|
+
const stdout = result.stdout.length > STDOUT_CAP
|
|
44
|
+
? `${result.stdout.slice(0, STDOUT_CAP)}…[truncated]`
|
|
45
|
+
: result.stdout;
|
|
46
|
+
return result.exitCode === 0
|
|
47
|
+
? { status: "done", exitCode: result.exitCode, stderrTail: tail, stdout }
|
|
48
|
+
: { status: "failed", exitCode: result.exitCode, stderrTail: tail, stdout };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=scripts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../../os/flow/scripts.ts"],"names":[],"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,KAAK,CAAC;QAC1B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE;QACzE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface SemVer {
|
|
2
|
+
major: number;
|
|
3
|
+
minor: number;
|
|
4
|
+
patch: number;
|
|
5
|
+
}
|
|
6
|
+
export type ReleaseLevel = "none" | "patch" | "minor" | "major";
|
|
7
|
+
/**
|
|
8
|
+
* Parse a strict `X.Y.Z` version — three non-negative integers, no leading
|
|
9
|
+
* `v`, no pre-release or build suffix. Returns null on anything else.
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseVersion(raw: string): SemVer | null;
|
|
12
|
+
/** Format a parsed version back to `X.Y.Z`. */
|
|
13
|
+
export declare function formatVersion(v: SemVer): string;
|
|
14
|
+
/** Numeric compare: -1 / 0 / +1. */
|
|
15
|
+
export declare function compareVersions(a: SemVer, b: SemVer): -1 | 0 | 1;
|
|
16
|
+
/** Bump `version` one level: patch → Z+1; minor → Y+1, Z=0; major → X+1, Y=Z=0. */
|
|
17
|
+
export declare function bumpVersion(v: SemVer, level: Exclude<ReleaseLevel, "none">): SemVer;
|
|
18
|
+
/** Ordering of release levels for max() — `none` ranks below every real level. */
|
|
19
|
+
export declare function levelRank(level: ReleaseLevel): number;
|
|
20
|
+
export declare function maxLevel(a: ReleaseLevel, b: ReleaseLevel): ReleaseLevel;
|
|
21
|
+
//# sourceMappingURL=semver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.d.ts","sourceRoot":"","sources":["../../../os/flow/semver.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQvD;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,oCAAoC;AACpC,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAKhE;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,MAAM,CASnF;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAWrD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,YAAY,CAEvE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Strict three-integer semver for release lines (RFC-1488) — parse,
|
|
4
|
+
compare and bump `X.Y.Z` versions with no pre-release/build segments: release
|
|
5
|
+
tags are `vX.Y.Z` and `<package>@X.Y.Z`, nothing else ever matches.</purpose>
|
|
6
|
+
<non-goals>
|
|
7
|
+
<item>No loose semver (pre-release, build metadata, ranges) — the release-line grammar is fixed.</item>
|
|
8
|
+
</non-goals>
|
|
9
|
+
</MODULE_CONTRACT>
|
|
10
|
+
<KEY_DECISIONS>
|
|
11
|
+
<item>Strict `^\d+\.\d+\.\d+$` — a pre-release or build suffix would silently break the tag-name match, so it is a parse failure, never normalized.</item>
|
|
12
|
+
</KEY_DECISIONS>
|
|
13
|
+
<CHANGE_SUMMARY>
|
|
14
|
+
<item>RFC-1488: step 1 — strict X.Y.Z parse/compare/bump</item>
|
|
15
|
+
<item>RFC-1488: step 1 — semver helper + release-line discovery (extract.config.yaml workspace globs)</item>
|
|
16
|
+
</CHANGE_SUMMARY>
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Parse a strict `X.Y.Z` version — three non-negative integers, no leading
|
|
20
|
+
* `v`, no pre-release or build suffix. Returns null on anything else.
|
|
21
|
+
*/
|
|
22
|
+
export function parseVersion(raw) {
|
|
23
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(raw.trim());
|
|
24
|
+
if (!match)
|
|
25
|
+
return null;
|
|
26
|
+
return {
|
|
27
|
+
major: Number.parseInt(match[1], 10),
|
|
28
|
+
minor: Number.parseInt(match[2], 10),
|
|
29
|
+
patch: Number.parseInt(match[3], 10),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Format a parsed version back to `X.Y.Z`. */
|
|
33
|
+
export function formatVersion(v) {
|
|
34
|
+
return `${v.major}.${v.minor}.${v.patch}`;
|
|
35
|
+
}
|
|
36
|
+
/** Numeric compare: -1 / 0 / +1. */
|
|
37
|
+
export function compareVersions(a, b) {
|
|
38
|
+
if (a.major !== b.major)
|
|
39
|
+
return a.major < b.major ? -1 : 1;
|
|
40
|
+
if (a.minor !== b.minor)
|
|
41
|
+
return a.minor < b.minor ? -1 : 1;
|
|
42
|
+
if (a.patch !== b.patch)
|
|
43
|
+
return a.patch < b.patch ? -1 : 1;
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
/** Bump `version` one level: patch → Z+1; minor → Y+1, Z=0; major → X+1, Y=Z=0. */
|
|
47
|
+
export function bumpVersion(v, level) {
|
|
48
|
+
switch (level) {
|
|
49
|
+
case "major":
|
|
50
|
+
return { major: v.major + 1, minor: 0, patch: 0 };
|
|
51
|
+
case "minor":
|
|
52
|
+
return { major: v.major, minor: v.minor + 1, patch: 0 };
|
|
53
|
+
case "patch":
|
|
54
|
+
return { major: v.major, minor: v.minor, patch: v.patch + 1 };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Ordering of release levels for max() — `none` ranks below every real level. */
|
|
58
|
+
export function levelRank(level) {
|
|
59
|
+
switch (level) {
|
|
60
|
+
case "none":
|
|
61
|
+
return 0;
|
|
62
|
+
case "patch":
|
|
63
|
+
return 1;
|
|
64
|
+
case "minor":
|
|
65
|
+
return 2;
|
|
66
|
+
case "major":
|
|
67
|
+
return 3;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function maxLevel(a, b) {
|
|
71
|
+
return levelRank(a) >= levelRank(b) ? a : b;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=semver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../os/flow/semver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAUF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC;QACrC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC;QACrC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,aAAa,CAAC,CAAS;IACrC,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC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AAED,kFAAkF;AAClF,MAAM,UAAU,SAAS,CAAC,KAAmB;IAC3C,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM;YACT,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,CAAe,EAAE,CAAe;IACvD,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
2
|
+
/** Directory inside a task worktree that carries brief/report payloads. */
|
|
3
|
+
export declare const TASK_FILES_DIR = ".forge/task";
|
|
4
|
+
/**
|
|
5
|
+
* Copy `<worktree>/.forge/task/` to `<commonGitDir>/forge/tasks/<ownerId>/`
|
|
6
|
+
* (recursive — subdirectories are preserved). Returns the copied file paths;
|
|
7
|
+
* an absent source directory is a no-op — a task branch is allowed to end
|
|
8
|
+
* without a report (collect then reports SYSTEM-TASK-07).
|
|
9
|
+
*/
|
|
10
|
+
export declare function preserveTaskFiles(commonGitDir: string, worktree: string, ownerId: string, io: WorkspaceIO): Promise<string[]>;
|
|
11
|
+
//# sourceMappingURL=task-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-files.d.ts","sourceRoot":"","sources":["../../../os/flow/task-files.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,2EAA2E;AAC3E,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAgB5C;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Preserve a task worktree's .forge/task/ payload into the common git
|
|
4
|
+
dir before flow.integrate / flow.discard removes the worktree (RFC-1509
|
|
5
|
+
Q-15/Q-16). The task report then survives teardown — system.task.collect
|
|
6
|
+
reads it from <common>/forge/tasks/<owner id>/ once the worktree
|
|
7
|
+
is gone. Copies are idempotent (same owner id re-copies over).</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No report validation — collect owns forge/task-report@1 checks.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1509: step 4 — preserve .forge/task/ under the common git dir</item>
|
|
14
|
+
<item>RFC-1509: implement RFC-1509 — system task queue, dispatch briefs and task reports</item>
|
|
15
|
+
<item>RFC-1509: close RFC-1509 review r1 findings — mark-failed escape, open-error refusal, dry-run coverage</item>
|
|
16
|
+
</CHANGE_SUMMARY>
|
|
17
|
+
*/
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
/** Directory inside a task worktree that carries brief/report payloads. */
|
|
20
|
+
export const TASK_FILES_DIR = ".forge/task";
|
|
21
|
+
async function copyTree(src, dst, io, into) {
|
|
22
|
+
for (const entry of await io.readdir(src)) {
|
|
23
|
+
const s = join(src, entry.name);
|
|
24
|
+
const d = join(dst, entry.name);
|
|
25
|
+
if (entry.isDirectory) {
|
|
26
|
+
await io.mkdir(d);
|
|
27
|
+
await copyTree(s, d, io, into);
|
|
28
|
+
}
|
|
29
|
+
else if (entry.isFile) {
|
|
30
|
+
await io.copyFile(s, d);
|
|
31
|
+
into.push(d);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Copy `<worktree>/.forge/task/` to `<commonGitDir>/forge/tasks/<ownerId>/`
|
|
37
|
+
* (recursive — subdirectories are preserved). Returns the copied file paths;
|
|
38
|
+
* an absent source directory is a no-op — a task branch is allowed to end
|
|
39
|
+
* without a report (collect then reports SYSTEM-TASK-07).
|
|
40
|
+
*/
|
|
41
|
+
export async function preserveTaskFiles(commonGitDir, worktree, ownerId, io) {
|
|
42
|
+
const src = join(worktree, TASK_FILES_DIR);
|
|
43
|
+
if (!(await io.exists(src)))
|
|
44
|
+
return [];
|
|
45
|
+
const dst = join(commonGitDir, "forge", "tasks", ownerId);
|
|
46
|
+
await io.mkdir(dst);
|
|
47
|
+
const copied = [];
|
|
48
|
+
await copyTree(src, dst, io, copied);
|
|
49
|
+
return copied;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=task-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-files.js","sourceRoot":"","sources":["../../../os/flow/task-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAE5C,KAAK,UAAU,QAAQ,CAAC,GAAW,EAAE,GAAW,EAAE,EAAe,EAAE,IAAc;IAC/E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACjC,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,YAAoB,EACpB,QAAgB,EAChB,OAAe,EACf,EAAe;IAEf,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ExecResult } from "../../../src/types.ts";
|
|
2
|
+
import { GUARD_BEGIN_MARKER, GUARD_END_MARKER, MANAGED_BLOCK } from "../guard-files.ts";
|
|
3
|
+
export { GUARD_BEGIN_MARKER, GUARD_END_MARKER, MANAGED_BLOCK, };
|
|
4
|
+
/** Absolute path of the shipped guard asset — resolved on first use. */
|
|
5
|
+
export declare const GUARD_ASSET: string;
|
|
6
|
+
export declare function gitExec(repo: string, args: string[], env?: Record<string, string>): Promise<ExecResult>;
|
|
7
|
+
/**
|
|
8
|
+
* `git init` in a fresh temp dir with deterministic local config (no global
|
|
9
|
+
* git config may leak in). `seedCommit` creates a root commit — skipped for
|
|
10
|
+
* unborn-HEAD cases.
|
|
11
|
+
*/
|
|
12
|
+
export declare function initRepo(opts?: {
|
|
13
|
+
branch?: string;
|
|
14
|
+
seedCommit?: boolean;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
}): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Install the guard the way flow.install does it: hooks/flow-guard.sh byte
|
|
19
|
+
* copy of the asset, hooks/pre-commit carrying the managed block right after
|
|
20
|
+
* the shebang, core.hooksPath pointing at the committed dir.
|
|
21
|
+
*/
|
|
22
|
+
export declare function installGuard(repo: string): Promise<void>;
|
|
23
|
+
/** Attempt a commit; env overrides merge over process.env (set "" to neutralize). */
|
|
24
|
+
export declare function tryCommit(repo: string, env?: Record<string, string>): Promise<ExecResult>;
|
|
25
|
+
/** Invoke the installed guard directly with HEAD on the current branch. */
|
|
26
|
+
export declare function runGuardDirect(repo: string, env?: Record<string, string>): Promise<ExecResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Governed repo (forge.yaml + develop) wired to a fresh bare origin, both
|
|
29
|
+
* branches fully pushed — the RFC-1491 fixture shape (digest/push/hold).
|
|
30
|
+
* The repo lives inside its own parent dir so extract destinations anchored
|
|
31
|
+
* at dirname(primary) stay per-test isolated.
|
|
32
|
+
*/
|
|
33
|
+
export declare function initRepoWithOrigin(dirs: string[], opts?: {
|
|
34
|
+
prefix?: string;
|
|
35
|
+
fakeExtract?: boolean;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
repo: string;
|
|
38
|
+
origin: string;
|
|
39
|
+
extractLog: string;
|
|
40
|
+
parent: string;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* A fake `<repo>/node_modules/.bin/repo-extract`: logs argv to `log`, then
|
|
44
|
+
* materializes the destination exactly like resolveExtractDest does — a
|
|
45
|
+
* git repo at <parent>/<destBase|packages>/<destName> with one export
|
|
46
|
+
* commit and a bare `origin` at <parent>/extract-origins/<destName>.git.
|
|
47
|
+
* A `--dest <dir>` argument overrides the computed destination (RFC-1502's
|
|
48
|
+
* pre-tag verify extracts into a scratch). Set FAKE_EXTRACT_FAIL=1 in its
|
|
49
|
+
* env — or drop a `.fail-extract` marker in the caller's cwd — to make it
|
|
50
|
+
* exit 3 (FLOW-PUSH-05 / FLOW-CUT-13 tests).
|
|
51
|
+
*/
|
|
52
|
+
export declare function installFakeRepoExtract(repo: string, log: string): Promise<string>;
|
|
53
|
+
/** Switch to a branch, creating it when it does not exist yet. */
|
|
54
|
+
export declare function checkoutOrCreate(repo: string, name: string): Promise<void>;
|
|
55
|
+
//# sourceMappingURL=helpers.d.ts.map
|