@warpgogol/forge 9.3.1 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +32 -0
- package/CHANGELOG.md +25 -0
- package/README.md +2 -2
- 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 +48 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -0
- package/dist/os/flow/dirty-classify.js +81 -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 +85 -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 +54 -31
- 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 +48 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +536 -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-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 +1 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +3 -1
- 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/preflight.d.ts +114 -0
- package/dist/os/flow/preflight.d.ts.map +1 -0
- package/dist/os/flow/preflight.js +620 -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/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/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 +83 -8
- 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 +35 -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-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/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 +112 -0
- package/os/flow/flow.module.ts +92 -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 +97 -46
- 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 +808 -182
- package/os/flow/handlers/flow-open.ts +135 -11
- package/os/flow/handlers/flow-status.ts +45 -13
- package/os/flow/index.ts +3 -1
- package/os/flow/line-version.ts +2 -1
- package/os/flow/locks.ts +56 -14
- package/os/flow/preflight.ts +763 -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/tests/dirty-classify.test.ts +116 -0
- package/os/flow/tests/fixtures/branch-names.yaml +40 -40
- 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 +561 -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 +348 -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/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/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 +82 -0
- package/os/rfc/handlers/list-create.ts +101 -8
- 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 +28 -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-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-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 +37 -11
- 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/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/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
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.integrate --reattach tests (RFC-1531 AC-1/AC-2/AC-7): a
|
|
4
|
+
registered branch whose worktree vanished integrates after one --reattach
|
|
5
|
+
run — the worktree is recreated at the recorded registry path (or the
|
|
6
|
+
canonical sibling when its parent is gone) inside the integration lock; a
|
|
7
|
+
no-flag run still refuses and its fixHint names --reattach; --dry-run
|
|
8
|
+
reports the target without mutating; an occupied recorded path refuses
|
|
9
|
+
FLOW-INT-17.</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>No dirty-tree remediation — flow-integrate.remediation.test.ts owns --auto-clean/--autocommit.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<CHANGE_SUMMARY>
|
|
15
|
+
<item>RFC-1531: closed dirty-path classifier + remediation flags on flow.integrate</item>
|
|
16
|
+
<item>RFC-1531: add flow.integrate remediation flags on the shared dirty classifier</item>
|
|
17
|
+
</CHANGE_SUMMARY>
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
21
|
+
import { dirname, join } from "node:path";
|
|
22
|
+
|
|
23
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
24
|
+
|
|
25
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
26
|
+
import { integrateFlowBranch } from "../handlers/flow-integrate.ts";
|
|
27
|
+
import { openFlowBranch } from "../handlers/flow-open.ts";
|
|
28
|
+
import {
|
|
29
|
+
commonGitDir,
|
|
30
|
+
readRegistry,
|
|
31
|
+
updateRegistry,
|
|
32
|
+
} from "../registry.ts";
|
|
33
|
+
import { flowWorktreePath } from "../worktree-path.ts";
|
|
34
|
+
import { gitExec, initRepo } from "./helpers.ts";
|
|
35
|
+
|
|
36
|
+
const NOW = new Date("2026-11-02T12:00:00Z");
|
|
37
|
+
|
|
38
|
+
const dirs: string[] = [];
|
|
39
|
+
afterEach(async () => {
|
|
40
|
+
for (const dir of dirs.splice(0)) {
|
|
41
|
+
await rm(dir, { recursive: true, force: true });
|
|
42
|
+
}
|
|
43
|
+
}, 20_000);
|
|
44
|
+
|
|
45
|
+
async function governedRepo(): Promise<string> {
|
|
46
|
+
const dir = await initRepo({ prefix: "flow-reattach-" });
|
|
47
|
+
dirs.push(dir);
|
|
48
|
+
await writeFile(join(dir, "forge.yaml"), 'schema: "forge/workspace@1"\n');
|
|
49
|
+
await gitExec(dir, ["branch", "develop", "HEAD"]);
|
|
50
|
+
await gitExec(dir, ["switch", "develop"]);
|
|
51
|
+
return dir;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function openSession(repo: string, slug: string) {
|
|
55
|
+
const data = await openFlowBranch(repo, ambientIo, {
|
|
56
|
+
kind: "session",
|
|
57
|
+
slug,
|
|
58
|
+
brief: null,
|
|
59
|
+
owner: null,
|
|
60
|
+
dryRun: false,
|
|
61
|
+
now: NOW,
|
|
62
|
+
});
|
|
63
|
+
expect(data.diagnostics).toEqual([]);
|
|
64
|
+
dirs.push(data.worktree!);
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function commitIn(worktree: string, file: string, content: string): Promise<void> {
|
|
69
|
+
await writeFile(join(worktree, file), content);
|
|
70
|
+
await gitExec(worktree, ["add", file]);
|
|
71
|
+
const r = await gitExec(worktree, ["commit", "-m", `add ${file}`]);
|
|
72
|
+
if (r.exitCode !== 0) throw new Error(`commit in ${worktree} failed: ${r.stderr}`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
describe("flow.integrate --reattach (RFC-1531)", () => {
|
|
76
|
+
it("AC-1: recreates the vanished worktree at the recorded registry path and integrates", async () => {
|
|
77
|
+
const repo = await governedRepo();
|
|
78
|
+
const session = await openSession(repo, "vanished");
|
|
79
|
+
await commitIn(session.worktree!, "rescue.txt", "rescued work");
|
|
80
|
+
const recorded = session.worktree!;
|
|
81
|
+
await rm(recorded, { recursive: true, force: true });
|
|
82
|
+
|
|
83
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
84
|
+
branch: session.branch!,
|
|
85
|
+
dryRun: false,
|
|
86
|
+
now: NOW,
|
|
87
|
+
reattach: true,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
expect(data.diagnostics).toEqual([]);
|
|
91
|
+
expect(data.reattachedTo).toBe(recorded);
|
|
92
|
+
expect(data.integrated).toBe(true);
|
|
93
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:rescue.txt"])).exitCode).toBe(0);
|
|
94
|
+
// Cleanup tore the reattached worktree down with the rest of the flow.
|
|
95
|
+
expect(await ambientIo.exists(recorded)).toBe(false);
|
|
96
|
+
expect(data.cleanedUp).toBe(true);
|
|
97
|
+
}, 20_000);
|
|
98
|
+
|
|
99
|
+
it("AC-1b: falls back to the canonical sibling path when the recorded parent is gone", async () => {
|
|
100
|
+
const repo = await governedRepo();
|
|
101
|
+
const session = await openSession(repo, "relocated");
|
|
102
|
+
await commitIn(session.worktree!, "r.txt", "work");
|
|
103
|
+
await rm(session.worktree!, { recursive: true, force: true });
|
|
104
|
+
// Rewrite the recorded path to one whose parent does not exist — the
|
|
105
|
+
// canonical <repo>@<branch> sibling takes over.
|
|
106
|
+
const common = await commonGitDir(ambientIo, repo);
|
|
107
|
+
const phantom = join(dirname(repo), "no-such-parent-xyz", "wt");
|
|
108
|
+
await updateRegistry(ambientIo, common, (r) => ({
|
|
109
|
+
...r,
|
|
110
|
+
branches: r.branches.map((b) =>
|
|
111
|
+
b.name === session.branch ? { ...b, worktree: phantom } : b,
|
|
112
|
+
),
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
116
|
+
branch: session.branch!,
|
|
117
|
+
dryRun: false,
|
|
118
|
+
now: NOW,
|
|
119
|
+
reattach: true,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const canonical = flowWorktreePath(repo, session.branch!);
|
|
123
|
+
expect(data.diagnostics).toEqual([]);
|
|
124
|
+
expect(data.reattachedTo).toBe(canonical);
|
|
125
|
+
expect(data.integrated).toBe(true);
|
|
126
|
+
dirs.push(canonical);
|
|
127
|
+
}, 20_000);
|
|
128
|
+
|
|
129
|
+
it("AC-2: a vanished entry without --reattach still refuses, and the fixHint names --reattach", async () => {
|
|
130
|
+
const repo = await governedRepo();
|
|
131
|
+
const session = await openSession(repo, "noflag");
|
|
132
|
+
await commitIn(session.worktree!, "gone.txt", "gone");
|
|
133
|
+
await rm(session.worktree!, { recursive: true, force: true });
|
|
134
|
+
|
|
135
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
136
|
+
branch: session.branch!,
|
|
137
|
+
dryRun: false,
|
|
138
|
+
now: NOW,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
expect(data.integrated).toBe(false);
|
|
142
|
+
expect(data.diagnostics[0]?.data?.["vanished"]).toBe(true);
|
|
143
|
+
expect(data.diagnostics[0]?.fixHint).toContain("--reattach");
|
|
144
|
+
// The branch's unique commits survive — nothing was touched.
|
|
145
|
+
expect((await gitExec(repo, ["rev-parse", "--verify", session.branch!])).exitCode).toBe(0);
|
|
146
|
+
const registry = await readRegistry(ambientIo, await commonGitDir(ambientIo, repo));
|
|
147
|
+
expect(registry.branches.some((b) => b.name === session.branch)).toBe(true);
|
|
148
|
+
}, 20_000);
|
|
149
|
+
|
|
150
|
+
it("AC-2/AC-7: --dry-run --reattach reports the FLOW-07 refusal and the target without creating it", async () => {
|
|
151
|
+
const repo = await governedRepo();
|
|
152
|
+
const session = await openSession(repo, "ghost-preview");
|
|
153
|
+
await commitIn(session.worktree!, "gone.txt", "gone");
|
|
154
|
+
const recorded = session.worktree!;
|
|
155
|
+
await rm(recorded, { recursive: true, force: true });
|
|
156
|
+
|
|
157
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
158
|
+
branch: session.branch!,
|
|
159
|
+
dryRun: true,
|
|
160
|
+
now: NOW,
|
|
161
|
+
reattach: true,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-07");
|
|
165
|
+
expect(data.diagnostics[0]?.fixHint).toContain("--reattach");
|
|
166
|
+
expect(data.diagnostics[0]?.data?.["wouldReattach"]).toBe(recorded);
|
|
167
|
+
expect(data.wouldReattach).toBe(recorded);
|
|
168
|
+
// AC-7: nothing was created.
|
|
169
|
+
expect(await ambientIo.exists(recorded)).toBe(false);
|
|
170
|
+
}, 20_000);
|
|
171
|
+
|
|
172
|
+
it("a recorded path occupied by a foreign tree refuses FLOW-INT-17 — never a silent mix", async () => {
|
|
173
|
+
const repo = await governedRepo();
|
|
174
|
+
const session = await openSession(repo, "squat");
|
|
175
|
+
await commitIn(session.worktree!, "s.txt", "s");
|
|
176
|
+
const recorded = session.worktree!;
|
|
177
|
+
await rm(recorded, { recursive: true, force: true });
|
|
178
|
+
// Clear the stale worktree registration so git associates no live
|
|
179
|
+
// worktree with the branch, then squat on the recorded path.
|
|
180
|
+
await gitExec(repo, ["worktree", "prune"]);
|
|
181
|
+
await mkdir(recorded, { recursive: true });
|
|
182
|
+
await writeFile(join(recorded, "occupant.txt"), "not the session\n");
|
|
183
|
+
|
|
184
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
185
|
+
branch: session.branch!,
|
|
186
|
+
dryRun: false,
|
|
187
|
+
now: NOW,
|
|
188
|
+
reattach: true,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
expect(data.integrated).toBe(false);
|
|
192
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-INT-17");
|
|
193
|
+
expect(data.diagnostics[0]?.message).toContain("occupied");
|
|
194
|
+
// The occupant is untouched.
|
|
195
|
+
expect(await ambientIo.exists(join(recorded, "occupant.txt"))).toBe(true);
|
|
196
|
+
}, 20_000);
|
|
197
|
+
});
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>flow.integrate remediation-flag tests (RFC-1531 AC-3/4/5/7):
|
|
4
|
+
--auto-clean deletes exactly the closed disposable class then re-evaluates
|
|
5
|
+
(a work or importer-prune member in the set deletes nothing and refuses
|
|
6
|
+
FLOW-INT-01 with per-path classes), --autocommit sweeps the remainder into
|
|
7
|
+
the fixed-subject commit and records its sha, and every flag mutates
|
|
8
|
+
nothing under --dry-run.</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>No vanished-worktree coverage — flow-integrate.reattach.test.ts owns --reattach.</item>
|
|
11
|
+
</non-goals>
|
|
12
|
+
</MODULE_CONTRACT>
|
|
13
|
+
<CHANGE_SUMMARY>
|
|
14
|
+
<item>RFC-1531: closed dirty-path classifier + remediation flags on flow.integrate</item>
|
|
15
|
+
<item>RFC-1531: add flow.integrate remediation flags on the shared dirty classifier</item>
|
|
16
|
+
</CHANGE_SUMMARY>
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
|
|
22
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
23
|
+
|
|
24
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
25
|
+
import { integrateFlowBranch } from "../handlers/flow-integrate.ts";
|
|
26
|
+
import { openFlowBranch } from "../handlers/flow-open.ts";
|
|
27
|
+
import { commonGitDir, readJournal } from "../registry.ts";
|
|
28
|
+
import { gitExec, initRepo } from "./helpers.ts";
|
|
29
|
+
|
|
30
|
+
const NOW = new Date("2026-11-02T12:00:00Z");
|
|
31
|
+
|
|
32
|
+
const dirs: string[] = [];
|
|
33
|
+
afterEach(async () => {
|
|
34
|
+
for (const dir of dirs.splice(0)) {
|
|
35
|
+
await rm(dir, { recursive: true, force: true });
|
|
36
|
+
}
|
|
37
|
+
}, 20_000);
|
|
38
|
+
|
|
39
|
+
async function governedRepo(): Promise<string> {
|
|
40
|
+
const dir = await initRepo({ prefix: "flow-remediate-" });
|
|
41
|
+
dirs.push(dir);
|
|
42
|
+
await writeFile(join(dir, "forge.yaml"), 'schema: "forge/workspace@1"\n');
|
|
43
|
+
await gitExec(dir, ["branch", "develop", "HEAD"]);
|
|
44
|
+
await gitExec(dir, ["switch", "develop"]);
|
|
45
|
+
return dir;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function openSession(repo: string, slug: string) {
|
|
49
|
+
const data = await openFlowBranch(repo, ambientIo, {
|
|
50
|
+
kind: "session",
|
|
51
|
+
slug,
|
|
52
|
+
brief: null,
|
|
53
|
+
owner: null,
|
|
54
|
+
dryRun: false,
|
|
55
|
+
now: NOW,
|
|
56
|
+
});
|
|
57
|
+
expect(data.diagnostics).toEqual([]);
|
|
58
|
+
dirs.push(data.worktree!);
|
|
59
|
+
return data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function commitIn(worktree: string, file: string, content: string): Promise<void> {
|
|
63
|
+
await writeFile(join(worktree, file), content);
|
|
64
|
+
await gitExec(worktree, ["add", file]);
|
|
65
|
+
const r = await gitExec(worktree, ["commit", "-m", `add ${file}`]);
|
|
66
|
+
if (r.exitCode !== 0) throw new Error(`commit in ${worktree} failed: ${r.stderr}`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function sha(repo: string, ref: string): Promise<string> {
|
|
70
|
+
return (await gitExec(repo, ["rev-parse", ref])).stdout.trim();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
describe("flow.integrate --auto-clean (RFC-1531)", () => {
|
|
74
|
+
it("AC-3: an all-disposable dirty set is deleted and the pipeline proceeds", async () => {
|
|
75
|
+
const repo = await governedRepo();
|
|
76
|
+
const session = await openSession(repo, "debris");
|
|
77
|
+
await commitIn(session.worktree!, "real.txt", "real work");
|
|
78
|
+
await writeFile(join(session.worktree!, "scratch.log"), "scratch\n");
|
|
79
|
+
await mkdir(join(session.worktree!, "coverage"), { recursive: true });
|
|
80
|
+
await writeFile(join(session.worktree!, "coverage", "lcov.info"), "lcov\n");
|
|
81
|
+
await mkdir(join(session.worktree!, "tmp-e2e"), { recursive: true });
|
|
82
|
+
await writeFile(join(session.worktree!, "tmp-e2e", "trace.out"), "trace\n");
|
|
83
|
+
await writeFile(join(session.worktree!, "leftover.stale"), "stale\n");
|
|
84
|
+
|
|
85
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
86
|
+
branch: session.branch!,
|
|
87
|
+
dryRun: false,
|
|
88
|
+
now: NOW,
|
|
89
|
+
autoClean: true,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
expect(data.diagnostics).toEqual([]);
|
|
93
|
+
expect(data.integrated).toBe(true);
|
|
94
|
+
expect(data.autoCleaned).toEqual(
|
|
95
|
+
expect.arrayContaining([
|
|
96
|
+
"scratch.log",
|
|
97
|
+
"coverage/lcov.info",
|
|
98
|
+
"tmp-e2e/trace.out",
|
|
99
|
+
"leftover.stale",
|
|
100
|
+
]),
|
|
101
|
+
);
|
|
102
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:real.txt"])).exitCode).toBe(0);
|
|
103
|
+
// The disposable debris was deleted, not committed.
|
|
104
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:scratch.log"])).exitCode).not.toBe(0);
|
|
105
|
+
// The journal records the cleanup for auditability.
|
|
106
|
+
const journal = await readJournal(ambientIo, await commonGitDir(ambientIo, repo));
|
|
107
|
+
const integrate = [...journal].reverse().find(
|
|
108
|
+
(e) => e.event === "integrate" && e.branch === session.branch,
|
|
109
|
+
);
|
|
110
|
+
expect(integrate?.autoCleaned).toEqual(
|
|
111
|
+
expect.arrayContaining(["scratch.log"]),
|
|
112
|
+
);
|
|
113
|
+
}, 20_000);
|
|
114
|
+
|
|
115
|
+
it("AC-4: a work member in the set deletes nothing and refuses FLOW-INT-01 with per-path classes", async () => {
|
|
116
|
+
const repo = await governedRepo();
|
|
117
|
+
const session = await openSession(repo, "mixed");
|
|
118
|
+
await commitIn(session.worktree!, "real.txt", "real");
|
|
119
|
+
await writeFile(join(session.worktree!, "scratch.log"), "debris\n");
|
|
120
|
+
await writeFile(join(session.worktree!, "important.ts"), "export const x = 1;\n");
|
|
121
|
+
|
|
122
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
123
|
+
branch: session.branch!,
|
|
124
|
+
dryRun: false,
|
|
125
|
+
now: NOW,
|
|
126
|
+
autoClean: true,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
expect(data.integrated).toBe(false);
|
|
130
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-INT-01");
|
|
131
|
+
// Nothing was deleted — the disposable sibling stays for the operator.
|
|
132
|
+
expect(await ambientIo.exists(join(session.worktree!, "scratch.log"))).toBe(true);
|
|
133
|
+
// data.entries carries the classified set: scratch.log disposable,
|
|
134
|
+
// important.ts work.
|
|
135
|
+
const entries = data.diagnostics[0]?.data?.["entries"] as
|
|
136
|
+
| Array<{ path: string; class: string }>
|
|
137
|
+
| undefined;
|
|
138
|
+
expect(entries).toEqual(
|
|
139
|
+
expect.arrayContaining([
|
|
140
|
+
{ path: "scratch.log", class: "disposable" },
|
|
141
|
+
{ path: "important.ts", class: "work" },
|
|
142
|
+
]),
|
|
143
|
+
);
|
|
144
|
+
expect(data.diagnostics[0]?.data?.["classes"]).toMatchObject({
|
|
145
|
+
disposable: 1,
|
|
146
|
+
work: 1,
|
|
147
|
+
});
|
|
148
|
+
}, 20_000);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe("flow.integrate --autocommit (RFC-1531)", () => {
|
|
152
|
+
it("AC-5/AC-9: remaining dirty entries sweep into the fixed-subject commit before the rebase", async () => {
|
|
153
|
+
const repo = await governedRepo();
|
|
154
|
+
const session = await openSession(repo, "sweep");
|
|
155
|
+
await commitIn(session.worktree!, "real.txt", "real");
|
|
156
|
+
await writeFile(join(session.worktree!, "notes.md"), "loose notes\n");
|
|
157
|
+
await writeFile(join(session.worktree!, "draft.ts"), "export {};\n");
|
|
158
|
+
|
|
159
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
160
|
+
branch: session.branch!,
|
|
161
|
+
dryRun: false,
|
|
162
|
+
now: NOW,
|
|
163
|
+
autocommit: true,
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
expect(data.diagnostics).toEqual([]);
|
|
167
|
+
expect(data.integrated).toBe(true);
|
|
168
|
+
expect(data.autocommitSha).toMatch(/^[0-9a-f]{40}$/);
|
|
169
|
+
// The sweep commit carries the fixed subject and both files.
|
|
170
|
+
const subject = (
|
|
171
|
+
await gitExec(repo, ["log", "-1", "--format=%s", data.autocommitSha!])
|
|
172
|
+
).stdout.trim();
|
|
173
|
+
expect(subject).toBe("chore(flow): sweep session leftovers");
|
|
174
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:notes.md"])).exitCode).toBe(0);
|
|
175
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:draft.ts"])).exitCode).toBe(0);
|
|
176
|
+
}, 20_000);
|
|
177
|
+
|
|
178
|
+
it("composition: --auto-clean deletes disposable first, --autocommit sweeps only what remains", async () => {
|
|
179
|
+
const repo = await governedRepo();
|
|
180
|
+
const session = await openSession(repo, "composed");
|
|
181
|
+
await commitIn(session.worktree!, "real.txt", "real");
|
|
182
|
+
await writeFile(join(session.worktree!, "scratch.log"), "debris\n");
|
|
183
|
+
await writeFile(join(session.worktree!, "keep.ts"), "export {};\n");
|
|
184
|
+
|
|
185
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
186
|
+
branch: session.branch!,
|
|
187
|
+
dryRun: false,
|
|
188
|
+
now: NOW,
|
|
189
|
+
autoClean: true,
|
|
190
|
+
autocommit: true,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
expect(data.diagnostics).toEqual([]);
|
|
194
|
+
expect(data.integrated).toBe(true);
|
|
195
|
+
expect(data.autoCleaned).toEqual(["scratch.log"]);
|
|
196
|
+
// Debris never lands in the sweep commit.
|
|
197
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:scratch.log"])).exitCode).not.toBe(0);
|
|
198
|
+
expect((await gitExec(repo, ["cat-file", "-e", "develop:keep.ts"])).exitCode).toBe(0);
|
|
199
|
+
}, 20_000);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
describe("remediation flags under --dry-run (RFC-1531 AC-7)", () => {
|
|
203
|
+
it("reports the classified set and the would-clean scope without deleting or committing", async () => {
|
|
204
|
+
const repo = await governedRepo();
|
|
205
|
+
const session = await openSession(repo, "preview");
|
|
206
|
+
await commitIn(session.worktree!, "real.txt", "real");
|
|
207
|
+
await writeFile(join(session.worktree!, "scratch.log"), "debris\n");
|
|
208
|
+
await writeFile(join(session.worktree!, "keep.ts"), "export {};\n");
|
|
209
|
+
const tip = await sha(repo, session.branch!);
|
|
210
|
+
|
|
211
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
212
|
+
branch: session.branch!,
|
|
213
|
+
dryRun: true,
|
|
214
|
+
now: NOW,
|
|
215
|
+
autoClean: true,
|
|
216
|
+
autocommit: true,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-INT-01");
|
|
220
|
+
expect(data.diagnostics[0]?.data?.["wouldAutoClean"]).toEqual(["scratch.log"]);
|
|
221
|
+
expect(data.diagnostics[0]?.data?.["wouldAutocommit"]).toBe(true);
|
|
222
|
+
// Nothing deleted, nothing committed.
|
|
223
|
+
expect(await ambientIo.exists(join(session.worktree!, "scratch.log"))).toBe(true);
|
|
224
|
+
expect(await ambientIo.exists(join(session.worktree!, "keep.ts"))).toBe(true);
|
|
225
|
+
expect(await sha(repo, session.branch!)).toBe(tip);
|
|
226
|
+
}, 20_000);
|
|
227
|
+
|
|
228
|
+
it("without flags the FLOW-INT-01 diagnostic still carries per-path classes (AC-6)", async () => {
|
|
229
|
+
const repo = await governedRepo();
|
|
230
|
+
const session = await openSession(repo, "classified");
|
|
231
|
+
await commitIn(session.worktree!, "real.txt", "real");
|
|
232
|
+
await writeFile(join(session.worktree!, "scratch.log"), "debris\n");
|
|
233
|
+
await writeFile(join(session.worktree!, "keep.ts"), "export {};\n");
|
|
234
|
+
|
|
235
|
+
const data = await integrateFlowBranch(repo, ambientIo, {
|
|
236
|
+
branch: session.branch!,
|
|
237
|
+
dryRun: false,
|
|
238
|
+
now: NOW,
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
expect(data.diagnostics[0]?.ruleId).toBe("FLOW-INT-01");
|
|
242
|
+
const entries = data.diagnostics[0]?.data?.["entries"] as
|
|
243
|
+
| Array<{ path: string; class: string }>
|
|
244
|
+
| undefined;
|
|
245
|
+
expect(entries).toEqual(
|
|
246
|
+
expect.arrayContaining([
|
|
247
|
+
{ path: "scratch.log", class: "disposable" },
|
|
248
|
+
{ path: "keep.ts", class: "work" },
|
|
249
|
+
]),
|
|
250
|
+
);
|
|
251
|
+
expect(data.diagnostics[0]?.fixHint).toContain("--auto-clean");
|
|
252
|
+
expect(data.diagnostics[0]?.fixHint).toContain("--autocommit");
|
|
253
|
+
}, 20_000);
|
|
254
|
+
});
|