@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,152 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Task-queue schemas for the system repository (RFC-1509): the
|
|
4
|
+
forge/system-task@1 task file, forge/dispatch-brief@1 brief frontmatter and
|
|
5
|
+
forge/task-report@1 product report, plus the task state machine expressed as
|
|
6
|
+
data. Every object is strict — a typo in a task file is a SYSTEM-TASK-01/08
|
|
7
|
+
diagnostic, never silently stripped.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No store or handler logic — schemas and the transition table only.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1509: step 2 — task schemas and transition table</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 { z } from "zod";
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// States, kinds, transitions
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
export const TASK_STATES = [
|
|
23
|
+
"proposed",
|
|
24
|
+
"ready",
|
|
25
|
+
"dispatched",
|
|
26
|
+
"reported",
|
|
27
|
+
"integrated",
|
|
28
|
+
"verified",
|
|
29
|
+
"done",
|
|
30
|
+
"failed",
|
|
31
|
+
"parked",
|
|
32
|
+
"cancelled",
|
|
33
|
+
];
|
|
34
|
+
export const TASK_KINDS = [
|
|
35
|
+
"change",
|
|
36
|
+
"adoption",
|
|
37
|
+
"dependency-update",
|
|
38
|
+
"verification",
|
|
39
|
+
];
|
|
40
|
+
/** The RFC-1509 transition table, as data. Any pair absent here is SYSTEM-TASK-02. */
|
|
41
|
+
export const TASK_TRANSITIONS = [
|
|
42
|
+
{ from: "proposed", to: "ready", owner: "move" },
|
|
43
|
+
{ from: "proposed", to: "cancelled", owner: "move", needsReason: true },
|
|
44
|
+
{ from: "ready", to: "dispatched", owner: "dispatch" },
|
|
45
|
+
{ from: "ready", to: "parked", owner: "move", needsReason: true },
|
|
46
|
+
{ from: "failed", to: "parked", owner: "move", needsReason: true },
|
|
47
|
+
{ from: "parked", to: "ready", owner: "move" },
|
|
48
|
+
{ from: "dispatched", to: "reported", owner: "collect" },
|
|
49
|
+
{ from: "dispatched", to: "failed", owner: "collect" },
|
|
50
|
+
{ from: "reported", to: "integrated", owner: "collect" },
|
|
51
|
+
{ from: "reported", to: "ready", owner: "move", needsReason: true },
|
|
52
|
+
{ from: "failed", to: "ready", owner: "move" },
|
|
53
|
+
{ from: "integrated", to: "verified", owner: "move" },
|
|
54
|
+
{ from: "verified", to: "done", owner: "move" },
|
|
55
|
+
];
|
|
56
|
+
export function findTransition(from, to) {
|
|
57
|
+
return TASK_TRANSITIONS.find((t) => t.from === from && t.to === to) ?? null;
|
|
58
|
+
}
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// forge/system-task@1
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
export const TASK_ID_RE = /^T-\d{4}$/;
|
|
63
|
+
export const systemTaskSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
schema: z.literal("forge/system-task@1"),
|
|
66
|
+
id: z.string().regex(TASK_ID_RE),
|
|
67
|
+
title: z.string().min(1),
|
|
68
|
+
product: z.string().min(1),
|
|
69
|
+
slug: z
|
|
70
|
+
.string()
|
|
71
|
+
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/)
|
|
72
|
+
.min(3)
|
|
73
|
+
.max(48),
|
|
74
|
+
kind: z.enum(TASK_KINDS),
|
|
75
|
+
state: z.enum(TASK_STATES),
|
|
76
|
+
origin: z
|
|
77
|
+
.object({
|
|
78
|
+
kind: z.enum(["operator", "outbox", "decision", "scenario"]),
|
|
79
|
+
ref: z.string().nullable(),
|
|
80
|
+
})
|
|
81
|
+
.strict(),
|
|
82
|
+
contracts: z.array(z.string().min(1)).default([]),
|
|
83
|
+
dependsOn: z.array(z.string().regex(TASK_ID_RE)).default([]),
|
|
84
|
+
brief: z.string().min(1),
|
|
85
|
+
briefSha256: z.string().nullable(),
|
|
86
|
+
dispatch: z
|
|
87
|
+
.object({
|
|
88
|
+
branch: z.string().min(1),
|
|
89
|
+
worktree: z.string().min(1),
|
|
90
|
+
baseCommit: z.string().min(1),
|
|
91
|
+
dispatchedAt: z.string().min(1),
|
|
92
|
+
})
|
|
93
|
+
.strict()
|
|
94
|
+
.nullable(),
|
|
95
|
+
report: z.string().nullable(),
|
|
96
|
+
integratedCommit: z.string().nullable(),
|
|
97
|
+
history: z.array(z
|
|
98
|
+
.object({
|
|
99
|
+
at: z.string(),
|
|
100
|
+
from: z.string(),
|
|
101
|
+
to: z.string(),
|
|
102
|
+
by: z.string(),
|
|
103
|
+
reason: z.string().optional(),
|
|
104
|
+
})
|
|
105
|
+
.strict()),
|
|
106
|
+
})
|
|
107
|
+
.strict();
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// forge/dispatch-brief@1 — frontmatter of queue/briefs/<id>.md
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
export const dispatchBriefFrontmatterSchema = z
|
|
112
|
+
.object({
|
|
113
|
+
schema: z.literal("forge/dispatch-brief@1"),
|
|
114
|
+
task: z.string().regex(TASK_ID_RE),
|
|
115
|
+
product: z.string().min(1),
|
|
116
|
+
goal: z.string().min(1),
|
|
117
|
+
acceptance: z
|
|
118
|
+
.array(z
|
|
119
|
+
.object({ claim: z.string().min(1), check: z.string().min(1) })
|
|
120
|
+
.strict())
|
|
121
|
+
.min(1),
|
|
122
|
+
constraints: z.array(z.string()).default([]),
|
|
123
|
+
})
|
|
124
|
+
.strict();
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
// forge/task-report@1 — .forge/task/report.yaml in the product worktree
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
export const taskReportSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
schema: z.literal("forge/task-report@1"),
|
|
131
|
+
task: z.string().regex(TASK_ID_RE),
|
|
132
|
+
outcome: z.enum(["done", "blocked", "needs-decision"]),
|
|
133
|
+
summary: z.string().min(1),
|
|
134
|
+
commits: z.array(z.string()).default([]),
|
|
135
|
+
gate: z.enum(["pass", "fail", "not-run"]),
|
|
136
|
+
acceptance: z
|
|
137
|
+
.array(z.object({ claim: z.string(), evidence: z.string() }).strict())
|
|
138
|
+
.default([]),
|
|
139
|
+
outbox: z.array(z.string()).default([]),
|
|
140
|
+
question: z.string().optional(),
|
|
141
|
+
})
|
|
142
|
+
.strict()
|
|
143
|
+
.superRefine((report, ctx) => {
|
|
144
|
+
if (report.outcome === "needs-decision" && (!report.question || report.question.trim() === "")) {
|
|
145
|
+
ctx.addIssue({
|
|
146
|
+
code: "custom",
|
|
147
|
+
path: ["question"],
|
|
148
|
+
message: "question is required when outcome is needs-decision",
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=task-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-schemas.js","sourceRoot":"","sources":["../../../os/system/task-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAEF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAE9E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU;IACV,OAAO;IACP,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,UAAU;IACV,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;CACH,CAAC;AAGX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,UA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KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACzC,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;SACrE,OAAO,CAAC,EAAE,CAAC;IACd,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,MAAM,EAAE;KACR,WAAW,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;IAC3B,IAAI,MAAM,CAAC,OAAO,KAAK,gBAAgB,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC/F,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,OAAO,EAAE,qDAAqD;SAC/D,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Diagnostic, WorkspaceIO } from "../../src/types.ts";
|
|
2
|
+
import { type SystemTask } from "./task-schemas.ts";
|
|
3
|
+
export declare const TASKS_DIR = "queue/tasks";
|
|
4
|
+
export declare const BRIEFS_DIR = "queue/briefs";
|
|
5
|
+
export declare const REPORTS_DIR = "queue/reports";
|
|
6
|
+
export declare function taskFilePath(root: string, id: string): string;
|
|
7
|
+
export declare function briefFilePath(root: string, id: string): string;
|
|
8
|
+
export declare function reportFilePath(root: string, id: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Read one task file. SYSTEM-TASK-01 when the file is missing or fails the
|
|
11
|
+
* forge/system-task@1 schema — never throws on malformed input.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readTask(root: string, io: WorkspaceIO, id: string): Promise<{
|
|
14
|
+
task: SystemTask | null;
|
|
15
|
+
diagnostic: Diagnostic | null;
|
|
16
|
+
}>;
|
|
17
|
+
/** Write a task file (creates queue/tasks/ when absent). */
|
|
18
|
+
export declare function writeTask(root: string, io: WorkspaceIO, task: SystemTask): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* List every task file under queue/tasks/. Files that fail the schema are
|
|
21
|
+
* reported as SYSTEM-TASK-01 diagnostics and skipped — the listing itself
|
|
22
|
+
* never throws.
|
|
23
|
+
*/
|
|
24
|
+
export declare function listTasks(root: string, io: WorkspaceIO): Promise<{
|
|
25
|
+
tasks: SystemTask[];
|
|
26
|
+
diagnostics: Diagnostic[];
|
|
27
|
+
}>;
|
|
28
|
+
/** Highest T-NNNN in queue/tasks/ plus one, zero-padded to four digits. */
|
|
29
|
+
export declare function nextTaskId(root: string, io: WorkspaceIO): Promise<string>;
|
|
30
|
+
export interface LoadedBrief {
|
|
31
|
+
/** Full markdown content — written verbatim into the product worktree. */
|
|
32
|
+
content: string;
|
|
33
|
+
/** Parsed frontmatter, or null when the file fails to parse/validate. */
|
|
34
|
+
frontmatter: Record<string, unknown> | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Read queue/briefs/<id>.md and split out the YAML frontmatter block. Returns
|
|
38
|
+
* null when the file is absent.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readBrief(root: string, io: WorkspaceIO, id: string): Promise<LoadedBrief | null>;
|
|
41
|
+
//# sourceMappingURL=task-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-store.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C,CAU/E;AAMD,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,WAAW,EACf,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAiB7B"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>File store for the system task queue (RFC-1509): read/write/list of
|
|
4
|
+
queue/tasks/T-NNNN.yaml files (forge/system-task@1), the next-id allocator,
|
|
5
|
+
the dispatch-brief reader/writer and the report copy. All mutation paths go
|
|
6
|
+
through the injected WorkspaceIO so kernel callers stay on the recording
|
|
7
|
+
adapter.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No transition checks — handlers own the table lookups.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1509: step 2 — task store (read/write/list/next-id, brief IO)</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 path from "node:path";
|
|
19
|
+
import YAML from "yaml";
|
|
20
|
+
import { systemTaskSchema, TASK_ID_RE } from "./task-schemas.js";
|
|
21
|
+
export const TASKS_DIR = "queue/tasks";
|
|
22
|
+
export const BRIEFS_DIR = "queue/briefs";
|
|
23
|
+
export const REPORTS_DIR = "queue/reports";
|
|
24
|
+
export function taskFilePath(root, id) {
|
|
25
|
+
return path.join(root, TASKS_DIR, `${id}.yaml`);
|
|
26
|
+
}
|
|
27
|
+
export function briefFilePath(root, id) {
|
|
28
|
+
return path.join(root, BRIEFS_DIR, `${id}.md`);
|
|
29
|
+
}
|
|
30
|
+
export function reportFilePath(root, id) {
|
|
31
|
+
return path.join(root, REPORTS_DIR, `${id}.yaml`);
|
|
32
|
+
}
|
|
33
|
+
function taskDiag(ruleId, message, file) {
|
|
34
|
+
return { ruleId, severity: "error", message, file };
|
|
35
|
+
}
|
|
36
|
+
function schemaIssues(error) {
|
|
37
|
+
return error.issues
|
|
38
|
+
.map((issue) => `${issue.path.map(String).join(".") || "(root)"}: ${issue.message}`)
|
|
39
|
+
.join("; ");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Read one task file. SYSTEM-TASK-01 when the file is missing or fails the
|
|
43
|
+
* forge/system-task@1 schema — never throws on malformed input.
|
|
44
|
+
*/
|
|
45
|
+
export async function readTask(root, io, id) {
|
|
46
|
+
const file = taskFilePath(root, id);
|
|
47
|
+
if (!(await io.exists(file))) {
|
|
48
|
+
return {
|
|
49
|
+
task: null,
|
|
50
|
+
diagnostic: taskDiag("SYSTEM-TASK-01", `unknown task ${id} — no file at ${path.relative(root, file)}`, path.relative(root, file)),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
let raw;
|
|
54
|
+
try {
|
|
55
|
+
raw = YAML.parse(await io.readFile(file));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return {
|
|
59
|
+
task: null,
|
|
60
|
+
diagnostic: taskDiag("SYSTEM-TASK-01", `${path.relative(root, file)} is not parseable YAML: ${error instanceof Error ? error.message : String(error)}`, path.relative(root, file)),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const parsed = systemTaskSchema.safeParse(raw);
|
|
64
|
+
if (!parsed.success) {
|
|
65
|
+
return {
|
|
66
|
+
task: null,
|
|
67
|
+
diagnostic: taskDiag("SYSTEM-TASK-01", `${path.relative(root, file)} fails forge/system-task@1: ${schemaIssues(parsed.error)}`, path.relative(root, file)),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return { task: parsed.data, diagnostic: null };
|
|
71
|
+
}
|
|
72
|
+
/** Write a task file (creates queue/tasks/ when absent). */
|
|
73
|
+
export async function writeTask(root, io, task) {
|
|
74
|
+
const file = taskFilePath(root, task.id);
|
|
75
|
+
await io.mkdir(path.dirname(file));
|
|
76
|
+
await io.writeFile(file, YAML.stringify(task));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* List every task file under queue/tasks/. Files that fail the schema are
|
|
80
|
+
* reported as SYSTEM-TASK-01 diagnostics and skipped — the listing itself
|
|
81
|
+
* never throws.
|
|
82
|
+
*/
|
|
83
|
+
export async function listTasks(root, io) {
|
|
84
|
+
const dir = path.join(root, TASKS_DIR);
|
|
85
|
+
const tasks = [];
|
|
86
|
+
const diagnostics = [];
|
|
87
|
+
if (!(await io.exists(dir)))
|
|
88
|
+
return { tasks, diagnostics };
|
|
89
|
+
const entries = await io.readdir(dir);
|
|
90
|
+
for (const entry of entries) {
|
|
91
|
+
if (!entry.isFile || !entry.name.endsWith(".yaml"))
|
|
92
|
+
continue;
|
|
93
|
+
const id = entry.name.slice(0, -".yaml".length);
|
|
94
|
+
if (!TASK_ID_RE.test(id))
|
|
95
|
+
continue;
|
|
96
|
+
const { task, diagnostic } = await readTask(root, io, id);
|
|
97
|
+
if (diagnostic)
|
|
98
|
+
diagnostics.push(diagnostic);
|
|
99
|
+
if (task)
|
|
100
|
+
tasks.push(task);
|
|
101
|
+
}
|
|
102
|
+
tasks.sort((a, b) => a.id.localeCompare(b.id));
|
|
103
|
+
return { tasks, diagnostics };
|
|
104
|
+
}
|
|
105
|
+
/** Highest T-NNNN in queue/tasks/ plus one, zero-padded to four digits. */
|
|
106
|
+
export async function nextTaskId(root, io) {
|
|
107
|
+
const dir = path.join(root, TASKS_DIR);
|
|
108
|
+
let max = 0;
|
|
109
|
+
if (await io.exists(dir)) {
|
|
110
|
+
for (const entry of await io.readdir(dir)) {
|
|
111
|
+
const m = /^T-(\d{4})\.yaml$/.exec(entry.name);
|
|
112
|
+
if (m)
|
|
113
|
+
max = Math.max(max, Number(m[1]));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return `T-${String(max + 1).padStart(4, "0")}`;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Read queue/briefs/<id>.md and split out the YAML frontmatter block. Returns
|
|
120
|
+
* null when the file is absent.
|
|
121
|
+
*/
|
|
122
|
+
export async function readBrief(root, io, id) {
|
|
123
|
+
const file = briefFilePath(root, id);
|
|
124
|
+
if (!(await io.exists(file)))
|
|
125
|
+
return null;
|
|
126
|
+
const content = await io.readFile(file);
|
|
127
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(content);
|
|
128
|
+
let frontmatter = null;
|
|
129
|
+
if (match) {
|
|
130
|
+
try {
|
|
131
|
+
const parsed = YAML.parse(match[1]);
|
|
132
|
+
if (parsed !== null && typeof parsed === "object") {
|
|
133
|
+
frontmatter = parsed;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
frontmatter = null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return { content, frontmatter };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=task-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-store.js","sourceRoot":"","sources":["../../../os/system/task-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAEF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AAElF,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC;AACvC,MAAM,CAAC,MAAM,UAA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CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,wCAAwC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,IAAI,WAAW,GAAmC,IAAI,CAAC;IACvD,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAClD,WAAW,GAAG,MAAiC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,WAAW,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ForgeRuntimeContext } from "../../../src/types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Write a temporary repository: `forge.yaml` declares `profile: system`
|
|
4
|
+
* (overridable via files["forge.yaml"]) plus every entry in `files` at its
|
|
5
|
+
* repo-relative path. Returns the repo root.
|
|
6
|
+
*/
|
|
7
|
+
export declare function makeSystemRepo(files?: Record<string, string>): Promise<string>;
|
|
8
|
+
export declare function makeContext(root: string): ForgeRuntimeContext;
|
|
9
|
+
export declare const VALID_SYSTEM_YAML = "schema: forge/system@1\nid: demo-system\nname: Demo System\nowners:\n - ops\n";
|
|
10
|
+
export declare const VALID_PRODUCTS_YAML = "schema: forge/system-products@1\nproducts:\n - id: alpha\n remote: https://example.invalid/alpha.git\n offers:\n - alpha-contract\n - id: beta\n remote: https://example.invalid/beta.git\n offers: []\n";
|
|
11
|
+
export declare const VALID_EDGES_YAML = "schema: forge/system-edges@1\nallowed:\n - consumer: beta\n contract: alpha-contract\nforbidden: []\n";
|
|
12
|
+
/**
|
|
13
|
+
* A fully valid repository: all three map files plus a products.local.yaml
|
|
14
|
+
* mapping both products to existing folders (created via .gitkeep entries).
|
|
15
|
+
*/
|
|
16
|
+
export declare function validMapFiles(): Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Materialize a governed product repository: `git init` on main, a forge.yaml
|
|
19
|
+
* seed commit and a `develop` branch — the minimum openFlowBranchCore asks
|
|
20
|
+
* for. Lives OUTSIDE the system repo so dispatch resolves a real checkout.
|
|
21
|
+
* Returns the absolute product root.
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeProduct(prefix?: string): Promise<string>;
|
|
24
|
+
/** products.local.yaml entry pointing at an absolute product checkout. */
|
|
25
|
+
export declare function localMapFor(entries: Record<string, string>, launcherArgv?: string[]): string;
|
|
26
|
+
/** A minimal forge/system-task@1 file content for fixture seeding. */
|
|
27
|
+
export declare function taskYaml(overrides?: Record<string, unknown>): string;
|
|
28
|
+
/** A ready-state dispatch brief with a real goal. */
|
|
29
|
+
export declare function readyBrief(taskId?: string, product?: string): string;
|
|
30
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../os/system/tests/helpers.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASxF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAQ7D;AAMD,eAAO,MAAM,iBAAiB,mFAK7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,gOAS/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,8GAK5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAetD;AAMD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,MAAM,SAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB5E;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAQ5F;AAED,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,MAAM,CAwBxE;AAED,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,MAAM,SAAW,EAAE,OAAO,SAAU,GAAG,MAAM,CAgBvE"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Test helpers for forge system-module suites (RFC-1508) — makeSystemRepo
|
|
4
|
+
materializes a temporary system-profile repository under os.tmpdir();
|
|
5
|
+
makeContext builds a ForgeRuntimeContext for direct handler invocation;
|
|
6
|
+
canonical YAML fixture strings keep tests focused on the variable under test.</purpose>
|
|
7
|
+
<non-goals>
|
|
8
|
+
<item>Fixtures only — no test assertions here.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<CHANGE_SUMMARY>
|
|
12
|
+
<item>RFC-1508: step 1 — shared system test helpers (RFC-1509..1511 reuse)</item>
|
|
13
|
+
<item>RFC-1508: implement RFC-1508 — system profile, system map schemas and system.map.validate</item>
|
|
14
|
+
<item>RFC-1508: align rfc-1508 schemas with the normative contract after review r1</item>
|
|
15
|
+
<item>RFC-1509: implement RFC-1509 — system task queue, dispatch briefs and task reports</item>
|
|
16
|
+
</CHANGE_SUMMARY>
|
|
17
|
+
*/
|
|
18
|
+
// @vitest-environment node
|
|
19
|
+
import { mkdtemp, mkdir, writeFile } from "node:fs/promises";
|
|
20
|
+
import os from "node:os";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
/**
|
|
23
|
+
* Write a temporary repository: `forge.yaml` declares `profile: system`
|
|
24
|
+
* (overridable via files["forge.yaml"]) plus every entry in `files` at its
|
|
25
|
+
* repo-relative path. Returns the repo root.
|
|
26
|
+
*/
|
|
27
|
+
export async function makeSystemRepo(files = {}) {
|
|
28
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "forge-system-"));
|
|
29
|
+
const all = { "forge.yaml": "profile: system\n", ...files };
|
|
30
|
+
for (const [rel, content] of Object.entries(all)) {
|
|
31
|
+
const abs = path.join(root, rel);
|
|
32
|
+
await mkdir(path.dirname(abs), { recursive: true });
|
|
33
|
+
await writeFile(abs, content);
|
|
34
|
+
}
|
|
35
|
+
return root;
|
|
36
|
+
}
|
|
37
|
+
export function makeContext(root) {
|
|
38
|
+
const sink = (_msg, _details) => { };
|
|
39
|
+
return {
|
|
40
|
+
workspaceRoot: root,
|
|
41
|
+
logger: { section: sink, info: sink, warn: sink, error: sink, success: sink },
|
|
42
|
+
dryRun: false,
|
|
43
|
+
outputFormat: "json",
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Canonical fixtures
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
export const VALID_SYSTEM_YAML = `schema: forge/system@1
|
|
50
|
+
id: demo-system
|
|
51
|
+
name: Demo System
|
|
52
|
+
owners:
|
|
53
|
+
- ops
|
|
54
|
+
`;
|
|
55
|
+
export const VALID_PRODUCTS_YAML = `schema: forge/system-products@1
|
|
56
|
+
products:
|
|
57
|
+
- id: alpha
|
|
58
|
+
remote: https://example.invalid/alpha.git
|
|
59
|
+
offers:
|
|
60
|
+
- alpha-contract
|
|
61
|
+
- id: beta
|
|
62
|
+
remote: https://example.invalid/beta.git
|
|
63
|
+
offers: []
|
|
64
|
+
`;
|
|
65
|
+
export const VALID_EDGES_YAML = `schema: forge/system-edges@1
|
|
66
|
+
allowed:
|
|
67
|
+
- consumer: beta
|
|
68
|
+
contract: alpha-contract
|
|
69
|
+
forbidden: []
|
|
70
|
+
`;
|
|
71
|
+
/**
|
|
72
|
+
* A fully valid repository: all three map files plus a products.local.yaml
|
|
73
|
+
* mapping both products to existing folders (created via .gitkeep entries).
|
|
74
|
+
*/
|
|
75
|
+
export function validMapFiles() {
|
|
76
|
+
return {
|
|
77
|
+
"system/system.yaml": VALID_SYSTEM_YAML,
|
|
78
|
+
"system/products.yaml": VALID_PRODUCTS_YAML,
|
|
79
|
+
"system/edges.yaml": VALID_EDGES_YAML,
|
|
80
|
+
"system/products.local.yaml": `schema: forge/system-products-local@1
|
|
81
|
+
folders:
|
|
82
|
+
alpha: ./alpha
|
|
83
|
+
beta: ./beta
|
|
84
|
+
launcher:
|
|
85
|
+
argv: [echo, "{worktree}", "{task}"]
|
|
86
|
+
`,
|
|
87
|
+
"alpha/.gitkeep": "",
|
|
88
|
+
"beta/.gitkeep": "",
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// RFC-1509 product fixtures — governed product repos under os.tmpdir()
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
/**
|
|
95
|
+
* Materialize a governed product repository: `git init` on main, a forge.yaml
|
|
96
|
+
* seed commit and a `develop` branch — the minimum openFlowBranchCore asks
|
|
97
|
+
* for. Lives OUTSIDE the system repo so dispatch resolves a real checkout.
|
|
98
|
+
* Returns the absolute product root.
|
|
99
|
+
*/
|
|
100
|
+
export async function makeProduct(prefix = "forge-product-") {
|
|
101
|
+
const { gitExec } = await import("../../flow/tests/helpers.js");
|
|
102
|
+
const root = await mkdtemp(path.join(os.tmpdir(), prefix));
|
|
103
|
+
const init = await gitExec(root, ["init", "-b", "main"]);
|
|
104
|
+
if (init.exitCode !== 0)
|
|
105
|
+
throw new Error(`git init failed: ${init.stderr}`);
|
|
106
|
+
await gitExec(root, ["config", "user.email", "system-test@example.invalid"]);
|
|
107
|
+
await gitExec(root, ["config", "user.name", "system-test"]);
|
|
108
|
+
await gitExec(root, ["config", "commit.gpgsign", "false"]);
|
|
109
|
+
await writeFile(path.join(root, "forge.yaml"), 'schema: "forge/workspace@1"\n');
|
|
110
|
+
await writeFile(path.join(root, "seed.txt"), "seed\n");
|
|
111
|
+
await gitExec(root, ["add", "-A"]);
|
|
112
|
+
const seed = await gitExec(root, ["commit", "-m", "seed"]);
|
|
113
|
+
if (seed.exitCode !== 0)
|
|
114
|
+
throw new Error(`seed commit failed: ${seed.stderr}`);
|
|
115
|
+
const develop = await gitExec(root, ["branch", "develop"]);
|
|
116
|
+
if (develop.exitCode !== 0)
|
|
117
|
+
throw new Error(`develop branch failed: ${develop.stderr}`);
|
|
118
|
+
// flow.integrate requires the primary checkout to sit on develop.
|
|
119
|
+
const checkout = await gitExec(root, ["checkout", "develop"]);
|
|
120
|
+
if (checkout.exitCode !== 0)
|
|
121
|
+
throw new Error(`develop checkout failed: ${checkout.stderr}`);
|
|
122
|
+
return root;
|
|
123
|
+
}
|
|
124
|
+
/** products.local.yaml entry pointing at an absolute product checkout. */
|
|
125
|
+
export function localMapFor(entries, launcherArgv) {
|
|
126
|
+
const folders = Object.entries(entries)
|
|
127
|
+
.map(([id, folder]) => ` ${id}: ${JSON.stringify(folder)}`)
|
|
128
|
+
.join("\n");
|
|
129
|
+
const launcher = launcherArgv
|
|
130
|
+
? `launcher:\n argv: [${launcherArgv.map((a) => JSON.stringify(a)).join(", ")}]\n`
|
|
131
|
+
: "";
|
|
132
|
+
return `schema: forge/system-products-local@1\nfolders:\n${folders}\n${launcher}`;
|
|
133
|
+
}
|
|
134
|
+
/** A minimal forge/system-task@1 file content for fixture seeding. */
|
|
135
|
+
export function taskYaml(overrides = {}) {
|
|
136
|
+
const base = {
|
|
137
|
+
schema: "forge/system-task@1",
|
|
138
|
+
id: "T-0001",
|
|
139
|
+
title: "fixture task",
|
|
140
|
+
product: "alpha",
|
|
141
|
+
slug: "fixture-task",
|
|
142
|
+
kind: "change",
|
|
143
|
+
state: "proposed",
|
|
144
|
+
origin: { kind: "operator", ref: null },
|
|
145
|
+
contracts: [],
|
|
146
|
+
dependsOn: [],
|
|
147
|
+
brief: "queue/briefs/T-0001.md",
|
|
148
|
+
briefSha256: null,
|
|
149
|
+
dispatch: null,
|
|
150
|
+
report: null,
|
|
151
|
+
integratedCommit: null,
|
|
152
|
+
history: [{ at: "2026-01-01T00:00:00Z", from: "none", to: "proposed", by: "operator" }],
|
|
153
|
+
...overrides,
|
|
154
|
+
};
|
|
155
|
+
const yaml = Object.entries(base)
|
|
156
|
+
.map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`)
|
|
157
|
+
.join("\n");
|
|
158
|
+
return `${yaml}\n`;
|
|
159
|
+
}
|
|
160
|
+
/** A ready-state dispatch brief with a real goal. */
|
|
161
|
+
export function readyBrief(taskId = "T-0001", product = "alpha") {
|
|
162
|
+
return `---
|
|
163
|
+
schema: forge/dispatch-brief@1
|
|
164
|
+
task: ${taskId}
|
|
165
|
+
product: ${product}
|
|
166
|
+
goal: "prove the dispatch pipeline end to end"
|
|
167
|
+
acceptance:
|
|
168
|
+
- claim: "the branch exists"
|
|
169
|
+
check: "git branch --list auto/task-*"
|
|
170
|
+
constraints: []
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
# ${taskId}
|
|
174
|
+
|
|
175
|
+
prove the dispatch pipeline end to end
|
|
176
|
+
`;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../os/system/tests/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAEF,2BAA2B;AAE3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,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AAG,IAAI,IAAI,CAAC;AACrB,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,UAAU,CAAC,MAAM,GAAG,QAAQ,EAAE,OAAO,GAAG,OAAO;IAC7D,OAAO;;QAED,MAAM;WACH,OAAO;;;;;;;;IAQd,MAAM;;;CAGT,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"werkstatt-lock-recover.d.ts","sourceRoot":"","sources":["../../../../os/werkstatt/handlers/werkstatt-lock-recover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"werkstatt-lock-recover.d.ts","sourceRoot":"","sources":["../../../../os/werkstatt/handlers/werkstatt-lock-recover.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxE,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrE;AA6FD,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAC,CAuEvD"}
|
|
@@ -16,23 +16,37 @@ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten
|
|
|
16
16
|
<item>RFC-1097: sweep — werkstatt-engine clean
|
|
17
17
|
|
|
18
18
|
Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
|
|
19
|
+
<item>RFC-1495: step 1 - forge state roots</item>
|
|
19
20
|
</CHANGE_SUMMARY>
|
|
20
21
|
*/
|
|
21
|
-
import { ambientIo as fs } from "../../../src/utils/io.js";
|
|
22
|
+
import { ambientIo as fs, resolveIo } from "../../../src/utils/io.js";
|
|
22
23
|
import { existsSync } from "../../../src/utils/sync-fs.js";
|
|
23
24
|
import path from "node:path";
|
|
24
25
|
import { trashPath } from "../../../src/utils/fs-trash.js";
|
|
25
26
|
import { readAllLocks, removeStaleLock, acquireLock, releaseLock } from "./lock.js";
|
|
27
|
+
import { resolveStateRoots } from "../../flow/worktree-path.js";
|
|
26
28
|
function flagString(input, key) {
|
|
27
29
|
const v = input.flags[key];
|
|
28
30
|
return typeof v === "string" ? v : undefined;
|
|
29
31
|
}
|
|
30
|
-
async function classifyArtifacts(workspaceRoot, purge) {
|
|
32
|
+
async function classifyArtifacts(workspaceRoot, purge, io) {
|
|
31
33
|
const recovered = [];
|
|
32
34
|
const failed = [];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
// RFC-1495: releases/ is durable state — it lives in the primary checkout;
|
|
36
|
+
// missions/ (open missions) and systems/ stay per-worktree. In a
|
|
37
|
+
// single-worktree repo the roots coincide and the scan is unchanged.
|
|
38
|
+
const stateRoots = await resolveStateRoots(workspaceRoot, io).catch(() => ({
|
|
39
|
+
worktreeRoot: workspaceRoot,
|
|
40
|
+
primaryRoot: workspaceRoot,
|
|
41
|
+
isPrimary: true,
|
|
42
|
+
}));
|
|
43
|
+
const scanRoots = [
|
|
44
|
+
{ name: "systems", root: stateRoots.worktreeRoot },
|
|
45
|
+
{ name: "missions", root: stateRoots.worktreeRoot },
|
|
46
|
+
{ name: "releases", root: stateRoots.primaryRoot },
|
|
47
|
+
];
|
|
48
|
+
for (const { name: root, root: scanRoot } of scanRoots) {
|
|
49
|
+
const rootPath = path.join(scanRoot, root);
|
|
36
50
|
if (!existsSync(rootPath))
|
|
37
51
|
continue;
|
|
38
52
|
let entries;
|
|
@@ -44,7 +58,7 @@ async function classifyArtifacts(workspaceRoot, purge) {
|
|
|
44
58
|
}
|
|
45
59
|
for (const entry of entries) {
|
|
46
60
|
const entryPath = path.join(rootPath, entry);
|
|
47
|
-
const relPath =
|
|
61
|
+
const relPath = `${root}/${entry}`;
|
|
48
62
|
if (entry.endsWith(".tmp")) {
|
|
49
63
|
if (purge) {
|
|
50
64
|
try {
|
|
@@ -124,7 +138,7 @@ export async function runWerkstattLockRecover(input, context) {
|
|
|
124
138
|
failed.push({ scope: lock.scope, error: err.message });
|
|
125
139
|
}
|
|
126
140
|
}
|
|
127
|
-
const { recovered: artifactRecovered, failed: artifactFailed } = await classifyArtifacts(workspaceRoot, purge);
|
|
141
|
+
const { recovered: artifactRecovered, failed: artifactFailed } = await classifyArtifacts(workspaceRoot, purge, resolveIo(context.io));
|
|
128
142
|
for (const r of artifactRecovered) {
|
|
129
143
|
recovered.push({ artifact: r.artifact, action: r.action });
|
|
130
144
|
}
|