@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
|
@@ -18,12 +18,13 @@ hooks/worktree-setup.sh.</purpose>
|
|
|
18
18
|
<item>A failed setup script is reported, never rolled back — the worktree and registry entry stay, and the command exits 1 (DNA-106).</item>
|
|
19
19
|
</KEY_DECISIONS>
|
|
20
20
|
<CHANGE_SUMMARY>
|
|
21
|
-
<item>RFC-1490: step 2 — registry fix/port widening, FORGE_FLOW_COMMIT gitCommit helper, verified version-files writes</item>
|
|
22
|
-
<item>RFC-1490: step 4 — ordinary flow.cut (release branch, verified versions, gate, main swap, tags, resume)</item>
|
|
23
|
-
<item>RFC-1490: step 5 — flow.backmerge (port branch, fixed merge message, conflict + --redo paths)</item>
|
|
24
21
|
<item>RFC-1490: step 6 — flow.fix + fix-mode cut (patch-only, rebase on moved main, gate target main, trailing back-merge)</item>
|
|
25
22
|
<item>RFC-1490: independent-review pass — lock-held planning, fix-branch verification, spec-shaped data, coverage</item>
|
|
26
|
-
<
|
|
23
|
+
<item>ADR-0124: enable git rerere in flow-managed repositories</item>
|
|
24
|
+
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
25
|
+
<item>RFC-1536: evidence — routing/warning tests, FLOW-OPEN-10 validation renumber, owning-worktree doc rule, frictions F-0091/F-0096/F-0106/F-0119 addressed</item>
|
|
26
|
+
<item>RFC-1533: pending-branch summary + primaryMutations on the result; FLOW-OPEN-02 freed for the registry-unreadable warning (refusal renumbered to FLOW-OPEN-11)</item>
|
|
27
|
+
<history>RFC-1487, RFC-1490</history>
|
|
27
28
|
</CHANGE_SUMMARY>
|
|
28
29
|
*/
|
|
29
30
|
|
|
@@ -37,10 +38,12 @@ import type {
|
|
|
37
38
|
import { resolveIo } from "../../../src/utils/io.ts";
|
|
38
39
|
import {
|
|
39
40
|
branchExists,
|
|
41
|
+
ensureRerere,
|
|
40
42
|
git,
|
|
41
43
|
listLocalBranches,
|
|
42
44
|
listRemoteBranches,
|
|
43
45
|
requireGit,
|
|
46
|
+
statusTracked,
|
|
44
47
|
topLevel,
|
|
45
48
|
} from "../git.ts";
|
|
46
49
|
import { formatFlowBranch, parseFlowBranch, type FlowBranchKind } from "../branch-name.ts";
|
|
@@ -56,6 +59,7 @@ import {
|
|
|
56
59
|
type FlowRegistryEntry,
|
|
57
60
|
} from "../registry.ts";
|
|
58
61
|
import { runFlowScript, type FlowScriptResult } from "../scripts.ts";
|
|
62
|
+
import { collectFlowStatus } from "./flow-status.ts";
|
|
59
63
|
import { flowWorktreePath, primaryWorktree } from "../worktree-path.ts";
|
|
60
64
|
|
|
61
65
|
const OPEN_MAX_ATTEMPTS = 3;
|
|
@@ -99,6 +103,16 @@ export interface FlowOpenData {
|
|
|
99
103
|
baseSha: string | null;
|
|
100
104
|
opened: boolean;
|
|
101
105
|
setup: FlowScriptResult | null;
|
|
106
|
+
/** RFC-1533: tracked-dirty paths in the primary at open time (the sweep's
|
|
107
|
+
* input — empty when clean or already refused before the status read). */
|
|
108
|
+
primaryMutations: string[];
|
|
109
|
+
/** RFC-1533: registered siblings excluding the branch just opened;
|
|
110
|
+
* null when the registry could not be read for the summary (FLOW-OPEN-02). */
|
|
111
|
+
pending: {
|
|
112
|
+
total: number;
|
|
113
|
+
byKind: { session: number; task: number; fix: number };
|
|
114
|
+
stale: number;
|
|
115
|
+
} | null;
|
|
102
116
|
diagnostics: Diagnostic[];
|
|
103
117
|
}
|
|
104
118
|
|
|
@@ -111,6 +125,8 @@ function refuse(ruleId: string, message: string, fixHint: string): FlowOpenData
|
|
|
111
125
|
baseSha: null,
|
|
112
126
|
opened: false,
|
|
113
127
|
setup: null,
|
|
128
|
+
primaryMutations: [],
|
|
129
|
+
pending: null,
|
|
114
130
|
diagnostics: [{ ruleId, severity: "error", message, fixHint }],
|
|
115
131
|
};
|
|
116
132
|
}
|
|
@@ -139,9 +155,9 @@ export async function openFlowBranch(
|
|
|
139
155
|
io: WorkspaceIO,
|
|
140
156
|
opts: FlowOpenOptions,
|
|
141
157
|
): Promise<FlowOpenData> {
|
|
142
|
-
// Flags — FLOW-OPEN-
|
|
158
|
+
// Flags — FLOW-OPEN-10/05 first, before any git fact is consulted.
|
|
143
159
|
if (opts.kind !== "session" && opts.kind !== "task") {
|
|
144
|
-
return refuse("FLOW-OPEN-
|
|
160
|
+
return refuse("FLOW-OPEN-10", `invalid --kind '${opts.kind}'`, "use --kind session or --kind task");
|
|
145
161
|
}
|
|
146
162
|
if (opts.kind === "task" && (opts.owner === null || opts.owner === "")) {
|
|
147
163
|
return refuse(
|
|
@@ -176,7 +192,7 @@ export async function openFlowBranchCore(
|
|
|
176
192
|
|
|
177
193
|
if (!SLUG_RE.test(opts.slug) || opts.slug.length < 3 || opts.slug.length > 48) {
|
|
178
194
|
return refuse(
|
|
179
|
-
"FLOW-OPEN-
|
|
195
|
+
"FLOW-OPEN-10",
|
|
180
196
|
`invalid --slug '${opts.slug}'`,
|
|
181
197
|
"slug must match ^[a-z0-9]+(-[a-z0-9]+)*$ and be 3..48 characters",
|
|
182
198
|
);
|
|
@@ -202,7 +218,7 @@ export async function openFlowBranchCore(
|
|
|
202
218
|
|
|
203
219
|
if (!(await branchExists(repoRoot, io, baseRef))) {
|
|
204
220
|
return refuse(
|
|
205
|
-
"FLOW-OPEN-
|
|
221
|
+
"FLOW-OPEN-11",
|
|
206
222
|
`local branch ${baseRef} does not exist`,
|
|
207
223
|
base === "develop"
|
|
208
224
|
? "adopt the fixed branch model with flow.install first"
|
|
@@ -215,6 +231,32 @@ export async function openFlowBranchCore(
|
|
|
215
231
|
const primary = await primaryWorktree(io, repoRoot);
|
|
216
232
|
const common = await commonGitDir(io, repoRoot);
|
|
217
233
|
|
|
234
|
+
// RFC-1536/RFC-1533 FLOW-OPEN-01: warn when the primary checkout carries
|
|
235
|
+
// tracked mutations — the sweep does NOT move them into the worktree.
|
|
236
|
+
// Warning severity, exit code unchanged; the same diagnostic fires at
|
|
237
|
+
// flow.check so the condition is visible between opens.
|
|
238
|
+
const dirtyPrimaryDiags: Diagnostic[] = [];
|
|
239
|
+
let primaryMutations: string[] = [];
|
|
240
|
+
{
|
|
241
|
+
const primaryStatus = await statusTracked(primary, io);
|
|
242
|
+
if (!primaryStatus.vanished) {
|
|
243
|
+
primaryMutations = primaryStatus.entries.map((e) => e.slice(3));
|
|
244
|
+
}
|
|
245
|
+
if (primaryMutations.length > 0) {
|
|
246
|
+
const shown = primaryMutations.slice(0, 10);
|
|
247
|
+
dirtyPrimaryDiags.push({
|
|
248
|
+
ruleId: "FLOW-OPEN-01",
|
|
249
|
+
severity: "warning",
|
|
250
|
+
message:
|
|
251
|
+
`primary checkout carries ${primaryMutations.length} tracked mutation(s): ${shown.join(", ")}` +
|
|
252
|
+
(primaryMutations.length > shown.length ? ` (+${primaryMutations.length - shown.length} more)` : "") +
|
|
253
|
+
" — they are NOT swept into the worktree; commit or move them first",
|
|
254
|
+
fixHint:
|
|
255
|
+
"commit them in the primary checkout or move them into the session worktree before integrating",
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
218
260
|
// Candidate names — local branches, remote-tracking auto refs, registry.
|
|
219
261
|
let registryNames: string[];
|
|
220
262
|
try {
|
|
@@ -256,6 +298,67 @@ export async function openFlowBranchCore(
|
|
|
256
298
|
const ownerId = opts.owner.id;
|
|
257
299
|
const iso = now.toISOString();
|
|
258
300
|
|
|
301
|
+
// ADR-0124: repair shared rerere config idempotently at worktree setup —
|
|
302
|
+
// a repo adopted before ADR-0124 self-heals on the next session open.
|
|
303
|
+
// Never blocks: a config write failure is a warning, not a refusal.
|
|
304
|
+
const rerereDiags: Diagnostic[] = [];
|
|
305
|
+
if (!opts.dryRun) {
|
|
306
|
+
for (const failure of await ensureRerere(repoRoot, io)) {
|
|
307
|
+
rerereDiags.push({
|
|
308
|
+
ruleId: "FLOW-OPEN-08",
|
|
309
|
+
severity: "warning",
|
|
310
|
+
message: `rerere config repair failed: ${failure}`,
|
|
311
|
+
fixHint: `run git config rerere.enabled true && git config rerere.autoupdate true in ${repoRoot}`,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// RFC-1533 pending summary — registered siblings excluding the branch just
|
|
317
|
+
// opened, computed through collectFlowStatus (single fact source). A
|
|
318
|
+
// registry read failure degrades to `pending: null` + FLOW-OPEN-02 warning;
|
|
319
|
+
// surfacing must never wedge worktree creation.
|
|
320
|
+
const pendingSummary = async (
|
|
321
|
+
excludeName: string,
|
|
322
|
+
): Promise<{ pending: FlowOpenData["pending"]; diags: Diagnostic[] }> => {
|
|
323
|
+
const unreadable = {
|
|
324
|
+
pending: null,
|
|
325
|
+
diags: [
|
|
326
|
+
{
|
|
327
|
+
ruleId: "FLOW-OPEN-02" as const,
|
|
328
|
+
severity: "warning" as const,
|
|
329
|
+
message:
|
|
330
|
+
"flow registry absent or unreadable — pending-branch summary unavailable",
|
|
331
|
+
fixHint: `run flow.check for registry diagnostics; repair or remove ${registryPath(common)}`,
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
};
|
|
335
|
+
try {
|
|
336
|
+
// On the success path the registry always exists (registration wrote
|
|
337
|
+
// it) — the absent branch is reachable on a dry-run over a repo that
|
|
338
|
+
// never opened a flow branch.
|
|
339
|
+
if (!(await io.exists(registryPath(common)))) return unreadable;
|
|
340
|
+
const status = await collectFlowStatus(repoRoot, io, { now });
|
|
341
|
+
if (status.registryError) throw status.registryError;
|
|
342
|
+
const siblings = status.data.branches.filter(
|
|
343
|
+
(b) => b.registered && b.name !== excludeName,
|
|
344
|
+
);
|
|
345
|
+
return {
|
|
346
|
+
pending: {
|
|
347
|
+
total: siblings.length,
|
|
348
|
+
byKind: {
|
|
349
|
+
session: siblings.filter((b) => b.kind === "session").length,
|
|
350
|
+
task: siblings.filter((b) => b.kind === "task").length,
|
|
351
|
+
fix: siblings.filter((b) => b.kind === "fix").length,
|
|
352
|
+
},
|
|
353
|
+
stale: siblings.filter((b) => b.stale).length,
|
|
354
|
+
},
|
|
355
|
+
diags: [],
|
|
356
|
+
};
|
|
357
|
+
} catch {
|
|
358
|
+
return unreadable;
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
|
|
259
362
|
for (let attempt = 1; attempt <= OPEN_MAX_ATTEMPTS; attempt++) {
|
|
260
363
|
const name = formatFlowBranch({ kind: opts.kind as FlowBranchKind, date: now, seq, slug: opts.slug });
|
|
261
364
|
// candidates gains each tried name so a collision retry picks the next NN.
|
|
@@ -270,6 +373,7 @@ export async function openFlowBranchCore(
|
|
|
270
373
|
}
|
|
271
374
|
|
|
272
375
|
if (opts.dryRun) {
|
|
376
|
+
const pending = await pendingSummary(name);
|
|
273
377
|
return {
|
|
274
378
|
repoKind: "governed",
|
|
275
379
|
branch: name,
|
|
@@ -278,7 +382,9 @@ export async function openFlowBranchCore(
|
|
|
278
382
|
baseSha,
|
|
279
383
|
opened: false,
|
|
280
384
|
setup: { status: "skipped", exitCode: null, stderrTail: "", stdout: "" },
|
|
281
|
-
|
|
385
|
+
primaryMutations,
|
|
386
|
+
pending: pending.pending,
|
|
387
|
+
diagnostics: [...dirtyPrimaryDiags, ...pending.diags],
|
|
282
388
|
};
|
|
283
389
|
}
|
|
284
390
|
|
|
@@ -311,7 +417,7 @@ export async function openFlowBranchCore(
|
|
|
311
417
|
);
|
|
312
418
|
}
|
|
313
419
|
return refuse(
|
|
314
|
-
"FLOW-OPEN-
|
|
420
|
+
"FLOW-OPEN-09",
|
|
315
421
|
`git worktree add -b ${name} failed (exit ${add.exitCode}): ${add.stderr.trim()}`,
|
|
316
422
|
"inspect the git error — a stale ref or lock may need cleanup",
|
|
317
423
|
);
|
|
@@ -373,6 +479,7 @@ export async function openFlowBranchCore(
|
|
|
373
479
|
]
|
|
374
480
|
: [];
|
|
375
481
|
|
|
482
|
+
const pending = await pendingSummary(name);
|
|
376
483
|
return {
|
|
377
484
|
repoKind: "governed",
|
|
378
485
|
branch: name,
|
|
@@ -381,7 +488,14 @@ export async function openFlowBranchCore(
|
|
|
381
488
|
baseSha,
|
|
382
489
|
opened: true,
|
|
383
490
|
setup,
|
|
384
|
-
|
|
491
|
+
primaryMutations,
|
|
492
|
+
pending: pending.pending,
|
|
493
|
+
diagnostics: [
|
|
494
|
+
...dirtyPrimaryDiags,
|
|
495
|
+
...pending.diags,
|
|
496
|
+
...rerereDiags,
|
|
497
|
+
...setupDiag,
|
|
498
|
+
],
|
|
385
499
|
};
|
|
386
500
|
}
|
|
387
501
|
return refuse(
|
|
@@ -426,6 +540,16 @@ export async function runFlowOpen(
|
|
|
426
540
|
logger.info(` worktree: ${data.worktree}`);
|
|
427
541
|
logger.info(` base: ${data.base} @ ${data.baseSha?.slice(0, 9)}`);
|
|
428
542
|
logger.info(` setup: ${data.setup?.status ?? "skipped"}`);
|
|
543
|
+
for (const d of data.diagnostics) {
|
|
544
|
+
if (d.severity === "error") logger.error(` ${d.ruleId}: ${d.message}`);
|
|
545
|
+
else logger.warn(` ${d.ruleId}: ${d.message}`);
|
|
546
|
+
}
|
|
547
|
+
if (data.pending !== null && data.pending.total > 0) {
|
|
548
|
+
logger.info(
|
|
549
|
+
` pending: ${data.pending.total} registered branch(es) — ` +
|
|
550
|
+
`${data.pending.stale} stale (>72h); inspect with flow.status`,
|
|
551
|
+
);
|
|
552
|
+
}
|
|
429
553
|
}
|
|
430
554
|
}
|
|
431
555
|
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.peers — the read-only live resource map (RFC-1543). Reports the
|
|
4
|
+
integrate.lock holder, live op-claims grouped by checkout, open missions per
|
|
5
|
+
worktree, and registered in-flight branches so an operator (or a second
|
|
6
|
+
agent session) can see who owns a shared checkout before flow.integrate
|
|
7
|
+
waits or refuses on it.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No mutation authority — peers observes; it never breaks locks, releases claims, or closes missions.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1543: flow.peers — forge/peers@1 report over lock holder, live claims, open missions, in-flight branches</item>
|
|
14
|
+
<item>RFC-1543: attribute shared-checkout dirt to live ops and expose peers (RFC-1543)</item>
|
|
15
|
+
</CHANGE_SUMMARY>
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import type {
|
|
20
|
+
ForgeCommandInput,
|
|
21
|
+
ForgeCommandResult,
|
|
22
|
+
ForgeRuntimeContext,
|
|
23
|
+
} from "../../../src/types.ts";
|
|
24
|
+
import { resolveIo } from "../../../src/utils/io.ts";
|
|
25
|
+
import { openMissionsIn } from "../../mission/open-missions.ts";
|
|
26
|
+
import { commonGitDir, INTEGRATE_LOCK_RELATIVE_PATH, readRegistry } from "../registry.ts";
|
|
27
|
+
import { requireGit, topLevel } from "../git.ts";
|
|
28
|
+
import { describeHeldLock } from "../locks.ts";
|
|
29
|
+
import { isClaimLive, liveClaimsReadOnly, type OpClaim } from "../ops-registry.ts";
|
|
30
|
+
|
|
31
|
+
export const PEERS_SCHEMA = "forge/peers@1";
|
|
32
|
+
|
|
33
|
+
interface LockHolder {
|
|
34
|
+
pid: number;
|
|
35
|
+
host?: string;
|
|
36
|
+
at?: string;
|
|
37
|
+
bootId?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PeersReport {
|
|
41
|
+
schema: typeof PEERS_SCHEMA;
|
|
42
|
+
integrateLock: (LockHolder & { disposition: "live" | "dead-holder" | "stale" }) | null;
|
|
43
|
+
claimsByCheckout: { workspaceRoot: string; claims: OpClaim[] }[];
|
|
44
|
+
openMissions: string[];
|
|
45
|
+
branchesInFlight: string[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Read + liveness-check the integrate.lock holder — shared with ops sweeps. */
|
|
49
|
+
async function integrateLockHolder(
|
|
50
|
+
io: ReturnType<typeof resolveIo>,
|
|
51
|
+
common: string,
|
|
52
|
+
): Promise<PeersReport["integrateLock"]> {
|
|
53
|
+
let parsed: LockHolder | null = null;
|
|
54
|
+
try {
|
|
55
|
+
const raw = JSON.parse(await io.readFile(join(common, INTEGRATE_LOCK_RELATIVE_PATH))) as Record<
|
|
56
|
+
string,
|
|
57
|
+
unknown
|
|
58
|
+
>;
|
|
59
|
+
if (typeof raw["pid"] === "number") {
|
|
60
|
+
parsed = {
|
|
61
|
+
pid: raw["pid"],
|
|
62
|
+
host: typeof raw["host"] === "string" ? raw["host"] : undefined,
|
|
63
|
+
at: typeof raw["at"] === "string" ? raw["at"] : undefined,
|
|
64
|
+
bootId: typeof raw["bootId"] === "string" ? raw["bootId"] : undefined,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
if (parsed === null) return null;
|
|
71
|
+
const d = describeHeldLock(
|
|
72
|
+
{ pid: parsed.pid, host: parsed.host, at: parsed.at ?? "", bootId: parsed.bootId },
|
|
73
|
+
10 * 60_000,
|
|
74
|
+
);
|
|
75
|
+
return { ...parsed, disposition: d.disposition };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export async function runFlowPeers(
|
|
79
|
+
_input: ForgeCommandInput,
|
|
80
|
+
context: ForgeRuntimeContext,
|
|
81
|
+
): Promise<ForgeCommandResult<PeersReport>> {
|
|
82
|
+
const { workspaceRoot, logger, outputFormat } = context;
|
|
83
|
+
const io = resolveIo(context.io);
|
|
84
|
+
await requireGit(io);
|
|
85
|
+
|
|
86
|
+
const repoRoot = await topLevel(workspaceRoot, io);
|
|
87
|
+
if (repoRoot === null) {
|
|
88
|
+
throw new Error("flow.peers must run inside a git repository");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const common = await commonGitDir(io, repoRoot);
|
|
92
|
+
const [lock, claims, openMissions, registry] = await Promise.all([
|
|
93
|
+
integrateLockHolder(io, common),
|
|
94
|
+
liveClaimsReadOnly(repoRoot, io),
|
|
95
|
+
openMissionsIn(repoRoot, io),
|
|
96
|
+
readRegistry(io, repoRoot).catch(() => null),
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
const byRoot = new Map<string, OpClaim[]>();
|
|
100
|
+
for (const c of claims.filter((c) => isClaimLive(c))) {
|
|
101
|
+
byRoot.set(c.workspaceRoot, [...(byRoot.get(c.workspaceRoot) ?? []), c]);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const report: PeersReport = {
|
|
105
|
+
schema: PEERS_SCHEMA,
|
|
106
|
+
integrateLock: lock,
|
|
107
|
+
claimsByCheckout: [...byRoot.entries()].map(([root, list]) => ({
|
|
108
|
+
workspaceRoot: root,
|
|
109
|
+
claims: list,
|
|
110
|
+
})),
|
|
111
|
+
openMissions,
|
|
112
|
+
branchesInFlight: (registry?.branches ?? []).map((b) => b.name),
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
if (outputFormat === "pretty") {
|
|
116
|
+
logger.section("flow.peers");
|
|
117
|
+
logger.info(
|
|
118
|
+
lock === null
|
|
119
|
+
? " integrate.lock: free"
|
|
120
|
+
: ` integrate.lock: pid ${lock.pid} on ${lock.host ?? "?"} since ${lock.at ?? "?"} (${lock.disposition})`,
|
|
121
|
+
);
|
|
122
|
+
for (const g of report.claimsByCheckout) {
|
|
123
|
+
for (const c of g.claims) {
|
|
124
|
+
logger.info(
|
|
125
|
+
` claim ${c.opId}: ${c.command} (pid ${c.pid}, started ${c.startedAt}) on ${g.workspaceRoot} — ${c.paths.length} path(s)`,
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (report.openMissions.length > 0) {
|
|
130
|
+
logger.info(` open missions: ${report.openMissions.join(", ")}`);
|
|
131
|
+
}
|
|
132
|
+
if (report.branchesInFlight.length > 0) {
|
|
133
|
+
logger.info(` branches in flight: ${report.branchesInFlight.join(", ")}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
data: report,
|
|
139
|
+
exitCode: 0,
|
|
140
|
+
summary: `[flow.peers] ${lock === null ? "lock free" : `lock ${lock.disposition}`}, ${claims.length} live claim(s), ${report.openMissions.length} open mission(s)`,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
@@ -15,16 +15,6 @@ for both surfaces.</purpose>
|
|
|
15
15
|
<item>Stray (RFC-1498): a local auto branch with no registry entry and no worktree checkout anywhere is exposed as unregisteredBranchesWithoutWorktree regardless of age — the leftover shape a failed branch -D leaves.</item>
|
|
16
16
|
</KEY_DECISIONS>
|
|
17
17
|
<CHANGE_SUMMARY>
|
|
18
|
-
<item>RFC-1487: close rfc-1487 review findings — dirty-check parity with git worktree remove, ownership-verified lock release, FLOW-07 registry-error mapping, residual RFC-1462 docs removed
|
|
19
|
-
|
|
20
|
-
The dirty gate for session worktrees now uses full porcelain status
|
|
21
|
-
(untracked files included) because it predicts 'git worktree remove';
|
|
22
|
-
the primary-clean gate keeps tracked-only semantics because it predicts
|
|
23
|
-
'merge --ff-only'. Lock release verifies the held payload before
|
|
24
|
-
unlinking. Registry/journal failures map to FLOW-07 in every handler.
|
|
25
|
-
The final branch-name collision reports FLOW-OPEN-04, flow.discard
|
|
26
|
-
propagates its teardown result and predicts FLOW-DIS-03 on --dry-run,
|
|
27
|
-
and integrate exposes teardown as its own field.</item>
|
|
28
18
|
<item>RFC-1490: independent-review pass — lock-held planning, fix-branch verification, spec-shaped data, coverage</item>
|
|
29
19
|
<item>RFC-1491: step 1 — journal base/rewrites + held registry widening, W1-1 discard tip, FLOW-INT-11</item>
|
|
30
20
|
<item>RFC-1498: step 1 — FLOW-07 for stray auto branches
|
|
@@ -33,6 +23,8 @@ collectFlowStatus exposes unregisteredBranchesWithoutWorktree — local auto/* b
|
|
|
33
23
|
<item>RFC-1498: step 2 — network-only marker source
|
|
34
24
|
|
|
35
25
|
markerSource accepts only network-shaped origins — http/https/ssh/git schemes or the scp user-at-host form — and returns { source, rejectedOrigin }. A local path or file:// URL falls back to the repository directory basename with rejectedOrigin naming the kind (local-path or file-url), so no machine-local path is ever written into an extract repository marker; embedded credentials are still stripped from network URLs. flow.install resolves the source at plan time, stores it on the plan for the execute phase, and the markers step warns origin rejected (kind) — using the directory name, never printing the path. Tests AC-3 (local path and file:// rejected, basename used, path absent from the step detail) and AC-4 (scp URL kept verbatim, https credentials stripped). Also carries the KEY_DECISIONS compass notes for step 1's stray-branch rule.</item>
|
|
26
|
+
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
27
|
+
<item>RFC-1537: branches[].lastRefusal + derived orphaned flag — the newest integrate-refusal journal event per branch is the discoverable escape path after a refused flow.integrate</item>
|
|
36
28
|
<history>RFC-1487</history>
|
|
37
29
|
</CHANGE_SUMMARY>
|
|
38
30
|
*/
|
|
@@ -60,8 +52,10 @@ import {
|
|
|
60
52
|
import {
|
|
61
53
|
commonGitDir,
|
|
62
54
|
FlowRegistrySchemaError,
|
|
55
|
+
readJournal,
|
|
63
56
|
readRegistry,
|
|
64
57
|
STALE_AFTER_HOURS,
|
|
58
|
+
type FlowJournalEvent,
|
|
65
59
|
type FlowRegistryEntry,
|
|
66
60
|
} from "../registry.ts";
|
|
67
61
|
import { primaryWorktree } from "../worktree-path.ts";
|
|
@@ -72,6 +66,9 @@ export interface FlowBranchStatus {
|
|
|
72
66
|
kind: "session" | "task" | "fix" | null;
|
|
73
67
|
worktree: string | null;
|
|
74
68
|
worktreeExists: boolean;
|
|
69
|
+
/** RFC-1515: a registered worktree path that is gone from disk — distinct
|
|
70
|
+
* from a null worktree (held entries legitimately have none). */
|
|
71
|
+
vanished: boolean;
|
|
75
72
|
/** Tracked-modification count in the worktree; null when no worktree exists. */
|
|
76
73
|
dirty: number | null;
|
|
77
74
|
aheadOfDevelop: number | null;
|
|
@@ -82,6 +79,12 @@ export interface FlowBranchStatus {
|
|
|
82
79
|
held: { heldAt: string; riskCategory: string; reason: string; tip: string } | null;
|
|
83
80
|
/** Back-merge port payload when the entry is a port branch (RFC-1490). */
|
|
84
81
|
port: { mainSha: string; tags: string[] } | null;
|
|
82
|
+
/** RFC-1537: newest journaled integrate refusal for this branch — the
|
|
83
|
+
* discoverable escape path after a refused flow.integrate. */
|
|
84
|
+
lastRefusal: { rule: string | null; at: string; summary: string } | null;
|
|
85
|
+
/** RFC-1537: the branch's newest journal event is an integrate refusal
|
|
86
|
+
* while the branch still exists — nothing reclaimed it since. */
|
|
87
|
+
orphaned: boolean;
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
export interface FlowStatusData {
|
|
@@ -123,14 +126,30 @@ export async function collectFlowStatus(
|
|
|
123
126
|
|
|
124
127
|
const diagnostics: Diagnostic[] = [];
|
|
125
128
|
const primary = await primaryWorktree(io, repoRoot);
|
|
126
|
-
const [primaryBranch,
|
|
129
|
+
const [primaryBranch, primaryStatus, worktrees, local] = await Promise.all([
|
|
127
130
|
currentBranch(primary, io),
|
|
128
131
|
statusTracked(primary, io),
|
|
129
132
|
worktreeList(repoRoot, io),
|
|
130
133
|
listLocalBranches(repoRoot, io),
|
|
131
134
|
]);
|
|
135
|
+
const primaryDirty = primaryStatus.entries;
|
|
132
136
|
|
|
133
137
|
const common = await commonGitDir(io, repoRoot);
|
|
138
|
+
// RFC-1537: journal is read-only here — a corrupt or unreadable journal
|
|
139
|
+
// degrades lastRefusal/orphaned to absent, never breaks status.
|
|
140
|
+
let journal: FlowJournalEvent[] = [];
|
|
141
|
+
try {
|
|
142
|
+
journal = await readJournal(io, common);
|
|
143
|
+
} catch {
|
|
144
|
+
journal = [];
|
|
145
|
+
}
|
|
146
|
+
// Append order keeps the newest event last — the last hit per branch wins.
|
|
147
|
+
const lastEventByBranch = new Map<string, FlowJournalEvent>();
|
|
148
|
+
const lastRefusalByBranch = new Map<string, FlowJournalEvent>();
|
|
149
|
+
for (const e of journal) {
|
|
150
|
+
lastEventByBranch.set(e.branch, e);
|
|
151
|
+
if (e.event === "integrate-refusal") lastRefusalByBranch.set(e.branch, e);
|
|
152
|
+
}
|
|
134
153
|
let entries: FlowRegistryEntry[] = [];
|
|
135
154
|
let registryError: FlowRegistrySchemaError | null = null;
|
|
136
155
|
try {
|
|
@@ -189,7 +208,7 @@ export async function collectFlowStatus(
|
|
|
189
208
|
behind = Number(behindStr) || 0;
|
|
190
209
|
ahead = Number(aheadStr) || 0;
|
|
191
210
|
}
|
|
192
|
-
const dirty = worktreeExists ? (await statusDirty(worktree, io)).length : null;
|
|
211
|
+
const dirty = worktreeExists ? (await statusDirty(worktree, io)).entries.length : null;
|
|
193
212
|
|
|
194
213
|
const held = entry?.held ?? null;
|
|
195
214
|
let stale = false;
|
|
@@ -211,6 +230,7 @@ export async function collectFlowStatus(
|
|
|
211
230
|
kind: entry?.kind ?? parseFlowBranch(name)?.kind ?? null,
|
|
212
231
|
worktree,
|
|
213
232
|
worktreeExists,
|
|
233
|
+
vanished: worktree !== null && !worktreeExists,
|
|
214
234
|
dirty,
|
|
215
235
|
aheadOfDevelop: ahead,
|
|
216
236
|
behindDevelop: behind,
|
|
@@ -218,6 +238,13 @@ export async function collectFlowStatus(
|
|
|
218
238
|
stale,
|
|
219
239
|
held,
|
|
220
240
|
port: entry?.port ?? null,
|
|
241
|
+
lastRefusal: (() => {
|
|
242
|
+
const r = lastRefusalByBranch.get(name);
|
|
243
|
+
return r === undefined
|
|
244
|
+
? null
|
|
245
|
+
: { rule: r.rule ?? null, at: r.at, summary: r.detail };
|
|
246
|
+
})(),
|
|
247
|
+
orphaned: lastEventByBranch.get(name)?.event === "integrate-refusal",
|
|
221
248
|
});
|
|
222
249
|
}
|
|
223
250
|
|
|
@@ -267,8 +294,13 @@ export async function runFlowStatus(
|
|
|
267
294
|
logger.info(
|
|
268
295
|
b.held !== null
|
|
269
296
|
? ` ${b.name}: held (${b.held.riskCategory}): ${b.held.reason}`
|
|
270
|
-
: ` ${b.name}: ${b.registered ? "registered" : "unregistered"}, worktree ${b.worktreeExists ? "present" : "absent"}, dirty ${b.dirty ?? "-"}, +${b.aheadOfDevelop ?? "-"}/-${b.behindDevelop ?? "-"}, stale ${b.stale}`,
|
|
297
|
+
: ` ${b.name}: ${b.registered ? "registered" : "unregistered"}, worktree ${b.worktreeExists ? "present" : b.vanished ? "vanished" : "absent"}, dirty ${b.dirty ?? "-"}, +${b.aheadOfDevelop ?? "-"}/-${b.behindDevelop ?? "-"}, stale ${b.stale}`,
|
|
271
298
|
);
|
|
299
|
+
if (b.orphaned && b.lastRefusal !== null) {
|
|
300
|
+
logger.info(
|
|
301
|
+
` └─ last integrate refused (${b.lastRefusal.rule ?? "unknown"}) at ${b.lastRefusal.at}: ${b.lastRefusal.summary}`,
|
|
302
|
+
);
|
|
303
|
+
}
|
|
272
304
|
}
|
|
273
305
|
for (const d of outcome.diagnostics) {
|
|
274
306
|
logger.error(` ${d.ruleId}: ${d.message}`);
|
package/os/flow/index.ts
CHANGED
|
@@ -15,11 +15,14 @@ reachable, else the version-file value.</purpose>
|
|
|
15
15
|
<item>Untagged is not an error — it resolves to the version-file value; only a missing or unparsable version file throws.</item>
|
|
16
16
|
</KEY_DECISIONS>
|
|
17
17
|
<CHANGE_SUMMARY>
|
|
18
|
-
<item>RFC-1493: step 1 — public os/flow export resolveRepositoryLineVersion</item>
|
|
19
|
-
<item>RFC-1493: step 1 — forge public release-line version reader</item>
|
|
20
18
|
<item>RFC-1494: step 1 — isFlowAdopted public export</item>
|
|
21
19
|
<item>RFC-1495: step 1 - forge state roots</item>
|
|
22
20
|
<item>RFC-1495: steps 2-3 - workshop paths resolver and call-site migration</item>
|
|
21
|
+
<item>RFC-1519: add advisory gate-verdict store for scoped pass reuse across reruns and the commit-integrate boundary</item>
|
|
22
|
+
<item>RFC-1549: route generated onboarding-status commits through session flow on fixed branches
|
|
23
|
+
|
|
24
|
+
commitWerkstattSideEffects skips git add+commit when classifyBranch() yields non-flow (protected/nonconforming), reports written outputPaths; status-hook and deploy/leitstand results propagate onboardingStatus metadata; leitstand.promote surfaces an optional session-worktree integration nextStep. Flow-branch commit behavior unchanged; mission-open fixture rebased to conforming auto/task-YYMMDD-NN branch. AC-1..AC-3 checked.</item>
|
|
25
|
+
<history>RFC-1493</history>
|
|
23
26
|
</CHANGE_SUMMARY>
|
|
24
27
|
*/
|
|
25
28
|
|
|
@@ -39,8 +42,11 @@ import {
|
|
|
39
42
|
// werkstatt.lock.recover build state paths and Forge must not import
|
|
40
43
|
// @warpgogol/*). The engine's workshop-paths builds the names on top.
|
|
41
44
|
export { primaryWorktree, resolveStateRoots, worktreeList };
|
|
45
|
+
export { FORGE_STATE_FILES } from "./git.ts";
|
|
42
46
|
export type { StateRoots };
|
|
43
47
|
export type { FlowWorktree } from "./git.ts";
|
|
48
|
+
export { classifyBranch } from "./branch-name.ts";
|
|
49
|
+
export type { BranchClass } from "./branch-name.ts";
|
|
44
50
|
|
|
45
51
|
export interface RepositoryLineVersion {
|
|
46
52
|
/** "6.451.0+12.ab12cd34e" for a tagged line, "6.451.0" from the version file otherwise. */
|
package/os/flow/line-version.ts
CHANGED
|
@@ -18,6 +18,7 @@ re-reads the tag grammar itself.</purpose>
|
|
|
18
18
|
<item>RFC-1493: step 1 — shared derived-version extraction consumed by flow.version and resolveRepositoryLineVersion</item>
|
|
19
19
|
<item>RFC-1493: step 1 — forge public release-line version reader</item>
|
|
20
20
|
<item>RFC-1493: step 2 — platform identity command, migrator-cursor pin comparison</item>
|
|
21
|
+
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
21
22
|
</CHANGE_SUMMARY>
|
|
22
23
|
*/
|
|
23
24
|
|
|
@@ -60,7 +61,7 @@ async function dirtyPaths(
|
|
|
60
61
|
): Promise<number> {
|
|
61
62
|
let entries: string[];
|
|
62
63
|
try {
|
|
63
|
-
entries = await statusTracked(repoRoot, io);
|
|
64
|
+
entries = (await statusTracked(repoRoot, io)).entries;
|
|
64
65
|
} catch {
|
|
65
66
|
return 0;
|
|
66
67
|
}
|