@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,208 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Release-line discovery (RFC-1488): the repository line (tag prefix
|
|
4
|
+
`v`, root package.json) plus one package line per workspace-glob directory
|
|
5
|
+
carrying `extract.config.yaml` (tag prefix `<basename>@`). Discovery reads
|
|
6
|
+
pnpm-workspace.yaml, expands each glob's static prefix with readdir to the
|
|
7
|
+
glob's depth, matches with picomatch and refuses ambiguous basenames with
|
|
8
|
+
FLOW-VER-02.</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>No tag reading or version math — release-tags.ts and release-level.ts own those.</item>
|
|
11
|
+
<item>No caching — discovery is a pure function of repository state (DNA-105).</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<KEY_DECISIONS>
|
|
15
|
+
<item>extract.config.yaml is the publishability fact (operator decision 2026-11-01) — not independentVersionPackages, which lists only packages/forge.</item>
|
|
16
|
+
<item>Basename collision is an error diagnostic, not a silent merge: two dirs would emit the same tag prefix.</item>
|
|
17
|
+
<item>Return carries `diagnostics` next to `lines` — FLOW-VER-02 must reach flow.version's diagnostic surface; the RFC sketch shows only the line list.</item>
|
|
18
|
+
</KEY_DECISIONS>
|
|
19
|
+
<CHANGE_SUMMARY>
|
|
20
|
+
<item>RFC-1488: step 1 — release-line discovery via pnpm-workspace globs + extract.config.yaml</item>
|
|
21
|
+
<item>RFC-1488: step 1 — semver helper + release-line discovery (extract.config.yaml workspace globs)</item>
|
|
22
|
+
<item>RFC-1488: review r1 — parse guard, door/rules metadata, id-exact RFC binding, refname precision, FLOW-09 top-level anchor, test cleanup</item>
|
|
23
|
+
</CHANGE_SUMMARY>
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { basename, join } from "node:path";
|
|
27
|
+
|
|
28
|
+
import picomatch from "picomatch";
|
|
29
|
+
import { parse as parseYaml } from "yaml";
|
|
30
|
+
|
|
31
|
+
import type { Diagnostic, WorkspaceIO } from "../../src/types.ts";
|
|
32
|
+
|
|
33
|
+
export interface ReleaseLine {
|
|
34
|
+
/** "repo" | <package directory basename>, e.g. "forge", "werkstatt-engine". */
|
|
35
|
+
id: string;
|
|
36
|
+
/** "v" | "<id>@". */
|
|
37
|
+
tagPrefix: string;
|
|
38
|
+
/** "package.json" | "<dir>/package.json"; null when the version file is absent. */
|
|
39
|
+
versionFile: string | null;
|
|
40
|
+
/** [] = whole repository; ["packages/forge"] for a package line. */
|
|
41
|
+
paths: string[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ReleaseLinesOutcome {
|
|
45
|
+
lines: ReleaseLine[];
|
|
46
|
+
diagnostics: Diagnostic[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const WORKSPACE_FILE = "pnpm-workspace.yaml";
|
|
50
|
+
const EXTRACT_CONFIG = "extract.config.yaml";
|
|
51
|
+
const GLOB_CHARS = /[*?[{!]/;
|
|
52
|
+
|
|
53
|
+
function diagnostic(ruleId: string, severity: "error" | "warning", message: string): Diagnostic {
|
|
54
|
+
return { ruleId, severity, message };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Split a workspace glob into path segments ("packages/star" → ["packages","*"]). */
|
|
58
|
+
function globSegments(glob: string): string[] {
|
|
59
|
+
return glob.split("/").filter((s) => s.length > 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Expand one workspace glob to concrete directory paths under repoRoot.
|
|
64
|
+
* Wildcard segments enumerate subdirectories; literal segments must exist.
|
|
65
|
+
* `node_modules` is never descended into. Negated globs are handled by the
|
|
66
|
+
* caller (their matches are subtracted afterwards).
|
|
67
|
+
*/
|
|
68
|
+
async function expandGlob(repoRoot: string, glob: string, io: WorkspaceIO): Promise<string[]> {
|
|
69
|
+
const segments = globSegments(glob);
|
|
70
|
+
if (segments.length === 0) return [];
|
|
71
|
+
let candidates = [""];
|
|
72
|
+
for (const segment of segments) {
|
|
73
|
+
const next: string[] = [];
|
|
74
|
+
if (GLOB_CHARS.test(segment)) {
|
|
75
|
+
const matcher = picomatch(segment, { dot: true });
|
|
76
|
+
for (const dir of candidates) {
|
|
77
|
+
const abs = join(repoRoot, dir);
|
|
78
|
+
let entries;
|
|
79
|
+
try {
|
|
80
|
+
entries = await io.readdir(abs);
|
|
81
|
+
} catch {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
if (!entry.isDirectory) continue;
|
|
86
|
+
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
87
|
+
if (!matcher(entry.name)) continue;
|
|
88
|
+
next.push(dir ? `${dir}/${entry.name}` : entry.name);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
for (const dir of candidates) {
|
|
93
|
+
const child = dir ? `${dir}/${segment}` : segment;
|
|
94
|
+
if (await io.exists(join(repoRoot, child))) next.push(child);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
candidates = next;
|
|
98
|
+
}
|
|
99
|
+
// Final picomatch over the full glob so braces/classes in earlier segments
|
|
100
|
+
// cannot admit a directory the whole pattern would not.
|
|
101
|
+
const whole = picomatch(glob, { dot: true });
|
|
102
|
+
return candidates.filter((c) => whole(c));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Discover the release lines of repoRoot. The repository line always exists;
|
|
107
|
+
* package lines come from pnpm-workspace.yaml `packages:` globs where the
|
|
108
|
+
* directory carries `extract.config.yaml`. FLOW-VER-02 names colliding
|
|
109
|
+
* basenames (their tag prefixes would be identical).
|
|
110
|
+
*/
|
|
111
|
+
export async function discoverReleaseLines(
|
|
112
|
+
repoRoot: string,
|
|
113
|
+
io: WorkspaceIO,
|
|
114
|
+
): Promise<ReleaseLinesOutcome> {
|
|
115
|
+
const diagnostics: Diagnostic[] = [];
|
|
116
|
+
|
|
117
|
+
const rootPackageJson = join(repoRoot, "package.json");
|
|
118
|
+
const repoLine: ReleaseLine = {
|
|
119
|
+
id: "repo",
|
|
120
|
+
tagPrefix: "v",
|
|
121
|
+
versionFile: (await io.exists(rootPackageJson)) ? "package.json" : null,
|
|
122
|
+
paths: [],
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const globs: string[] = [];
|
|
126
|
+
const negated: string[] = [];
|
|
127
|
+
if (await io.exists(join(repoRoot, WORKSPACE_FILE))) {
|
|
128
|
+
let parsed: { packages?: unknown } | null = null;
|
|
129
|
+
try {
|
|
130
|
+
parsed = parseYaml(await io.readFile(join(repoRoot, WORKSPACE_FILE))) as
|
|
131
|
+
| { packages?: unknown }
|
|
132
|
+
| null;
|
|
133
|
+
} catch {
|
|
134
|
+
diagnostics.push(
|
|
135
|
+
diagnostic(
|
|
136
|
+
"FLOW-VER-02",
|
|
137
|
+
"error",
|
|
138
|
+
`${WORKSPACE_FILE} is not valid YAML — package lines cannot be discovered`,
|
|
139
|
+
),
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
for (const entry of Array.isArray(parsed?.packages) ? parsed?.packages : []) {
|
|
143
|
+
if (typeof entry !== "string") continue;
|
|
144
|
+
if (entry.startsWith("!")) negated.push(entry.slice(1));
|
|
145
|
+
else globs.push(entry);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const negatedMatchers = negated.map((g) => picomatch(g, { dot: true }));
|
|
150
|
+
const packageDirs = new Set<string>();
|
|
151
|
+
for (const glob of globs) {
|
|
152
|
+
for (const dir of await expandGlob(repoRoot, glob, io)) {
|
|
153
|
+
if (negatedMatchers.some((m) => m(dir))) continue;
|
|
154
|
+
packageDirs.add(dir);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const lines: ReleaseLine[] = [repoLine];
|
|
159
|
+
const byId = new Map<string, string[]>();
|
|
160
|
+
for (const dir of [...packageDirs].sort()) {
|
|
161
|
+
if (!(await io.exists(join(repoRoot, dir, EXTRACT_CONFIG)))) continue;
|
|
162
|
+
const id = basename(dir);
|
|
163
|
+
const group = byId.get(id) ?? [];
|
|
164
|
+
group.push(dir);
|
|
165
|
+
byId.set(id, group);
|
|
166
|
+
}
|
|
167
|
+
for (const [id, members] of [...byId.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
168
|
+
if (members.length > 1) {
|
|
169
|
+
diagnostics.push(
|
|
170
|
+
diagnostic(
|
|
171
|
+
"FLOW-VER-02",
|
|
172
|
+
"error",
|
|
173
|
+
`release-line basename '${id}' is claimed by ${members.join(" and ")} — their tag prefixes would collide`,
|
|
174
|
+
),
|
|
175
|
+
);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
const dir = members[0]!;
|
|
179
|
+
lines.push({
|
|
180
|
+
id,
|
|
181
|
+
tagPrefix: `${id}@`,
|
|
182
|
+
versionFile: (await io.exists(join(repoRoot, dir, "package.json")))
|
|
183
|
+
? `${dir}/package.json`
|
|
184
|
+
: null,
|
|
185
|
+
paths: [dir],
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return { lines, diagnostics };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** The version value a line's version file currently carries, or null. */
|
|
193
|
+
export async function readLineVersionFile(
|
|
194
|
+
repoRoot: string,
|
|
195
|
+
line: ReleaseLine,
|
|
196
|
+
io: WorkspaceIO,
|
|
197
|
+
): Promise<string | null> {
|
|
198
|
+
if (line.versionFile === null) return null;
|
|
199
|
+
const path = join(repoRoot, line.versionFile);
|
|
200
|
+
if (!(await io.exists(path))) return null;
|
|
201
|
+
try {
|
|
202
|
+
const parsed = JSON.parse(await io.readFile(path)) as { version?: unknown };
|
|
203
|
+
return typeof parsed.version === "string" ? parsed.version : null;
|
|
204
|
+
} catch {
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
|
|
32
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
33
|
+
import { git } from "./git.ts";
|
|
34
|
+
import type { ReleaseLine } from "./release-lines.ts";
|
|
35
|
+
import { compareVersions, parseVersion, type SemVer } from "./semver.ts";
|
|
36
|
+
|
|
37
|
+
export interface LineTags {
|
|
38
|
+
/** Highest-version annotated reachable tag matching the line's prefix. */
|
|
39
|
+
lastTag: { name: string; version: SemVer } | null;
|
|
40
|
+
/** All matching annotated reachable tag names, newest first (for evidence). */
|
|
41
|
+
reachable: string[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface TagRow {
|
|
45
|
+
name: string;
|
|
46
|
+
objecttype: string;
|
|
47
|
+
peeled: string;
|
|
48
|
+
creatordate: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const NULL_FIELD = "";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Annotated tags reachable from HEAD matching `line.tagPrefix`, newest first.
|
|
55
|
+
* Format: `<refname:short>\x1f<objecttype>\x1f<*objectname>\x1f<creatordate>`.
|
|
56
|
+
* Lightweight tags (`objecttype` = commit/blob) are dropped; a non-semver
|
|
57
|
+
* suffix after the prefix (e.g. `v-next`) is dropped too.
|
|
58
|
+
*/
|
|
59
|
+
async function listAnnotated(
|
|
60
|
+
repoRoot: string,
|
|
61
|
+
line: ReleaseLine,
|
|
62
|
+
io: WorkspaceIO,
|
|
63
|
+
ref: string,
|
|
64
|
+
): Promise<TagRow[]> {
|
|
65
|
+
const head = await git(repoRoot, io, ["rev-parse", "--verify", "-q", ref]);
|
|
66
|
+
if (head.exitCode !== 0) return []; // unborn branch — nothing reachable
|
|
67
|
+
const sep = "\x1f";
|
|
68
|
+
// %(refname) (full form) — %(refname:short) would hide a tag sharing its
|
|
69
|
+
// name with a branch (shortening is ambiguous by design).
|
|
70
|
+
const format = `%(refname)${sep}%(objecttype)${sep}%(*objectname)${sep}%(creatordate:iso-strict)`;
|
|
71
|
+
const result = await git(repoRoot, io, [
|
|
72
|
+
"for-each-ref",
|
|
73
|
+
`refs/tags/${line.tagPrefix}*`,
|
|
74
|
+
`--format=${format}`,
|
|
75
|
+
"--sort=-creatordate",
|
|
76
|
+
"--merged",
|
|
77
|
+
ref,
|
|
78
|
+
]);
|
|
79
|
+
if (result.exitCode !== 0) return [];
|
|
80
|
+
const rows: TagRow[] = [];
|
|
81
|
+
for (const raw of result.stdout.split("\n")) {
|
|
82
|
+
const line_ = raw.trimEnd();
|
|
83
|
+
if (!line_) continue;
|
|
84
|
+
const [refname = "", objecttype = "", peeled = "", creatordate = ""] = line_.split(sep);
|
|
85
|
+
if (objecttype !== "tag") continue; // annotated only
|
|
86
|
+
const name = refname.startsWith("refs/tags/") ? refname.slice("refs/tags/".length) : refname;
|
|
87
|
+
const versionText = name.startsWith(line.tagPrefix)
|
|
88
|
+
? name.slice(line.tagPrefix.length)
|
|
89
|
+
: NULL_FIELD;
|
|
90
|
+
if (!versionText || parseVersion(versionText) === null) continue;
|
|
91
|
+
rows.push({ name, objecttype, peeled, creatordate });
|
|
92
|
+
}
|
|
93
|
+
return rows;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Read a line's tag state: `lastTag` is the highest-version annotated
|
|
98
|
+
* reachable tag for its prefix, `reachable` the full matching set newest
|
|
99
|
+
* first. Null/empty when the line was never tagged.
|
|
100
|
+
*/
|
|
101
|
+
export async function listLineTags(
|
|
102
|
+
repoRoot: string,
|
|
103
|
+
line: ReleaseLine,
|
|
104
|
+
io: WorkspaceIO,
|
|
105
|
+
ref = "HEAD",
|
|
106
|
+
): Promise<LineTags> {
|
|
107
|
+
const rows = await listAnnotated(repoRoot, line, io, ref);
|
|
108
|
+
let lastTag: LineTags["lastTag"] = null;
|
|
109
|
+
for (const row of rows) {
|
|
110
|
+
const version = parseVersion(row.name.slice(line.tagPrefix.length));
|
|
111
|
+
if (version === null) continue;
|
|
112
|
+
if (lastTag === null || compareVersions(version, lastTag.version) > 0) {
|
|
113
|
+
lastTag = { name: row.name, version };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { lastTag, reachable: rows.map((r) => r.name) };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface LegacyTag {
|
|
120
|
+
/** Full tag name, e.g. v1.2.2 or lib@0.1.0. */
|
|
121
|
+
name: string;
|
|
122
|
+
/** Release-line id whose tag grammar the name matches. */
|
|
123
|
+
line: string;
|
|
124
|
+
/**
|
|
125
|
+
* Why the release-line reader does not treat it as a line tag:
|
|
126
|
+
* lightweight tags are invisible by design; an annotated tag without
|
|
127
|
+
* the forge/release-tag@1 schema line predates the program.
|
|
128
|
+
*/
|
|
129
|
+
kind: "lightweight" | "annotated-without-schema";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const RELEASE_TAG_SCHEMA_LINE = /^schema:\s*forge\/release-tag@1\s*$/m;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Pre-program tags (RFC-1498): every tag whose name matches a discovered
|
|
136
|
+
* line's grammar (tagPrefix + strict semver) but that the release-line
|
|
137
|
+
* reader does not honour — lightweight tags, and annotated tags whose
|
|
138
|
+
* body lacks the `schema: forge/release-tag@1` line. One `for-each-ref`
|
|
139
|
+
* pass; %00 delimits records because %(contents) is multi-line.
|
|
140
|
+
*/
|
|
141
|
+
export async function listLegacyTags(
|
|
142
|
+
repoRoot: string,
|
|
143
|
+
lines: ReleaseLine[],
|
|
144
|
+
io: WorkspaceIO,
|
|
145
|
+
): Promise<LegacyTag[]> {
|
|
146
|
+
const sep = "\x1f";
|
|
147
|
+
const format = `%(refname)${sep}%(objecttype)${sep}%(contents)%00`;
|
|
148
|
+
const result = await git(repoRoot, io, ["for-each-ref", "refs/tags", `--format=${format}`]);
|
|
149
|
+
if (result.exitCode !== 0) return [];
|
|
150
|
+
const legacy: LegacyTag[] = [];
|
|
151
|
+
for (const rec of result.stdout.split("\x00")) {
|
|
152
|
+
const firstSep = rec.indexOf(sep);
|
|
153
|
+
const secondSep = firstSep === -1 ? -1 : rec.indexOf(sep, firstSep + 1);
|
|
154
|
+
if (firstSep === -1 || secondSep === -1) continue;
|
|
155
|
+
const refname = rec.slice(0, firstSep).replace(/^\s+/, "");
|
|
156
|
+
const objecttype = rec.slice(firstSep + 1, secondSep);
|
|
157
|
+
const contents = rec.slice(secondSep + 1);
|
|
158
|
+
const name = refname.startsWith("refs/tags/") ? refname.slice("refs/tags/".length) : refname;
|
|
159
|
+
const line = lines.find(
|
|
160
|
+
(l) =>
|
|
161
|
+
name.startsWith(l.tagPrefix) &&
|
|
162
|
+
parseVersion(name.slice(l.tagPrefix.length)) !== null,
|
|
163
|
+
);
|
|
164
|
+
if (line === undefined) continue;
|
|
165
|
+
if (objecttype === "tag") {
|
|
166
|
+
if (!RELEASE_TAG_SCHEMA_LINE.test(contents)) {
|
|
167
|
+
legacy.push({ name, line: line.id, kind: "annotated-without-schema" });
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
legacy.push({ name, line: line.id, kind: "lightweight" });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return legacy;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Short (9-char) form of a full commit hash — derived-version metadata. */
|
|
177
|
+
export function shortHash(hash: string): string {
|
|
178
|
+
return hash.slice(0, 9);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* forge/release-tag@1 annotation body (RFC-1488). `previous`/`rfcs`/`fingerprints`
|
|
183
|
+
* come from the cut's pendingLevel and the fingerprint hook.
|
|
184
|
+
*/
|
|
185
|
+
export function releaseTagAnnotation(fields: {
|
|
186
|
+
tag: string;
|
|
187
|
+
line: string;
|
|
188
|
+
version: string;
|
|
189
|
+
level: string;
|
|
190
|
+
previous: string | null;
|
|
191
|
+
rfcs: string[];
|
|
192
|
+
fingerprints: Record<string, string>;
|
|
193
|
+
}): string {
|
|
194
|
+
const fp = Object.entries(fields.fingerprints)
|
|
195
|
+
.map(([k, v]) => ` ${k}: ${/^[A-Za-z0-9._/+@-]+$/.test(v) ? v : JSON.stringify(v)}`)
|
|
196
|
+
.join("\n");
|
|
197
|
+
return [
|
|
198
|
+
`release ${fields.tag}`,
|
|
199
|
+
"",
|
|
200
|
+
"schema: forge/release-tag@1",
|
|
201
|
+
`line: ${fields.line}`,
|
|
202
|
+
`version: ${fields.version}`,
|
|
203
|
+
`level: ${fields.level}`,
|
|
204
|
+
`previous: ${fields.previous ?? "null"}`,
|
|
205
|
+
`rfcs: [${fields.rfcs.map((r) => `"${r}"`).join(", ")}]`,
|
|
206
|
+
fp.length > 0 ? `fingerprints:\n${fp}` : "fingerprints: {}",
|
|
207
|
+
].join("\n");
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface ReleaseTagSpec {
|
|
211
|
+
/** Full tag name, e.g. v1.3.0 or lib@2.1.0. */
|
|
212
|
+
name: string;
|
|
213
|
+
/** Commit the tag points at. */
|
|
214
|
+
target: string;
|
|
215
|
+
/** Full annotation text (the forge/release-tag@1 body). */
|
|
216
|
+
annotation: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Create an annotated release tag at `target` with the given annotation
|
|
221
|
+
* body via `git tag -a <name> <target> -m <annotation>`. Callers build the
|
|
222
|
+
* forge/release-tag@1 text; this is the single tag-writing seam (flow.install
|
|
223
|
+
* baselines and flow.cut releases share it).
|
|
224
|
+
*/
|
|
225
|
+
export async function writeReleaseTag(
|
|
226
|
+
repoRoot: string,
|
|
227
|
+
io: WorkspaceIO,
|
|
228
|
+
spec: ReleaseTagSpec,
|
|
229
|
+
): Promise<{ exitCode: number | null; stderr: string }> {
|
|
230
|
+
const result = await git(repoRoot, io, ["tag", "-a", spec.name, spec.target, "-m", spec.annotation]);
|
|
231
|
+
return { exitCode: result.exitCode, stderr: result.stderr };
|
|
232
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
|
|
23
|
+
import { join } from "node:path";
|
|
24
|
+
|
|
25
|
+
import { parse as yamlParse } from "yaml";
|
|
26
|
+
import { z } from "zod";
|
|
27
|
+
|
|
28
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
29
|
+
|
|
30
|
+
import { isBare } from "./git.ts";
|
|
31
|
+
|
|
32
|
+
export const GENERATED_MARKER_FILE = "forge.generated.yaml";
|
|
33
|
+
export const FORGE_CONFIG_FILE = "forge.yaml";
|
|
34
|
+
|
|
35
|
+
export const generatedMarkerSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
schema: z.literal("forge/generated@1"),
|
|
38
|
+
generator: z.string().min(1),
|
|
39
|
+
source: z.string().min(1),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
export type GeneratedMarker = z.infer<typeof generatedMarkerSchema>;
|
|
43
|
+
|
|
44
|
+
export type RepoKind =
|
|
45
|
+
| { kind: "governed" } // forge.yaml present, no marker
|
|
46
|
+
| { kind: "exempt"; marker: GeneratedMarker }
|
|
47
|
+
| { kind: "ungoverned" }; // no forge.yaml
|
|
48
|
+
|
|
49
|
+
export type RepoKindDetection =
|
|
50
|
+
| { ok: true; repoKind: RepoKind }
|
|
51
|
+
/** The marker exists but fails forge/generated@1 — FLOW-05 material. */
|
|
52
|
+
| { ok: false; reason: "invalid-marker"; detail: string };
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Detect the repository kind from committed/working state only (DNA-105) —
|
|
56
|
+
* the working-tree marker for non-bare repositories, `HEAD:<file>` for bare
|
|
57
|
+
* ones. Never consults process-global state.
|
|
58
|
+
*/
|
|
59
|
+
export async function detectRepoKind(
|
|
60
|
+
repoRoot: string,
|
|
61
|
+
io: WorkspaceIO,
|
|
62
|
+
): Promise<RepoKindDetection> {
|
|
63
|
+
const bare = await isBare(repoRoot, io);
|
|
64
|
+
const markerText = await readRepoRootFile(repoRoot, GENERATED_MARKER_FILE, io, bare);
|
|
65
|
+
if (markerText !== null) {
|
|
66
|
+
let markerData: unknown;
|
|
67
|
+
try {
|
|
68
|
+
markerData = yamlParse(markerText);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
ok: false,
|
|
72
|
+
reason: "invalid-marker",
|
|
73
|
+
detail: `${GENERATED_MARKER_FILE} is not parseable YAML: ${error instanceof Error ? error.message : String(error)}`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const parsed = generatedMarkerSchema.safeParse(markerData);
|
|
77
|
+
if (!parsed.success) {
|
|
78
|
+
return {
|
|
79
|
+
ok: false,
|
|
80
|
+
reason: "invalid-marker",
|
|
81
|
+
detail: `${GENERATED_MARKER_FILE} fails the forge/generated@1 schema: ${parsed.error.issues
|
|
82
|
+
.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`)
|
|
83
|
+
.join("; ")}`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return { ok: true, repoKind: { kind: "exempt", marker: parsed.data } };
|
|
87
|
+
}
|
|
88
|
+
const forgeConfig = await readRepoRootFile(repoRoot, FORGE_CONFIG_FILE, io, bare);
|
|
89
|
+
return {
|
|
90
|
+
ok: true,
|
|
91
|
+
repoKind: forgeConfig !== null ? { kind: "governed" } : { kind: "ungoverned" },
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Read a file at the repository top level: from the working tree for non-bare
|
|
97
|
+
* repositories, from `git show HEAD:<name>` for bare ones. Returns null when
|
|
98
|
+
* the file does not exist.
|
|
99
|
+
*/
|
|
100
|
+
export async function readRepoRootFile(
|
|
101
|
+
repoRoot: string,
|
|
102
|
+
name: string,
|
|
103
|
+
io: WorkspaceIO,
|
|
104
|
+
bare: boolean,
|
|
105
|
+
): Promise<string | null> {
|
|
106
|
+
if (bare) {
|
|
107
|
+
// Adoption state lives on develop in the fixed branch model — HEAD on a
|
|
108
|
+
// bare repository may point at main, which carries no markers/hooks.
|
|
109
|
+
for (const ref of ["refs/heads/develop", "HEAD"]) {
|
|
110
|
+
const result = await io.exec("git", ["-C", repoRoot, "show", `${ref}:${name}`]);
|
|
111
|
+
if (result.exitCode === 0) return result.stdout;
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const path = join(repoRoot, name);
|
|
116
|
+
return (await io.exists(path)) ? io.readFile(path) : null;
|
|
117
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
|
|
27
|
+
import type { WorkspaceIO } from "../../src/types.ts";
|
|
28
|
+
|
|
29
|
+
export type FlowScriptName =
|
|
30
|
+
| "worktree-setup"
|
|
31
|
+
| "integration-gate"
|
|
32
|
+
| "worktree-teardown"
|
|
33
|
+
| "release-prepare"
|
|
34
|
+
| "release-fingerprints"
|
|
35
|
+
| "extract-verify";
|
|
36
|
+
|
|
37
|
+
export interface FlowScriptResult {
|
|
38
|
+
status: "done" | "skipped" | "failed";
|
|
39
|
+
exitCode: number | null;
|
|
40
|
+
stderrTail: string;
|
|
41
|
+
/** stdout truncated to 64 KiB with a trailing `…[truncated]` marker. */
|
|
42
|
+
stdout: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const STDERR_TAIL_LINES = 40;
|
|
46
|
+
const STDOUT_CAP = 64 * 1024;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Run `<primary>/hooks/<name>.sh` with cwd inside `cwd` (the branch
|
|
50
|
+
* worktree). The script bytes always come from the primary checkout — the
|
|
51
|
+
* develop version, already integrated.
|
|
52
|
+
*/
|
|
53
|
+
export async function runFlowScript(
|
|
54
|
+
io: WorkspaceIO,
|
|
55
|
+
name: FlowScriptName,
|
|
56
|
+
opts: { primary: string; cwd: string; env: Record<string, string> },
|
|
57
|
+
): Promise<FlowScriptResult> {
|
|
58
|
+
const scriptPath = join(opts.primary, "hooks", `${name}.sh`);
|
|
59
|
+
if (!(await io.exists(scriptPath))) {
|
|
60
|
+
return { status: "skipped", exitCode: null, stderrTail: "", stdout: "" };
|
|
61
|
+
}
|
|
62
|
+
const result = await io.exec("sh", [scriptPath], { cwd: opts.cwd, env: opts.env });
|
|
63
|
+
const tail = result.stderr
|
|
64
|
+
.split("\n")
|
|
65
|
+
.filter((line) => line.length > 0)
|
|
66
|
+
.slice(-STDERR_TAIL_LINES)
|
|
67
|
+
.join("\n");
|
|
68
|
+
const stdout =
|
|
69
|
+
result.stdout.length > STDOUT_CAP
|
|
70
|
+
? `${result.stdout.slice(0, STDOUT_CAP)}…[truncated]`
|
|
71
|
+
: result.stdout;
|
|
72
|
+
return result.exitCode === 0
|
|
73
|
+
? { status: "done", exitCode: result.exitCode, stderrTail: tail, stdout }
|
|
74
|
+
: { status: "failed", exitCode: result.exitCode, stderrTail: tail, stdout };
|
|
75
|
+
}
|