@warpgogol/forge 9.3.1 → 9.4.1
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/AGENTS.md +32 -0
- package/CHANGELOG.md +40 -0
- package/README.md +6 -4
- package/README.uk.md +10 -8
- package/bin/cli.ts +4 -4
- package/dist/bin/cli.js +4 -4
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
- package/dist/os/adr/handlers/list-create.js +23 -2
- package/dist/os/adr/handlers/list-create.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/adr/types.js +2 -2
- package/dist/os/adr/types.js.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +2 -0
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +7 -2
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +24 -14
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/conformance/conformance.module.d.ts.map +1 -1
- package/dist/os/conformance/conformance.module.js +21 -4
- package/dist/os/conformance/conformance.module.js.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.js +64 -8
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
- package/dist/os/core/archive-regen.d.ts +99 -0
- package/dist/os/core/archive-regen.d.ts.map +1 -0
- package/dist/os/core/archive-regen.js +220 -0
- package/dist/os/core/archive-regen.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +159 -18
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +8 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/package-health.d.ts +130 -0
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +548 -7
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +5 -2
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +3 -1
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dirty-classify.d.ts +51 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -0
- package/dist/os/flow/dirty-classify.js +83 -0
- package/dist/os/flow/dirty-classify.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +110 -19
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/gate-engine.d.ts +13 -0
- package/dist/os/flow/gate-engine.d.ts.map +1 -0
- package/dist/os/flow/gate-engine.js +32 -0
- package/dist/os/flow/gate-engine.js.map +1 -0
- package/dist/os/flow/git.d.ts +45 -4
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +95 -27
- package/dist/os/flow/git.js.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.js +12 -5
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +25 -3
- package/dist/os/flow/handlers/flow-check.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +75 -38
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +33 -5
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +13 -10
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-hold.js +13 -7
- package/dist/os/flow/handlers/flow-hold.js.map +1 -1
- package/dist/os/flow/handlers/flow-install.d.ts +2 -1
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-install.js +56 -13
- package/dist/os/flow/handlers/flow-install.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +54 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +614 -65
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts +14 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +117 -12
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
- package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-peers.js +99 -0
- package/dist/os/flow/handlers/flow-peers.js.map +1 -0
- package/dist/os/flow/handlers/flow-status.d.ts +13 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-status.js +35 -14
- package/dist/os/flow/handlers/flow-status.js.map +1 -1
- package/dist/os/flow/index.d.ts +3 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +7 -2
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/line-version.d.ts.map +1 -1
- package/dist/os/flow/line-version.js +2 -1
- package/dist/os/flow/line-version.js.map +1 -1
- package/dist/os/flow/locks.d.ts +37 -1
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +34 -14
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/ops-registry.d.ts +33 -0
- package/dist/os/flow/ops-registry.d.ts.map +1 -0
- package/dist/os/flow/ops-registry.js +177 -0
- package/dist/os/flow/ops-registry.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +157 -0
- package/dist/os/flow/preflight.d.ts.map +1 -0
- package/dist/os/flow/preflight.js +772 -0
- package/dist/os/flow/preflight.js.map +1 -0
- package/dist/os/flow/publish.d.ts +7 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +165 -3
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +26 -1
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +27 -6
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/scripts.d.ts +4 -0
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +8 -2
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/session-checkout.d.ts +33 -0
- package/dist/os/flow/session-checkout.d.ts.map +1 -0
- package/dist/os/flow/session-checkout.js +151 -0
- package/dist/os/flow/session-checkout.js.map +1 -0
- package/dist/os/flow/standalone-invoke.d.ts +11 -0
- package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
- package/dist/os/flow/standalone-invoke.js +75 -0
- package/dist/os/flow/standalone-invoke.js.map +1 -0
- package/dist/os/flow/worktree-path.d.ts.map +1 -1
- package/dist/os/flow/worktree-path.js +9 -3
- package/dist/os/flow/worktree-path.js.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.js +12 -4
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +4 -1
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +12 -8
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/importer-block.d.ts +19 -0
- package/dist/os/mission/importer-block.d.ts.map +1 -0
- package/dist/os/mission/importer-block.js +124 -0
- package/dist/os/mission/importer-block.js.map +1 -0
- package/dist/os/mission/lockfile.d.ts +17 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -1
- package/dist/os/mission/lockfile.js +38 -0
- package/dist/os/mission/lockfile.js.map +1 -1
- package/dist/os/mission/open-missions.d.ts +8 -0
- package/dist/os/mission/open-missions.d.ts.map +1 -0
- package/dist/os/mission/open-missions.js +42 -0
- package/dist/os/mission/open-missions.js.map +1 -0
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +11 -1
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts +14 -0
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +18 -10
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +11 -2
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts +23 -0
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +82 -1
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +16 -3
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +5 -4
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +107 -10
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +77 -5
- 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 +64 -6
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/next-id.d.ts +38 -0
- package/dist/os/rfc/next-id.d.ts.map +1 -0
- package/dist/os/rfc/next-id.js +165 -0
- package/dist/os/rfc/next-id.js.map +1 -0
- package/dist/os/rfc/probe-batch.d.ts.map +1 -1
- package/dist/os/rfc/probe-batch.js +6 -1
- package/dist/os/rfc/probe-batch.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +36 -8
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +42 -6
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +6 -6
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +81 -28
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +47 -0
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +31 -7
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/spec/spec-schema.d.ts +8 -0
- package/dist/os/spec/spec-schema.d.ts.map +1 -1
- package/dist/os/spec/spec-schema.js +1 -0
- package/dist/os/spec/spec-schema.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts +8 -0
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +18 -6
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +62 -15
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +13 -5
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
- package/dist/os/system/handlers/system-map-validate.js +2 -1
- package/dist/os/system/handlers/system-map-validate.js.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.js +54 -6
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-collect.js +11 -5
- package/dist/os/system/handlers/system-task-collect.js.map +1 -1
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-create.js +6 -1
- package/dist/os/system/handlers/system-task-create.js.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.js +246 -6
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
- package/dist/os/system/repo.d.ts +1 -1
- package/dist/os/system/repo.d.ts.map +1 -1
- package/dist/os/system/repo.js +53 -3
- package/dist/os/system/repo.js.map +1 -1
- package/dist/os/system/scenario-schemas.d.ts +109 -3
- package/dist/os/system/scenario-schemas.d.ts.map +1 -1
- package/dist/os/system/scenario-schemas.js +66 -10
- package/dist/os/system/scenario-schemas.js.map +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +69 -17
- package/dist/os/system/system.module.js.map +1 -1
- package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
- package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
- package/dist/os/system/tests/contract-fixtures.js +109 -0
- package/dist/os/system/tests/contract-fixtures.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +54 -18
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +41 -9
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +6 -0
- package/dist/src/conformance/index.d.ts.map +1 -1
- package/dist/src/conformance/index.js +36 -1
- package/dist/src/conformance/index.js.map +1 -1
- package/dist/src/formal/proof-runner.d.ts.map +1 -1
- package/dist/src/formal/proof-runner.js +10 -2
- package/dist/src/formal/proof-runner.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.js +4 -4
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +3 -1
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
- package/dist/src/onboarding/prettierignore.js +2 -0
- package/dist/src/onboarding/prettierignore.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +2 -2
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +14 -2
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +3 -1
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/skill-schema.d.ts +3 -0
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +9 -2
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/spec/resolve-spec-source.d.ts +45 -0
- package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
- package/dist/src/spec/resolve-spec-source.js +153 -0
- package/dist/src/spec/resolve-spec-source.js.map +1 -0
- package/dist/src/utils/command-inventory.d.ts +28 -0
- package/dist/src/utils/command-inventory.d.ts.map +1 -0
- package/dist/src/utils/command-inventory.js +84 -0
- package/dist/src/utils/command-inventory.js.map +1 -0
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +6 -1
- package/dist/src/utils/io.js.map +1 -1
- package/dist/src/utils/repo-path.d.ts +10 -0
- package/dist/src/utils/repo-path.d.ts.map +1 -0
- package/dist/src/utils/repo-path.js +52 -0
- package/dist/src/utils/repo-path.js.map +1 -0
- package/dist/src/utils/spawn.d.ts +23 -0
- package/dist/src/utils/spawn.d.ts.map +1 -0
- package/dist/src/utils/spawn.js +83 -0
- package/dist/src/utils/spawn.js.map +1 -0
- package/docs/branch-model.md +1 -1
- package/docs/guides/existing-project.md +1 -1
- package/docs/maintainers/publishing.md +1 -1
- package/docs/reference/cli.md +8 -2
- package/docs/reference/profiles.md +1 -1
- package/os/adr/handlers/list-create.ts +26 -2
- package/os/adr/types.ts +4 -2
- package/os/compass/handlers/compass-audit-handler.ts +6 -1
- package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
- package/os/compass/handlers/git-revision.ts +8 -2
- package/os/compass/handlers/summary-record.ts +25 -14
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
- package/os/conformance/conformance.module.ts +21 -4
- package/os/conformance/handlers/conformance-validate.ts +108 -16
- package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
- package/os/core/archive-regen.ts +279 -0
- package/os/core/core.module.ts +176 -29
- package/os/core/docs-archive.test.ts +413 -3
- package/os/core/handlers/assets-helpers.ts +8 -3
- package/os/core/handlers/forge-autonomy-validate.ts +3 -1
- package/os/core/handlers/package-health.test.ts +418 -4
- package/os/core/handlers/package-health.ts +629 -7
- package/os/core/handlers/release-prepare.ts +5 -2
- package/os/flow/digest.ts +3 -1
- package/os/flow/dirty-classify.ts +120 -0
- package/os/flow/flow.module.ts +119 -24
- package/os/flow/gate-engine.ts +45 -0
- package/os/flow/git.ts +117 -29
- package/os/flow/handlers/flow-backmerge.ts +14 -4
- package/os/flow/handlers/flow-check.ts +27 -2
- package/os/flow/handlers/flow-cut.ts +124 -56
- package/os/flow/handlers/flow-discard.ts +33 -5
- package/os/flow/handlers/flow-fix.ts +22 -10
- package/os/flow/handlers/flow-hold.ts +20 -7
- package/os/flow/handlers/flow-install.ts +59 -12
- package/os/flow/handlers/flow-integrate.ts +933 -180
- package/os/flow/handlers/flow-open.ts +135 -11
- package/os/flow/handlers/flow-peers.ts +142 -0
- package/os/flow/handlers/flow-status.ts +45 -13
- package/os/flow/index.ts +8 -2
- package/os/flow/line-version.ts +2 -1
- package/os/flow/locks.ts +56 -14
- package/os/flow/ops-registry.ts +194 -0
- package/os/flow/preflight.ts +974 -0
- package/os/flow/publish.ts +200 -5
- package/os/flow/registry.ts +43 -7
- package/os/flow/scripts.ts +13 -2
- package/os/flow/session-checkout.ts +186 -0
- package/os/flow/standalone-invoke.ts +85 -0
- package/os/flow/tests/dirty-classify.test.ts +251 -0
- package/os/flow/tests/fixtures/branch-names.yaml +40 -40
- package/os/flow/tests/flow-cut.test.ts +21 -0
- package/os/flow/tests/flow-discard.test.ts +32 -0
- package/os/flow/tests/flow-guard-parity.test.ts +10 -2
- package/os/flow/tests/flow-install.test.ts +7 -3
- package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +565 -0
- package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
- package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
- package/os/flow/tests/flow-integrate.test.ts +698 -17
- package/os/flow/tests/flow-open.pending.test.ts +277 -0
- package/os/flow/tests/flow-open.test.ts +52 -9
- package/os/flow/tests/flow-push-publish.test.ts +124 -0
- package/os/flow/tests/flow-status.test.ts +31 -1
- package/os/flow/tests/locks.test.ts +39 -3
- package/os/flow/tests/ops-registry.test.ts +136 -0
- package/os/flow/tests/scripts.test.ts +5 -2
- package/os/flow/tests/state-roots.test.ts +8 -5
- package/os/flow/worktree-path.ts +9 -3
- package/os/formal/handlers/proof-check.test.ts +6 -3
- package/os/instructions/budget.test.ts +31 -0
- package/os/instructions/handlers/budget-validate.ts +13 -4
- package/os/instructions/instructions.module.ts +4 -1
- package/os/mission/handlers/archive.ts +22 -14
- package/os/mission/importer-block.ts +119 -0
- package/os/mission/lockfile.ts +41 -0
- package/os/mission/open-missions.ts +50 -0
- package/os/queue/decision-ledger.test.ts +18 -0
- package/os/queue/manifest.ts +17 -1
- package/os/rfc/acceptance.ts +30 -10
- package/os/rfc/decision-log.ts +13 -2
- package/os/rfc/frontmatter-io.ts +89 -1
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
- package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
- package/os/rfc/handlers/implement-stamp.ts +16 -3
- package/os/rfc/handlers/index-graph.ts +5 -4
- package/os/rfc/handlers/lifecycle.test.ts +136 -0
- package/os/rfc/handlers/list-create.test.ts +126 -0
- package/os/rfc/handlers/list-create.ts +130 -10
- package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
- package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
- package/os/rfc/handlers/validate-rules.ts +103 -7
- package/os/rfc/handlers/validate.ts +68 -4
- package/os/rfc/next-id.ts +232 -0
- package/os/rfc/probe-batch.ts +6 -1
- package/os/rfc/rfc.module.ts +41 -8
- package/os/rfc/types.ts +31 -6
- package/os/rfc/verification-emit-freshness.test.ts +5 -1
- package/os/rfc/verification-emit.test.ts +5 -1
- package/os/rfc/verification-evidence.ts +99 -33
- package/os/rfc/verification-origin.ts +59 -0
- package/os/rfc/verification-refresh.test.ts +5 -1
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
- package/os/session/handlers/save.ts +35 -7
- package/os/session/tests/session-save.test.ts +154 -0
- package/os/spec/spec-schema.ts +3 -0
- package/os/spec/spec-status.ts +22 -6
- package/os/spec/spec-validate.package-source.test.ts +187 -0
- package/os/spec/spec-validate.ts +65 -14
- package/os/spec/spec.module.ts +13 -5
- package/os/system/handlers/system-map-validate.ts +4 -2
- package/os/system/handlers/system-outbox-scan.ts +65 -21
- package/os/system/handlers/system-task-collect.ts +11 -5
- package/os/system/handlers/system-task-create.ts +6 -1
- package/os/system/handlers/system-versionset-record.ts +301 -16
- package/os/system/repo.ts +59 -18
- package/os/system/scenario-schemas.ts +91 -12
- package/os/system/system.module.ts +70 -17
- package/os/system/tests/contract-fixtures.ts +139 -0
- package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
- package/os/system/tests/scenario-validator-check.test.ts +96 -0
- package/os/system/tests/system-task-collect.test.ts +16 -0
- package/os/system/tests/system-task-dispatch.test.ts +4 -1
- package/os/system/tests/system-versionset.test.ts +7 -3
- package/os/system/tests/version-set-v2.test.ts +78 -0
- package/package.json +9 -1
- package/skills/fo/fo-doctor/SKILL.md +151 -0
- package/skills/fo/fo-handoff/SKILL.md +22 -0
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
- package/skills/fo/fo-idea-implement/SKILL.md +5 -2
- package/skills/fo/fo-idea-plan/SKILL.md +5 -5
- package/skills/fo/fo-session-retro/SKILL.md +45 -13
- package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
- package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
- package/skills/meta/skill-create/SKILL.md +2 -1
- package/src/bin-entry.test.ts +3 -1
- package/src/config/forge-config.ts +57 -13
- package/src/conformance/index.ts +46 -1
- package/src/formal/proof-runner.ts +10 -2
- package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
- package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
- package/src/onboarding/agents-generate.ts +4 -4
- package/src/onboarding/nested-agents-generate.ts +3 -1
- package/src/onboarding/prettierignore.ts +2 -0
- package/src/onboarding/scaffold-project.ts +2 -2
- package/src/onboarding/upgrade.ts +13 -2
- package/src/onboarding/workspace-discovery.ts +3 -1
- package/src/pipeline-status.test.ts +1 -1
- package/src/skill-schema.ts +9 -2
- package/src/spec/resolve-spec-source.ts +184 -0
- package/src/tests/acceptance-probe-kinds.test.ts +3 -1
- package/src/tests/agents-generate-domain.test.ts +3 -2
- package/src/tests/agents-generate.test.ts +2 -1
- package/src/tests/create-flow.test.ts +3 -1
- package/src/tests/create.test.ts +12 -2
- package/src/tests/editable-generated-region.test.ts +2 -2
- package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
- package/src/tests/implement-stamp.test.ts +5 -2
- package/src/tests/prettierignore-manage.test.ts +11 -0
- package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
- package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
- package/src/tests/scaffold-project.test.ts +3 -1
- package/src/tests/upgrade.test.ts +79 -3
- package/src/tests/workspace-discovery.test.ts +4 -3
- package/src/utils/command-inventory.ts +105 -0
- package/src/utils/io.ts +6 -1
- package/src/utils/repo-path.ts +49 -0
- package/src/utils/spawn.ts +88 -0
- package/src/tests/rfc-evidence-sync.test.ts +0 -369
- package/src/tests/skill-agents-sync.test.ts +0 -192
|
@@ -20,12 +20,12 @@ released with no mutation.</purpose>
|
|
|
20
20
|
<item>RFC-1502: `git add -u` folds the release-prepare hook's tracked edits in; its untracked leftovers are listed as FLOW-CUT-14 then removed via io.rm (the integrate gate demands a clean tree, and `git clean -f` is blocked in agent sessions). Pre-tag verification extracts every named line at the release commit — a failure deletes worktree+branch before any ref or tag moves (FLOW-CUT-13).</item>
|
|
21
21
|
</KEY_DECISIONS>
|
|
22
22
|
<CHANGE_SUMMARY>
|
|
23
|
-
<item>RFC-1490: independent-review pass — lock-held planning, fix-branch verification, spec-shaped data, coverage</item>
|
|
24
|
-
<item>RFC-1491: step 1 — journal base/rewrites + held registry widening, W1-1 discard tip, FLOW-INT-11</item>
|
|
25
|
-
<item>RFC-1494: step 1 — isFlowAdopted public export</item>
|
|
26
|
-
<item>RFC-1502: steps 1-5 — release-prepare hook, pre-tag extract verification, ordered steps</item>
|
|
27
23
|
<item>RFC-1502: review r1 — fix-cut rollback on FLOW-CUT-12/13, populated steps[], hook validation, GIT_* env scrub</item>
|
|
28
|
-
<
|
|
24
|
+
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
25
|
+
<item>RFC-1515: close rfc-1515 review findings — delete tolerated paths before worktree remove, prune vanished registrations, verified branch -D, shared held-lock render, gated e2e throw, journal toleratedState, edge tests</item>
|
|
26
|
+
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
27
|
+
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
28
|
+
<history>RFC-1490, RFC-1491, RFC-1494, RFC-1502</history>
|
|
29
29
|
</CHANGE_SUMMARY>
|
|
30
30
|
*/
|
|
31
31
|
|
|
@@ -34,9 +34,11 @@ import { join } from "node:path";
|
|
|
34
34
|
import { parse as yamlParse } from "yaml";
|
|
35
35
|
|
|
36
36
|
import type {
|
|
37
|
+
CommandRegistry,
|
|
37
38
|
Diagnostic,
|
|
38
39
|
ForgeCommandInput,
|
|
39
40
|
ForgeCommandResult,
|
|
41
|
+
ForgeInvokeCommand,
|
|
40
42
|
ForgeRuntimeContext,
|
|
41
43
|
WorkspaceIO,
|
|
42
44
|
} from "../../../src/types.ts";
|
|
@@ -53,7 +55,7 @@ import {
|
|
|
53
55
|
topLevel,
|
|
54
56
|
worktreeList,
|
|
55
57
|
} from "../git.ts";
|
|
56
|
-
import { LockTimeoutError, withFlowLock } from "../locks.ts";
|
|
58
|
+
import { describeHeldLock, LockTimeoutError, withFlowLock } from "../locks.ts";
|
|
57
59
|
import { isFlowAdopted } from "../index.ts";
|
|
58
60
|
import {
|
|
59
61
|
appendJournal,
|
|
@@ -66,11 +68,7 @@ import {
|
|
|
66
68
|
import { bumpVersion, formatVersion, type ReleaseLevel } from "../semver.ts";
|
|
67
69
|
import { discoverReleaseLines, type ReleaseLine } from "../release-lines.ts";
|
|
68
70
|
import { pendingLevel } from "../release-level.ts";
|
|
69
|
-
import {
|
|
70
|
-
listLineTags,
|
|
71
|
-
releaseTagAnnotation,
|
|
72
|
-
writeReleaseTag,
|
|
73
|
-
} from "../release-tags.ts";
|
|
71
|
+
import { listLineTags, releaseTagAnnotation, writeReleaseTag } from "../release-tags.ts";
|
|
74
72
|
import { runFlowScript, type FlowScriptResult } from "../scripts.ts";
|
|
75
73
|
import { VersionWriteError, writeLineVersion, writeSyncedForgeVersion } from "../version-files.ts";
|
|
76
74
|
import { verifyLineAtRef } from "../publish.ts";
|
|
@@ -131,6 +129,7 @@ function refuse(
|
|
|
131
129
|
message: string,
|
|
132
130
|
fixHint: string,
|
|
133
131
|
partial?: Partial<FlowCutData>,
|
|
132
|
+
diagData?: Record<string, unknown>,
|
|
134
133
|
): FlowCutData {
|
|
135
134
|
return {
|
|
136
135
|
mode: partial?.mode ?? "ordinary",
|
|
@@ -148,7 +147,7 @@ function refuse(
|
|
|
148
147
|
gate: null,
|
|
149
148
|
backmerge: null,
|
|
150
149
|
steps: [],
|
|
151
|
-
diagnostics: [{ ruleId, severity: "error", message, fixHint }],
|
|
150
|
+
diagnostics: [{ ruleId, severity: "error", message, fixHint, data: diagData }],
|
|
152
151
|
};
|
|
153
152
|
}
|
|
154
153
|
|
|
@@ -263,9 +262,7 @@ async function planOrdinaryCut(
|
|
|
263
262
|
}
|
|
264
263
|
|
|
265
264
|
const ref = (await git(repoRoot, io, ["rev-parse", "develop"])).stdout.trim();
|
|
266
|
-
const mainTip = mainExists
|
|
267
|
-
? (await git(repoRoot, io, ["rev-parse", "main"])).stdout.trim()
|
|
268
|
-
: "";
|
|
265
|
+
const mainTip = mainExists ? (await git(repoRoot, io, ["rev-parse", "main"])).stdout.trim() : "";
|
|
269
266
|
|
|
270
267
|
// Resume detection runs before the pending-level loop: a develop tip
|
|
271
268
|
// carrying `chore(release):` is this cut's own persisted declaration. All
|
|
@@ -273,9 +270,7 @@ async function planOrdinaryCut(
|
|
|
273
270
|
// (rerun reports, no mutation); any missing or a rewound main → the plan
|
|
274
271
|
// still runs but the tail completes exactly the subject's tags (and tags
|
|
275
272
|
// the subject names cannot block as FLOW-CUT-06).
|
|
276
|
-
const tipSubject = (
|
|
277
|
-
await git(repoRoot, io, ["log", "-1", "--format=%s", ref])
|
|
278
|
-
).stdout.trim();
|
|
273
|
+
const tipSubject = (await git(repoRoot, io, ["log", "-1", "--format=%s", ref])).stdout.trim();
|
|
279
274
|
let resumeTags: string[] | null = null;
|
|
280
275
|
if (tipSubject.startsWith("chore(release): ")) {
|
|
281
276
|
const named = tipSubject
|
|
@@ -283,17 +278,34 @@ async function planOrdinaryCut(
|
|
|
283
278
|
.split(",")
|
|
284
279
|
.map((t) => t.trim())
|
|
285
280
|
.filter((t) => t.length > 0);
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
281
|
+
// RFC-1546: the subject only keys a resume when its tags encode the same
|
|
282
|
+
// line set this invocation requested — a mismatched --lines cut proceeds
|
|
283
|
+
// fresh instead of "resuming" somebody else's release declaration.
|
|
284
|
+
const byPrefixDesc = [...lines].sort((a, b) => b.tagPrefix.length - a.tagPrefix.length);
|
|
285
|
+
const subjectLineIds = [
|
|
286
|
+
...new Set(
|
|
287
|
+
named
|
|
288
|
+
.map((t) => byPrefixDesc.find((l) => t.startsWith(l.tagPrefix))?.id)
|
|
289
|
+
.filter((id): id is string => id !== undefined),
|
|
291
290
|
),
|
|
292
|
-
);
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
].sort();
|
|
292
|
+
const requestedIds = selected.map((l) => l.id).sort();
|
|
293
|
+
const linesMatch =
|
|
294
|
+
subjectLineIds.length === requestedIds.length &&
|
|
295
|
+
subjectLineIds.every((id, i) => id === requestedIds[i]);
|
|
296
|
+
if (linesMatch) {
|
|
297
|
+
const existence = await Promise.all(
|
|
298
|
+
named.map(
|
|
299
|
+
async (t) =>
|
|
300
|
+
(await git(repoRoot, io, ["rev-parse", "--verify", "-q", `refs/tags/${t}`])).exitCode ===
|
|
301
|
+
0,
|
|
302
|
+
),
|
|
303
|
+
);
|
|
304
|
+
if (named.length > 0 && existence.every((e) => e) && mainTip === ref) {
|
|
305
|
+
return { kind: "completed", ref, tags: named, allLines: lines, mainTip };
|
|
306
|
+
}
|
|
307
|
+
if (named.length > 0) resumeTags = named;
|
|
295
308
|
}
|
|
296
|
-
if (named.length > 0) resumeTags = named;
|
|
297
309
|
}
|
|
298
310
|
|
|
299
311
|
const cutLines: CutLine[] = [];
|
|
@@ -374,7 +386,7 @@ async function planOrdinaryCut(
|
|
|
374
386
|
}
|
|
375
387
|
|
|
376
388
|
const primaryBranch = await currentBranch(primary, io);
|
|
377
|
-
const primaryDirty = await statusTracked(primary, io);
|
|
389
|
+
const primaryDirty = (await statusTracked(primary, io)).entries;
|
|
378
390
|
const worktrees = await worktreeList(repoRoot, io);
|
|
379
391
|
const mainCheckedOut = worktrees.some((w) => w.branch === "main");
|
|
380
392
|
if (primaryBranch !== "develop" || primaryDirty.length > 0 || mainCheckedOut) {
|
|
@@ -524,6 +536,9 @@ export async function runOrdinaryCut(
|
|
|
524
536
|
dryRun: boolean;
|
|
525
537
|
now?: Date;
|
|
526
538
|
onProgress?: (m: string) => void;
|
|
539
|
+
/** RFC-1528: forwarded to flow.integrate's bounded preflight. */
|
|
540
|
+
invoke?: ForgeInvokeCommand;
|
|
541
|
+
commandRegistry?: CommandRegistry;
|
|
527
542
|
},
|
|
528
543
|
): Promise<FlowCutData> {
|
|
529
544
|
const now = opts.now ?? new Date();
|
|
@@ -626,7 +641,10 @@ export async function runOrdinaryCut(
|
|
|
626
641
|
) as { name?: string };
|
|
627
642
|
if (pkg.name === "@warpgogol/forge") {
|
|
628
643
|
const forgeYaml = join(wt, "forge.yaml");
|
|
629
|
-
if (
|
|
644
|
+
if (
|
|
645
|
+
(await io.exists(forgeYaml)) &&
|
|
646
|
+
/syncedVersion:/.test(await io.readFile(forgeYaml))
|
|
647
|
+
) {
|
|
630
648
|
await writeSyncedForgeVersion(wt, c.nextVersion, io);
|
|
631
649
|
}
|
|
632
650
|
}
|
|
@@ -704,7 +722,12 @@ export async function runOrdinaryCut(
|
|
|
704
722
|
.join("\n");
|
|
705
723
|
const commit = await gitCommit(wt, io, ["commit", "-m", `${subject}\n\n${body}`], "cut");
|
|
706
724
|
if (commit.exitCode !== 0) {
|
|
707
|
-
return refuse(
|
|
725
|
+
return refuse(
|
|
726
|
+
"FLOW-CUT-01",
|
|
727
|
+
`release commit failed: ${commit.stderr.trim()}`,
|
|
728
|
+
"inspect the release worktree state",
|
|
729
|
+
{ releaseBranch },
|
|
730
|
+
);
|
|
708
731
|
}
|
|
709
732
|
|
|
710
733
|
// 3b. pre-tag extract verification (RFC-1502): every named package
|
|
@@ -733,6 +756,8 @@ export async function runOrdinaryCut(
|
|
|
733
756
|
now,
|
|
734
757
|
lockHeld: true,
|
|
735
758
|
target: "develop",
|
|
759
|
+
invoke: opts.invoke,
|
|
760
|
+
commandRegistry: opts.commandRegistry,
|
|
736
761
|
});
|
|
737
762
|
if (!integrated.integrated || integrated.diagnostics.length > 0) {
|
|
738
763
|
const d = integrated.diagnostics[0];
|
|
@@ -763,15 +788,24 @@ export async function runOrdinaryCut(
|
|
|
763
788
|
);
|
|
764
789
|
} catch (error) {
|
|
765
790
|
if (error instanceof LockTimeoutError) {
|
|
791
|
+
const lock =
|
|
792
|
+
error.holder === undefined
|
|
793
|
+
? undefined
|
|
794
|
+
: describeHeldLock(error.holder, INTEGRATE_LOCK_STALE_MS);
|
|
766
795
|
return refuse(
|
|
767
796
|
"FLOW-INT-08",
|
|
768
|
-
|
|
797
|
+
lock === undefined
|
|
798
|
+
? `integration lock ${error.lockPath} is held by another integration (holder unknown)`
|
|
799
|
+
: `integration lock ${error.lockPath} is held by pid ${lock.pid} on ${lock.host ?? "unknown host"} since ${lock.at} (${lock.disposition})`,
|
|
769
800
|
"wait for the running integration to finish, or break the stale lock after 2 h automatically",
|
|
770
801
|
{ releaseBranch },
|
|
802
|
+
{ lock },
|
|
771
803
|
);
|
|
772
804
|
}
|
|
773
805
|
if (error instanceof FlowRegistrySchemaError) {
|
|
774
|
-
return refuse("FLOW-07", error.message, `repair or remove ${registryPath(common)}`, {
|
|
806
|
+
return refuse("FLOW-07", error.message, `repair or remove ${registryPath(common)}`, {
|
|
807
|
+
releaseBranch,
|
|
808
|
+
});
|
|
775
809
|
}
|
|
776
810
|
throw error;
|
|
777
811
|
}
|
|
@@ -837,14 +871,27 @@ async function finishCutTail(
|
|
|
837
871
|
"run pnpm exec forge flow.backmerge, then re-run flow.cut",
|
|
838
872
|
);
|
|
839
873
|
}
|
|
840
|
-
const upd = await git(repoRoot, io, [
|
|
874
|
+
const upd = await git(repoRoot, io, [
|
|
875
|
+
"update-ref",
|
|
876
|
+
"refs/heads/main",
|
|
877
|
+
developTip,
|
|
878
|
+
mainTipBefore,
|
|
879
|
+
]);
|
|
841
880
|
if (upd.exitCode !== 0) {
|
|
842
|
-
return refuse(
|
|
881
|
+
return refuse(
|
|
882
|
+
"FLOW-CUT-01",
|
|
883
|
+
`update-ref main failed: ${upd.stderr.trim()}`,
|
|
884
|
+
"inspect refs/heads/main",
|
|
885
|
+
);
|
|
843
886
|
}
|
|
844
887
|
} else {
|
|
845
888
|
const upd = await git(repoRoot, io, ["update-ref", "refs/heads/main", developTip]);
|
|
846
889
|
if (upd.exitCode !== 0) {
|
|
847
|
-
return refuse(
|
|
890
|
+
return refuse(
|
|
891
|
+
"FLOW-CUT-01",
|
|
892
|
+
`update-ref main failed: ${upd.stderr.trim()}`,
|
|
893
|
+
"inspect refs/heads/main",
|
|
894
|
+
);
|
|
848
895
|
}
|
|
849
896
|
}
|
|
850
897
|
|
|
@@ -854,7 +901,12 @@ async function finishCutTail(
|
|
|
854
901
|
// is skipped — rerun-safe against a crash between two git tag calls; a tag
|
|
855
902
|
// pointing elsewhere refuses instead of silently moving it.
|
|
856
903
|
for (const tag of tagNames) {
|
|
857
|
-
const existing = await git(repoRoot, io, [
|
|
904
|
+
const existing = await git(repoRoot, io, [
|
|
905
|
+
"rev-parse",
|
|
906
|
+
"-q",
|
|
907
|
+
"--verify",
|
|
908
|
+
`refs/tags/${tag}^{}`,
|
|
909
|
+
]);
|
|
858
910
|
if (existing.exitCode === 0) {
|
|
859
911
|
if (existing.stdout.trim() === developTip) continue;
|
|
860
912
|
return refuse(
|
|
@@ -863,17 +915,19 @@ async function finishCutTail(
|
|
|
863
915
|
"delete the stray tag if it was never published, or pick a different version",
|
|
864
916
|
);
|
|
865
917
|
}
|
|
866
|
-
const c =
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
line,
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
918
|
+
const c =
|
|
919
|
+
cutLines.find((cl) => cl.tag === tag) ??
|
|
920
|
+
(() => {
|
|
921
|
+
const line = lineForTag(tag, allLines, repoLine);
|
|
922
|
+
return {
|
|
923
|
+
line,
|
|
924
|
+
tag,
|
|
925
|
+
level: "patch" as const,
|
|
926
|
+
nextVersion: tag.slice(line.tagPrefix.length),
|
|
927
|
+
previousTag: null,
|
|
928
|
+
rfcs: [] as string[],
|
|
929
|
+
};
|
|
930
|
+
})();
|
|
877
931
|
const wr = await writeReleaseTag(repoRoot, io, {
|
|
878
932
|
name: tag,
|
|
879
933
|
target: developTip,
|
|
@@ -888,7 +942,11 @@ async function finishCutTail(
|
|
|
888
942
|
}),
|
|
889
943
|
});
|
|
890
944
|
if (wr.exitCode !== 0) {
|
|
891
|
-
return refuse(
|
|
945
|
+
return refuse(
|
|
946
|
+
"FLOW-CUT-01",
|
|
947
|
+
`tag ${tag} failed: ${wr.stderr.trim()}`,
|
|
948
|
+
"inspect the tag state",
|
|
949
|
+
);
|
|
892
950
|
}
|
|
893
951
|
}
|
|
894
952
|
|
|
@@ -907,9 +965,14 @@ async function finishCutTail(
|
|
|
907
965
|
// journal failure is non-fatal bookkeeping.
|
|
908
966
|
}
|
|
909
967
|
|
|
910
|
-
const mainGains =
|
|
911
|
-
|
|
912
|
-
|
|
968
|
+
const mainGains =
|
|
969
|
+
mainTipBefore.length > 0
|
|
970
|
+
? Number(
|
|
971
|
+
(
|
|
972
|
+
await git(repoRoot, io, ["rev-list", "--count", `${mainTipBefore}..${developTip}`])
|
|
973
|
+
).stdout.trim() || 0,
|
|
974
|
+
)
|
|
975
|
+
: 0;
|
|
913
976
|
|
|
914
977
|
return {
|
|
915
978
|
mode: "ordinary",
|
|
@@ -963,8 +1026,7 @@ export async function runFlowCut(
|
|
|
963
1026
|
const common = await commonGitDir(io, repoRoot);
|
|
964
1027
|
let entry = null;
|
|
965
1028
|
try {
|
|
966
|
-
entry =
|
|
967
|
-
(await readRegistry(io, common)).branches.find((b) => b.name === candidate) ?? null;
|
|
1029
|
+
entry = (await readRegistry(io, common)).branches.find((b) => b.name === candidate) ?? null;
|
|
968
1030
|
} catch (error) {
|
|
969
1031
|
if (error instanceof FlowRegistrySchemaError) {
|
|
970
1032
|
data = refuse("FLOW-07", error.message, `repair or remove ${registryPath(common)}`);
|
|
@@ -991,7 +1053,12 @@ export async function runFlowCut(
|
|
|
991
1053
|
}
|
|
992
1054
|
}
|
|
993
1055
|
|
|
994
|
-
data = await runOrdinaryCut(repoRoot, io, {
|
|
1056
|
+
data = await runOrdinaryCut(repoRoot, io, {
|
|
1057
|
+
lines,
|
|
1058
|
+
dryRun,
|
|
1059
|
+
invoke: context.invoke,
|
|
1060
|
+
commandRegistry: context.commandRegistry,
|
|
1061
|
+
});
|
|
995
1062
|
return finishCutResult(data, outputFormat, logger);
|
|
996
1063
|
}
|
|
997
1064
|
|
|
@@ -1000,7 +1067,6 @@ function finishCutResult(
|
|
|
1000
1067
|
outputFormat: string,
|
|
1001
1068
|
logger: ForgeRuntimeContext["logger"],
|
|
1002
1069
|
): ForgeCommandResult<FlowCutData> {
|
|
1003
|
-
|
|
1004
1070
|
const refused = data.diagnostics.find((d) => d.severity === "error");
|
|
1005
1071
|
if (outputFormat === "pretty") {
|
|
1006
1072
|
if (refused) {
|
|
@@ -1008,7 +1074,9 @@ function finishCutResult(
|
|
|
1008
1074
|
} else if (data.released) {
|
|
1009
1075
|
logger.section("flow.cut");
|
|
1010
1076
|
logger.info(` ${data.resumed ? "resumed release" : "released"}: ${data.tags.join(", ")}`);
|
|
1011
|
-
logger.info(
|
|
1077
|
+
logger.info(
|
|
1078
|
+
` main gained ${data.mainGains} commit(s) — now at ${data.mainAfter?.slice(0, 9)}`,
|
|
1079
|
+
);
|
|
1012
1080
|
if (data.mainGains > 0 && !data.resumed) {
|
|
1013
1081
|
logger.info(" the first cut after flow.install includes the guard-adoption commit");
|
|
1014
1082
|
}
|
|
@@ -16,12 +16,12 @@ the registry entry and journals the operator's reason.</purpose>
|
|
|
16
16
|
<item>Task-file preservation runs BEFORE the worktree-teardown hook and only for owner.kind task — a `git clean -fdx` teardown would destroy `.forge/task/` first, and a copy failure refuses the discard (FLOW-DIS-02) so the branch and its evidence survive (RFC-1509 Q-16).</item>
|
|
17
17
|
</KEY_DECISIONS>
|
|
18
18
|
<CHANGE_SUMMARY>
|
|
19
|
-
<item>RFC-1491: independent-review pass — shared lock constants, publishable pending filter, declared rules, hold ordering, sha-pinned refspecs</item>
|
|
20
|
-
<item>RFC-1509: implement RFC-1509 — system task queue, dispatch briefs and task reports</item>
|
|
21
19
|
<item>RFC-1509: record task-file preservation decisions in flow handlers</item>
|
|
22
20
|
<item>RFC-1509: close RFC-1509 review r1 findings — mark-failed escape, open-error refusal, dry-run coverage</item>
|
|
23
21
|
<item>RFC-1509: record RFC-1509 preserve-before-teardown ordering in key decisions</item>
|
|
24
|
-
<
|
|
22
|
+
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
23
|
+
<item>RFC-1515: close rfc-1515 review findings — delete tolerated paths before worktree remove, prune vanished registrations, verified branch -D, shared held-lock render, gated e2e throw, journal toleratedState, edge tests</item>
|
|
24
|
+
<history>RFC-1487, RFC-1491, RFC-1509</history>
|
|
25
25
|
</CHANGE_SUMMARY>
|
|
26
26
|
*/
|
|
27
27
|
|
|
@@ -54,6 +54,8 @@ import {
|
|
|
54
54
|
import { runFlowScript, type FlowScriptResult } from "../scripts.ts";
|
|
55
55
|
import { preserveTaskFiles } from "../task-files.ts";
|
|
56
56
|
import { primaryWorktree } from "../worktree-path.ts";
|
|
57
|
+
import { rm } from "node:fs/promises";
|
|
58
|
+
import { join } from "node:path";
|
|
57
59
|
|
|
58
60
|
export interface FlowDiscardData {
|
|
59
61
|
branch: string | null;
|
|
@@ -145,7 +147,9 @@ export async function discardFlowBranch(
|
|
|
145
147
|
|
|
146
148
|
const worktreePresent = worktree !== null && (await io.exists(worktree));
|
|
147
149
|
if (opts.dryRun) {
|
|
148
|
-
const dirty = worktreePresent
|
|
150
|
+
const dirty = worktreePresent
|
|
151
|
+
? (await statusDirty(worktree, io)).entries
|
|
152
|
+
: [];
|
|
149
153
|
return {
|
|
150
154
|
branch,
|
|
151
155
|
discarded: false,
|
|
@@ -167,8 +171,12 @@ export async function discardFlowBranch(
|
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
let teardownRan: FlowScriptResult | null = null;
|
|
174
|
+
let toleratedPaths: string[] = [];
|
|
175
|
+
// RFC-1515 AC-3: a vanished worktree skips the dirty gate and teardown —
|
|
176
|
+
// cleanup proceeds to `git branch -D` + the registry drop, recovering the
|
|
177
|
+
// orphaned entry in one command.
|
|
170
178
|
if (worktreePresent) {
|
|
171
|
-
const dirty = await statusDirty(worktree, io);
|
|
179
|
+
const dirty = (await statusDirty(worktree, io)).entries;
|
|
172
180
|
if (dirty.length > 0 && !opts.dirty) {
|
|
173
181
|
return refuse(
|
|
174
182
|
"FLOW-DIS-03",
|
|
@@ -208,6 +216,20 @@ export async function discardFlowBranch(
|
|
|
208
216
|
);
|
|
209
217
|
}
|
|
210
218
|
|
|
219
|
+
// RFC-1515: `statusDirty` predicts `git worktree remove` — allowlisted
|
|
220
|
+
// forge-local state is untracked-not-ignored, so a tolerated-only tree
|
|
221
|
+
// still refuses removal. Delete the tolerated paths first (declared-
|
|
222
|
+
// disposable state; task payloads are already preserved above); real
|
|
223
|
+
// entries leave remove to report them.
|
|
224
|
+
if (!opts.dirty) {
|
|
225
|
+
const residual = await statusDirty(worktree, io);
|
|
226
|
+
if (residual.entries.length === 0 && residual.toleratedState.length > 0) {
|
|
227
|
+
toleratedPaths = residual.toleratedState;
|
|
228
|
+
for (const rel of residual.toleratedState) {
|
|
229
|
+
await rm(join(worktree, rel), { force: true, recursive: true });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
211
233
|
const rmArgs = ["worktree", "remove"];
|
|
212
234
|
if (opts.dirty) rmArgs.push("--force");
|
|
213
235
|
rmArgs.push(worktree);
|
|
@@ -228,6 +250,11 @@ export async function discardFlowBranch(
|
|
|
228
250
|
? (await git(primary, io, ["rev-parse", branch])).stdout.trim()
|
|
229
251
|
: entry.baseSha;
|
|
230
252
|
if (await branchExists(primary, io, branch)) {
|
|
253
|
+
// RFC-1515 AC-3: a vanished worktree leaves a stale `git worktree`
|
|
254
|
+
// registration that pins the branch — prune it so `branch -D` proceeds.
|
|
255
|
+
if (worktree !== null && !worktreePresent) {
|
|
256
|
+
await git(primary, io, ["worktree", "prune"]);
|
|
257
|
+
}
|
|
231
258
|
const del = await git(primary, io, ["branch", "-D", branch]);
|
|
232
259
|
if (del.exitCode !== 0) {
|
|
233
260
|
return refuse(
|
|
@@ -251,6 +278,7 @@ export async function discardFlowBranch(
|
|
|
251
278
|
sha: deletedTip,
|
|
252
279
|
base: entry.baseSha,
|
|
253
280
|
detail: opts.reason,
|
|
281
|
+
...(toleratedPaths.length > 0 ? { toleratedState: toleratedPaths } : {}),
|
|
254
282
|
});
|
|
255
283
|
} catch (error) {
|
|
256
284
|
if (error instanceof LockTimeoutError || error instanceof FlowRegistrySchemaError) {
|
|
@@ -18,14 +18,12 @@ conflicted port still reports released: true (DNA-106 per step).</purpose>
|
|
|
18
18
|
<item>RFC-1502 r1: a refused fix cut rolls the branch back to its pre-release tip via `update-ref` + `read-tree --reset -u HEAD` (the session guard blocks reset --hard/restore/checkout --), so FLOW-CUT-12/13 stay rerun-safe without removing the fix worktree.</item>
|
|
19
19
|
</KEY_DECISIONS>
|
|
20
20
|
<CHANGE_SUMMARY>
|
|
21
|
-
<item>RFC-1491: step 1 — journal base/rewrites + held registry widening, W1-1 discard tip, FLOW-INT-11</item>
|
|
22
|
-
<item>RFC-1490: fix-mode cut run inside the fix worktree tears down and back-merges through the primary
|
|
23
|
-
|
|
24
|
-
Steering-session verification of wave 2 (W2-1): flow.cut run inside the fix worktree, the documented path and the one flow.fix's nextSteps print, released main and the tags, then removed that worktree and kept using it as repoRoot. branch -D failed unobserved, leaving an unregistered auto/fix branch, and the trailing back-merge crashed on the vanished directory. The primary is now resolved before the cut and used for every step after the teardown; a failed branch delete surfaces as a FLOW-07 warning. Back-merge refusals are appended to the cut diagnostics instead of replacing them.</item>
|
|
25
21
|
<item>RFC-1494: step 1 — isFlowAdopted public export</item>
|
|
26
22
|
<item>RFC-1502: steps 1-5 — release-prepare hook, pre-tag extract verification, ordered steps</item>
|
|
27
23
|
<item>RFC-1502: review r1 — fix-cut rollback on FLOW-CUT-12/13, populated steps[], hook validation, GIT_* env scrub</item>
|
|
28
|
-
<
|
|
24
|
+
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
25
|
+
<item>RFC-1515: close rfc-1515 review findings — delete tolerated paths before worktree remove, prune vanished registrations, verified branch -D, shared held-lock render, gated e2e throw, journal toleratedState, edge tests</item>
|
|
26
|
+
<history>RFC-1490, RFC-1491</history>
|
|
29
27
|
</CHANGE_SUMMARY>
|
|
30
28
|
*/
|
|
31
29
|
|
|
@@ -49,7 +47,7 @@ import {
|
|
|
49
47
|
topLevel,
|
|
50
48
|
worktreeList,
|
|
51
49
|
} from "../git.ts";
|
|
52
|
-
import { LockTimeoutError, withFlowLock } from "../locks.ts";
|
|
50
|
+
import { describeHeldLock, LockTimeoutError, withFlowLock } from "../locks.ts";
|
|
53
51
|
import { discoverReleaseLines } from "../release-lines.ts";
|
|
54
52
|
import { pendingLevel } from "../release-level.ts";
|
|
55
53
|
import { bumpVersion, formatVersion } from "../semver.ts";
|
|
@@ -226,10 +224,16 @@ export async function runFixCut(
|
|
|
226
224
|
steps: [],
|
|
227
225
|
diagnostics: [],
|
|
228
226
|
};
|
|
229
|
-
const cutRefuse = (
|
|
227
|
+
const cutRefuse = (
|
|
228
|
+
ruleId: string,
|
|
229
|
+
message: string,
|
|
230
|
+
fixHint: string,
|
|
231
|
+
p?: Partial<FlowCutData>,
|
|
232
|
+
diagData?: Record<string, unknown>,
|
|
233
|
+
): FlowCutData => ({
|
|
230
234
|
...base,
|
|
231
235
|
...p,
|
|
232
|
-
diagnostics: [{ ruleId, severity: "error", message, fixHint }],
|
|
236
|
+
diagnostics: [{ ruleId, severity: "error", message, fixHint, data: diagData }],
|
|
233
237
|
});
|
|
234
238
|
|
|
235
239
|
if (opts.linesGiven) {
|
|
@@ -251,7 +255,7 @@ export async function runFixCut(
|
|
|
251
255
|
// The release commit stages tracked changes only (git add -u, RFC-1502) —
|
|
252
256
|
// the dirty check still reports untracked files so the operator sees what
|
|
253
257
|
// the release deliberately leaves out, and main must be free for the CAS.
|
|
254
|
-
const dirty = await statusDirty(fixWt, io);
|
|
258
|
+
const dirty = (await statusDirty(fixWt, io)).entries;
|
|
255
259
|
const mainCheckedOut = live.some((w) => w.branch === "main");
|
|
256
260
|
if (dirty.length > 0 || mainCheckedOut) {
|
|
257
261
|
return cutRefuse(
|
|
@@ -607,10 +611,18 @@ export async function runFixCut(
|
|
|
607
611
|
);
|
|
608
612
|
} catch (error) {
|
|
609
613
|
if (error instanceof LockTimeoutError) {
|
|
614
|
+
const lock =
|
|
615
|
+
error.holder === undefined
|
|
616
|
+
? undefined
|
|
617
|
+
: describeHeldLock(error.holder, INTEGRATE_LOCK_STALE_MS);
|
|
610
618
|
return cutRefuse(
|
|
611
619
|
"FLOW-INT-08",
|
|
612
|
-
|
|
620
|
+
lock === undefined
|
|
621
|
+
? `integration lock ${error.lockPath} is held by another integration (holder unknown)`
|
|
622
|
+
: `integration lock ${error.lockPath} is held by pid ${lock.pid} on ${lock.host ?? "unknown host"} since ${lock.at} (${lock.disposition})`,
|
|
613
623
|
"wait for the running integration to finish, or break the stale lock after 2 h automatically",
|
|
624
|
+
undefined,
|
|
625
|
+
{ lock },
|
|
614
626
|
);
|
|
615
627
|
}
|
|
616
628
|
throw error;
|
|
@@ -15,8 +15,6 @@ replayed tip and journal the hold with per-item rewrites.</purpose>
|
|
|
15
15
|
<item>Rewrites are journaled only for attributed replayed items — unattributed runs re-form from unclaimed commits on the new tail on their own.</item>
|
|
16
16
|
</KEY_DECISIONS>
|
|
17
17
|
<CHANGE_SUMMARY>
|
|
18
|
-
<item>RFC-1491: step 4 — flow.hold (replay, held branch, registry held entry, journal rewrites)</item>
|
|
19
|
-
<item>RFC-1491: step 4 — flow.hold replay + flow.unhold worktree restore</item>
|
|
20
18
|
<item>RFC-1491: independent-review pass — shared lock constants, publishable pending filter, declared rules, hold ordering, sha-pinned refspecs</item>
|
|
21
19
|
<item>RFC-1491: digest segments develop by first-parent chain; hold of the topmost item skips the empty replay
|
|
22
20
|
|
|
@@ -30,6 +28,9 @@ first-argument allowlist; the read-only adapter and the static scan use the same
|
|
|
30
28
|
table. The kernel forwards --dry-run into commands that declare a dry-run flag,
|
|
31
29
|
and flow.push / flow.hold dry-runs no longer fetch. The switch-over runbook goes
|
|
32
30
|
back to werkstatt run flow.install --dry-run.</item>
|
|
31
|
+
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
32
|
+
<item>RFC-1515: close rfc-1515 review findings — delete tolerated paths before worktree remove, prune vanished registrations, verified branch -D, shared held-lock render, gated e2e throw, journal toleratedState, edge tests</item>
|
|
33
|
+
<history>RFC-1491</history>
|
|
33
34
|
</CHANGE_SUMMARY>
|
|
34
35
|
*/
|
|
35
36
|
|
|
@@ -54,7 +55,7 @@ import {
|
|
|
54
55
|
statusTracked,
|
|
55
56
|
topLevel,
|
|
56
57
|
} from "../git.ts";
|
|
57
|
-
import { LockTimeoutError, withFlowLock } from "../locks.ts";
|
|
58
|
+
import { describeHeldLock, LockTimeoutError, withFlowLock } from "../locks.ts";
|
|
58
59
|
import { INTEGRATE_LOCK_STALE_MS, INTEGRATE_LOCK_WAIT_MS } from "./flow-integrate.ts";
|
|
59
60
|
import {
|
|
60
61
|
appendJournal,
|
|
@@ -83,14 +84,19 @@ export interface FlowHoldData {
|
|
|
83
84
|
diagnostics: Diagnostic[];
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
function refuse(
|
|
87
|
+
function refuse(
|
|
88
|
+
ruleId: string,
|
|
89
|
+
message: string,
|
|
90
|
+
fixHint?: string,
|
|
91
|
+
diagData?: Record<string, unknown>,
|
|
92
|
+
): FlowHoldData {
|
|
87
93
|
return {
|
|
88
94
|
held: false,
|
|
89
95
|
item: null,
|
|
90
96
|
branch: null,
|
|
91
97
|
replayedTip: null,
|
|
92
98
|
rewrites: [],
|
|
93
|
-
diagnostics: [{ ruleId, severity: "error", message, fixHint }],
|
|
99
|
+
diagnostics: [{ ruleId, severity: "error", message, fixHint, data: diagData }],
|
|
94
100
|
};
|
|
95
101
|
}
|
|
96
102
|
|
|
@@ -212,7 +218,7 @@ export async function holdFlowItem(
|
|
|
212
218
|
const primaryBranch = (
|
|
213
219
|
await git(primary, io, ["symbolic-ref", "--short", "-q", "HEAD"])
|
|
214
220
|
).stdout.trim();
|
|
215
|
-
const dirty = await statusTracked(primary, io);
|
|
221
|
+
const dirty = (await statusTracked(primary, io)).entries;
|
|
216
222
|
if (primaryBranch !== "develop" || dirty.length > 0) {
|
|
217
223
|
return refuse(
|
|
218
224
|
"FLOW-HOLD-04",
|
|
@@ -273,10 +279,17 @@ export async function holdFlowItem(
|
|
|
273
279
|
);
|
|
274
280
|
} catch (error) {
|
|
275
281
|
if (error instanceof LockTimeoutError) {
|
|
282
|
+
const lock =
|
|
283
|
+
error.holder === undefined
|
|
284
|
+
? undefined
|
|
285
|
+
: describeHeldLock(error.holder, INTEGRATE_LOCK_STALE_MS);
|
|
276
286
|
return refuse(
|
|
277
287
|
"FLOW-07",
|
|
278
|
-
|
|
288
|
+
lock === undefined
|
|
289
|
+
? `integration lock ${error.lockPath} still held (holder unknown)`
|
|
290
|
+
: `integration lock ${error.lockPath} still held by pid ${lock.pid} on ${lock.host ?? "unknown host"} since ${lock.at} (${lock.disposition})`,
|
|
279
291
|
"a live flow command holds the lock — retry, or remove it if the holder died",
|
|
292
|
+
{ lock },
|
|
280
293
|
);
|
|
281
294
|
}
|
|
282
295
|
if (error instanceof FlowRegistrySchemaError) {
|