@warpgogol/forge 9.3.0 → 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 +33 -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 +13 -3
- 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 +23 -7
- 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 +18 -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/profiles/forge-shell.yaml +1 -2
- package/profiles/knowledge.yaml +1 -1
- package/profiles/system.yaml +2 -2
- package/profiles/typescript.yaml +0 -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/profile-flow-hooks.test.ts +15 -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
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Unit tests for the RFC-1528 flow.integrate preflight — the strict
|
|
4
|
+
importer-prune-only lockfile classifier and the bounded ordered check list
|
|
5
|
+
(worktree/primary dirt → manifest → scoped RFCs → friction) with injectable
|
|
6
|
+
git/status/invoke seams.</purpose>
|
|
7
|
+
<non-goals>
|
|
8
|
+
<item>No real git, io or registry — deps are stubbed; integrateInner wiring is covered by the handler-level tests.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<CHANGE_SUMMARY>
|
|
12
|
+
<item>RFC-1528: initial — classifier shapes, refusal ordering, resolvability skips, FLOW-INT-12/13/14.</item>
|
|
13
|
+
<item>RFC-1528: flow.integrate bounded preflight before rebase and gate
|
|
14
|
+
|
|
15
|
+
Classified lockfile diffs on FLOW-INT-01/03, early primary check, and resolvable validators (ecosystem.manifest.validate, scoped rfc.validate, friction.validate) refusing as FLOW-INT-12/13/14.</item>
|
|
16
|
+
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
17
|
+
<item>RFC-1537: classify regenerable worktree dirt and journal integrate refusals cheapest-first</item>
|
|
18
|
+
</CHANGE_SUMMARY>
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { describe, it, expect } from "vitest";
|
|
22
|
+
import {
|
|
23
|
+
classifyDirt,
|
|
24
|
+
classifyLockfileDiff,
|
|
25
|
+
classifyLockfileMaterialize,
|
|
26
|
+
runIntegratePreflight,
|
|
27
|
+
} from "../preflight.ts";
|
|
28
|
+
import type {
|
|
29
|
+
CommandRegistry,
|
|
30
|
+
ForgeCommandDefinition,
|
|
31
|
+
ForgeInvokeResult,
|
|
32
|
+
ForgeRegisteredCommandInfo,
|
|
33
|
+
WorkspaceIO,
|
|
34
|
+
} from "../../../src/types.ts";
|
|
35
|
+
|
|
36
|
+
const PRUNE_DIFF = `diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
|
|
37
|
+
index abc..def 100644
|
|
38
|
+
--- a/pnpm-lock.yaml
|
|
39
|
+
+++ b/pnpm-lock.yaml
|
|
40
|
+
@@ -10,7 +10,6 @@ importers:
|
|
41
|
+
packages/forge:
|
|
42
|
+
dependencies: {}
|
|
43
|
+
- missions/m000214/workpiece:
|
|
44
|
+
- dependencies:
|
|
45
|
+
- vite: 5.0.0
|
|
46
|
+
packages/werkstatt-site:
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const MIXED_DIFF = `diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
|
|
50
|
+
index abc..def 100644
|
|
51
|
+
--- a/pnpm-lock.yaml
|
|
52
|
+
+++ b/pnpm-lock.yaml
|
|
53
|
+
@@ -10,7 +10,6 @@ importers:
|
|
54
|
+
- missions/m000214/workpiece:
|
|
55
|
+
- dependencies: {}
|
|
56
|
+
- packages/werkstatt-site:
|
|
57
|
+
- dependencies: {}
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
const ADDED_DIFF = `diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
|
|
61
|
+
index abc..def 100644
|
|
62
|
+
--- a/pnpm-lock.yaml
|
|
63
|
+
+++ b/pnpm-lock.yaml
|
|
64
|
+
@@ -10,6 +10,7 @@ importers:
|
|
65
|
+
- missions/m000214/workpiece:
|
|
66
|
+
+ missions/m000215/workpiece:
|
|
67
|
+
+ dependencies: {}
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
describe("classifyLockfileDiff (RFC-1528)", () => {
|
|
71
|
+
it("labels the vanished mission-importer prune shape", () => {
|
|
72
|
+
expect(classifyLockfileDiff(PRUNE_DIFF)).toBe("importer-prune-only");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("removals outside the workpiece importer block stay ordinary refusals", () => {
|
|
76
|
+
expect(classifyLockfileDiff(MIXED_DIFF)).toBe("other");
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("any added line is not a prune", () => {
|
|
80
|
+
expect(classifyLockfileDiff(ADDED_DIFF)).toBe("other");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("nested removals without the workpiece key are ambiguous — other", () => {
|
|
84
|
+
const nestedOnly = `@@ -1,4 +1,3 @@
|
|
85
|
+
- dependencies:
|
|
86
|
+
- vite: 5.0.0
|
|
87
|
+
packages/forge:
|
|
88
|
+
`;
|
|
89
|
+
expect(classifyLockfileDiff(nestedOnly)).toBe("other");
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("no removals at all is not a prune", () => {
|
|
93
|
+
expect(classifyLockfileDiff("@@ -1 +1 @@\n+ foo: bar\n")).toBe("other");
|
|
94
|
+
expect(classifyLockfileDiff("")).toBe("other");
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// ── runIntegratePreflight — ordering + refusal mapping ────────────────────
|
|
99
|
+
|
|
100
|
+
const io = {} as WorkspaceIO;
|
|
101
|
+
|
|
102
|
+
function registryWith(commands: string[]): CommandRegistry {
|
|
103
|
+
const known = new Set(commands);
|
|
104
|
+
return {
|
|
105
|
+
listCommandNames: () => [...known],
|
|
106
|
+
listCommands: () =>
|
|
107
|
+
[...known].map(
|
|
108
|
+
(name) =>
|
|
109
|
+
({
|
|
110
|
+
name,
|
|
111
|
+
provider: "workspace",
|
|
112
|
+
description: "",
|
|
113
|
+
scope: "workspace",
|
|
114
|
+
flags: {},
|
|
115
|
+
}) as ForgeRegisteredCommandInfo,
|
|
116
|
+
),
|
|
117
|
+
getCommand: (name: string) =>
|
|
118
|
+
known.has(name) ? ({ name } as ForgeCommandDefinition) : undefined,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const ALL_VALIDATORS = ["ecosystem.manifest.validate", "rfc.validate", "friction.validate"];
|
|
123
|
+
|
|
124
|
+
function cleanDirty() {
|
|
125
|
+
return { entries: [] as string[], toleratedState: [] as string[], vanished: false };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function stubDeps(overrides: {
|
|
129
|
+
gitStdout?: string;
|
|
130
|
+
primaryDirty?: { entries: string[]; toleratedState: string[]; vanished: boolean };
|
|
131
|
+
primaryBranch?: string | null;
|
|
132
|
+
lockfileDiff?: string;
|
|
133
|
+
}) {
|
|
134
|
+
return {
|
|
135
|
+
runGit: async (_cwd: string, _io: WorkspaceIO, args: string[]) => {
|
|
136
|
+
if (args[0] === "diff" && args.includes("pnpm-lock.yaml")) {
|
|
137
|
+
return { stdout: overrides.lockfileDiff ?? "", stderr: "", exitCode: 0 };
|
|
138
|
+
}
|
|
139
|
+
return { stdout: overrides.gitStdout ?? "", stderr: "", exitCode: 0 };
|
|
140
|
+
},
|
|
141
|
+
runStatusTracked: async () => overrides.primaryDirty ?? cleanDirty(),
|
|
142
|
+
runCurrentBranch: async () =>
|
|
143
|
+
overrides.primaryBranch === undefined ? "develop" : overrides.primaryBranch,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function baseOpts(overrides: Partial<Parameters<typeof runIntegratePreflight>[0]> = {}) {
|
|
148
|
+
return {
|
|
149
|
+
primary: "/primary",
|
|
150
|
+
branchWorktree: "/wt",
|
|
151
|
+
branch: "auto/session-260107-01-x",
|
|
152
|
+
io,
|
|
153
|
+
worktreeDirty: cleanDirty(),
|
|
154
|
+
commandRegistry: registryWith(ALL_VALIDATORS),
|
|
155
|
+
...overrides,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
describe("runIntegratePreflight (RFC-1528 AC-2/AC-4)", () => {
|
|
160
|
+
it("a dirty worktree refuses FLOW-INT-01 before any validator runs", async () => {
|
|
161
|
+
const invokes: string[] = [];
|
|
162
|
+
const result = await runIntegratePreflight(
|
|
163
|
+
baseOpts({
|
|
164
|
+
worktreeDirty: { entries: [" M docs/x.md"], toleratedState: [] },
|
|
165
|
+
invoke: async (name) => {
|
|
166
|
+
invokes.push(name);
|
|
167
|
+
return { ok: true, exitCode: 0 } as ForgeInvokeResult;
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
stubDeps({}),
|
|
171
|
+
);
|
|
172
|
+
expect(result.ok).toBe(false);
|
|
173
|
+
expect(result.refuse?.ruleId).toBe("FLOW-INT-01");
|
|
174
|
+
expect(result.checked).toEqual(["worktree-dirty"]);
|
|
175
|
+
expect(invokes).toEqual([]);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it("a prune-shaped dirty lockfile is tolerated regenerable dirt (RFC-1537)", async () => {
|
|
179
|
+
const result = await runIntegratePreflight(
|
|
180
|
+
baseOpts({ worktreeDirty: { entries: [" M pnpm-lock.yaml"], toleratedState: [] } }),
|
|
181
|
+
stubDeps({ lockfileDiff: PRUNE_DIFF }),
|
|
182
|
+
);
|
|
183
|
+
expect(result.ok).toBe(true);
|
|
184
|
+
expect(result.tolerated).toEqual([{ path: "pnpm-lock.yaml", class: "importer-prune" }]);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it("primary tracked dirt refuses FLOW-INT-03 before validators", async () => {
|
|
188
|
+
const invokes: string[] = [];
|
|
189
|
+
const result = await runIntegratePreflight(
|
|
190
|
+
baseOpts({
|
|
191
|
+
invoke: async (name) => {
|
|
192
|
+
invokes.push(name);
|
|
193
|
+
return { ok: true, exitCode: 0 } as ForgeInvokeResult;
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
stubDeps({
|
|
197
|
+
primaryDirty: { entries: [" M docs/y.md"], toleratedState: [], vanished: false },
|
|
198
|
+
}),
|
|
199
|
+
);
|
|
200
|
+
expect(result.refuse?.ruleId).toBe("FLOW-INT-03");
|
|
201
|
+
expect(result.checked).toEqual(["worktree-dirty", "primary-dirty"]);
|
|
202
|
+
expect(invokes).toEqual([]);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it("a stale manifest refuses FLOW-INT-12 before RFC/friction checks", async () => {
|
|
206
|
+
const invokes: string[] = [];
|
|
207
|
+
const result = await runIntegratePreflight(
|
|
208
|
+
baseOpts({
|
|
209
|
+
invoke: async (name) => {
|
|
210
|
+
invokes.push(name);
|
|
211
|
+
return name === "ecosystem.manifest.validate"
|
|
212
|
+
? ({ ok: false, exitCode: 1, summary: "manifest drift" } as ForgeInvokeResult)
|
|
213
|
+
: ({ ok: true, exitCode: 0 } as ForgeInvokeResult);
|
|
214
|
+
},
|
|
215
|
+
}),
|
|
216
|
+
stubDeps({}),
|
|
217
|
+
);
|
|
218
|
+
expect(result.refuse?.ruleId).toBe("FLOW-INT-12");
|
|
219
|
+
expect(invokes).toEqual(["ecosystem.manifest.validate"]);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it("rfc.validate is scoped to RFC files changed on develop...branch", async () => {
|
|
223
|
+
const invokes: string[] = [];
|
|
224
|
+
const result = await runIntegratePreflight(
|
|
225
|
+
baseOpts({
|
|
226
|
+
invoke: async (name, flags) => {
|
|
227
|
+
invokes.push(`${name} ${JSON.stringify(flags ?? {})}`);
|
|
228
|
+
return { ok: true, exitCode: 0 } as ForgeInvokeResult;
|
|
229
|
+
},
|
|
230
|
+
}),
|
|
231
|
+
stubDeps({
|
|
232
|
+
gitStdout:
|
|
233
|
+
"docs/rfcs/rfc-1528-x.md\ndocs/rfcs/archive/implemented/rfc-1505-y.md\ndocs/adrs/adr-0120.md\n",
|
|
234
|
+
}),
|
|
235
|
+
);
|
|
236
|
+
expect(result.ok).toBe(true);
|
|
237
|
+
expect(invokes).toEqual([
|
|
238
|
+
"ecosystem.manifest.validate {}",
|
|
239
|
+
'rfc.validate {"id":"RFC-1528"}',
|
|
240
|
+
'rfc.validate {"id":"RFC-1505"}',
|
|
241
|
+
"friction.validate {}",
|
|
242
|
+
]);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it("an invalid changed RFC refuses FLOW-INT-13", async () => {
|
|
246
|
+
const result = await runIntegratePreflight(
|
|
247
|
+
baseOpts({
|
|
248
|
+
invoke: async (name) =>
|
|
249
|
+
name === "rfc.validate"
|
|
250
|
+
? ({ ok: false, exitCode: 1, summary: "RFC-006 bad frontmatter" } as ForgeInvokeResult)
|
|
251
|
+
: ({ ok: true, exitCode: 0 } as ForgeInvokeResult),
|
|
252
|
+
}),
|
|
253
|
+
stubDeps({ gitStdout: "docs/rfcs/rfc-1528-x.md\n" }),
|
|
254
|
+
);
|
|
255
|
+
expect(result.refuse?.ruleId).toBe("FLOW-INT-13");
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("a broken friction registry refuses FLOW-INT-14", async () => {
|
|
259
|
+
const result = await runIntegratePreflight(
|
|
260
|
+
baseOpts({
|
|
261
|
+
invoke: async (name) =>
|
|
262
|
+
name === "friction.validate"
|
|
263
|
+
? ({ ok: false, exitCode: 1, summary: "duplicate id F-0100" } as ForgeInvokeResult)
|
|
264
|
+
: ({ ok: true, exitCode: 0 } as ForgeInvokeResult),
|
|
265
|
+
}),
|
|
266
|
+
stubDeps({}),
|
|
267
|
+
);
|
|
268
|
+
expect(result.refuse?.ruleId).toBe("FLOW-INT-14");
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it("absent invoke skips validators with notes — dirty checks still run", async () => {
|
|
272
|
+
const result = await runIntegratePreflight(baseOpts({ invoke: undefined }), stubDeps({}));
|
|
273
|
+
expect(result.ok).toBe(true);
|
|
274
|
+
expect(result.checked).toEqual(["worktree-dirty", "primary-dirty"]);
|
|
275
|
+
expect(result.skipped).toEqual([
|
|
276
|
+
{ check: "open-mission", reason: "unresolvable" },
|
|
277
|
+
{ check: "ecosystem.manifest.validate", reason: "no-invoke" },
|
|
278
|
+
{ check: "friction.validate", reason: "no-invoke" },
|
|
279
|
+
]);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("an unresolvable validator is skipped, not fatal", async () => {
|
|
283
|
+
const result = await runIntegratePreflight(
|
|
284
|
+
baseOpts({
|
|
285
|
+
commandRegistry: registryWith(["rfc.validate"]),
|
|
286
|
+
invoke: async () => ({ ok: true, exitCode: 0 }) as ForgeInvokeResult,
|
|
287
|
+
}),
|
|
288
|
+
stubDeps({ gitStdout: "docs/rfcs/rfc-1528-x.md\n" }),
|
|
289
|
+
);
|
|
290
|
+
expect(result.ok).toBe(true);
|
|
291
|
+
expect(result.skipped).toEqual([
|
|
292
|
+
{ check: "open-mission", reason: "unresolvable" },
|
|
293
|
+
{ check: "ecosystem.manifest.validate", reason: "unresolvable" },
|
|
294
|
+
{ check: "friction.validate", reason: "unresolvable" },
|
|
295
|
+
]);
|
|
296
|
+
expect(result.checked).toContain("rfc.validate:RFC-1528");
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it("manifest-only inventory (werkstatt run host shape) still resolves validators", async () => {
|
|
300
|
+
const commands = ALL_VALIDATORS.map(
|
|
301
|
+
(name) =>
|
|
302
|
+
({
|
|
303
|
+
name,
|
|
304
|
+
provider: "workspace",
|
|
305
|
+
description: "",
|
|
306
|
+
scope: "workspace",
|
|
307
|
+
flags: {},
|
|
308
|
+
}) as ForgeRegisteredCommandInfo,
|
|
309
|
+
);
|
|
310
|
+
const invokes: string[] = [];
|
|
311
|
+
const result = await runIntegratePreflight(
|
|
312
|
+
baseOpts({
|
|
313
|
+
commandRegistry: undefined,
|
|
314
|
+
commands,
|
|
315
|
+
invoke: async (name) => {
|
|
316
|
+
invokes.push(name);
|
|
317
|
+
return { ok: true, exitCode: 0 } as ForgeInvokeResult;
|
|
318
|
+
},
|
|
319
|
+
}),
|
|
320
|
+
stubDeps({}),
|
|
321
|
+
);
|
|
322
|
+
expect(result.ok).toBe(true);
|
|
323
|
+
expect(invokes).toEqual(["ecosystem.manifest.validate", "friction.validate"]);
|
|
324
|
+
expect(result.skipped).toEqual([{ check: "open-mission", reason: "unresolvable" }]);
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it("all-clean run reports the full bounded check list", async () => {
|
|
328
|
+
const result = await runIntegratePreflight(
|
|
329
|
+
baseOpts({ invoke: async () => ({ ok: true, exitCode: 0 }) as ForgeInvokeResult }),
|
|
330
|
+
stubDeps({ gitStdout: "docs/rfcs/rfc-1528-x.md\n" }),
|
|
331
|
+
);
|
|
332
|
+
expect(result.ok).toBe(true);
|
|
333
|
+
expect(result.checked).toEqual([
|
|
334
|
+
"worktree-dirty",
|
|
335
|
+
"primary-dirty",
|
|
336
|
+
"ecosystem.manifest.validate",
|
|
337
|
+
"rfc.validate:RFC-1528",
|
|
338
|
+
"friction.validate",
|
|
339
|
+
]);
|
|
340
|
+
expect(result.skipped).toEqual([{ check: "open-mission", reason: "unresolvable" }]);
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// ── RFC-1537: regenerable dirt classifier + cheap-first mission check ─────
|
|
345
|
+
|
|
346
|
+
const ioWith = (shape: {
|
|
347
|
+
/** repo path → mission id → manifest body ("corrupt" = unreadable). */
|
|
348
|
+
missionsByRepo?: Record<string, Record<string, string | "corrupt">>;
|
|
349
|
+
files?: Record<string, string>;
|
|
350
|
+
dirs?: string[];
|
|
351
|
+
}): WorkspaceIO =>
|
|
352
|
+
({
|
|
353
|
+
glob: async (pattern: string, opts?: { cwd?: string }) => {
|
|
354
|
+
if (pattern === "missions/*/mission.yaml") {
|
|
355
|
+
return Object.keys(shape.missionsByRepo?.[opts?.cwd ?? ""] ?? {}).map(
|
|
356
|
+
(id) => `missions/${id}/mission.yaml`,
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
// `.agents/skills/<dir>/**` — enumerate the fake twin dir's files.
|
|
360
|
+
const twin = /^\.agents\/skills\/([^/]+)\/\*\*$/.exec(pattern);
|
|
361
|
+
if (twin) {
|
|
362
|
+
const prefix = `${opts?.cwd ?? ""}/.agents/skills/${twin[1]}/`;
|
|
363
|
+
return Object.keys(shape.files ?? {})
|
|
364
|
+
.filter((p) => p.startsWith(prefix))
|
|
365
|
+
.map((p) => p.slice((opts?.cwd ?? "").length + 1));
|
|
366
|
+
}
|
|
367
|
+
return [];
|
|
368
|
+
},
|
|
369
|
+
readFile: async (p: string) => {
|
|
370
|
+
const m = /^(.+)\/missions\/([^/]+)\/mission\.yaml$/.exec(p);
|
|
371
|
+
if (m) {
|
|
372
|
+
const v = shape.missionsByRepo?.[m[1]]?.[m[2]];
|
|
373
|
+
if (v === "corrupt") throw new Error("unparseable");
|
|
374
|
+
if (v !== undefined) return v;
|
|
375
|
+
}
|
|
376
|
+
if (p in (shape.files ?? {})) return shape.files![p];
|
|
377
|
+
throw new Error(`ENOENT ${p}`);
|
|
378
|
+
},
|
|
379
|
+
exists: async (p: string) =>
|
|
380
|
+
p in (shape.files ?? {}) || (shape.dirs ?? []).includes(p),
|
|
381
|
+
readFileBytes: async (p: string) => {
|
|
382
|
+
if (p in (shape.files ?? {})) return new TextEncoder().encode(shape.files![p]);
|
|
383
|
+
throw new Error(`ENOENT ${p}`);
|
|
384
|
+
},
|
|
385
|
+
}) as unknown as WorkspaceIO;
|
|
386
|
+
|
|
387
|
+
const MATERIALIZE_DIFF = `diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
|
|
388
|
+
index abc..def 100644
|
|
389
|
+
--- a/pnpm-lock.yaml
|
|
390
|
+
+++ b/pnpm-lock.yaml
|
|
391
|
+
@@ -10,6 +10,8 @@ importers:
|
|
392
|
+
packages/forge:
|
|
393
|
+
dependencies: {}
|
|
394
|
+
+ missions/m000214/workpiece:
|
|
395
|
+
+ dependencies: {}
|
|
396
|
+
packages/werkstatt-site:
|
|
397
|
+
`;
|
|
398
|
+
|
|
399
|
+
describe("classifyLockfileMaterialize (RFC-1537)", () => {
|
|
400
|
+
it("labels an added missions/<id>/workpiece importer block", () => {
|
|
401
|
+
expect(classifyLockfileMaterialize(MATERIALIZE_DIFF)).toEqual(["m000214"]);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it("any removed line is ambiguous — null", () => {
|
|
405
|
+
expect(classifyLockfileMaterialize(PRUNE_DIFF)).toBeNull();
|
|
406
|
+
expect(classifyLockfileMaterialize(MIXED_DIFF)).toBeNull();
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it("additions outside the importer block are ambiguous — null", () => {
|
|
410
|
+
const foreign = `@@ -10,6 +10,7 @@ importers:
|
|
411
|
+
+ other/pkg:
|
|
412
|
+
+ dependencies: {}
|
|
413
|
+
`;
|
|
414
|
+
expect(classifyLockfileMaterialize(foreign)).toBeNull();
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
describe("classifyDirt (RFC-1537 AC-1/AC-2/AC-5)", () => {
|
|
419
|
+
it("importer add-block + open mission workpiece → importer-materialize", async () => {
|
|
420
|
+
const io = ioWith({ missionsByRepo: { "/repo": { m000214: "state: open\n" } } });
|
|
421
|
+
const verdict = await classifyDirt("/repo", io, [" M pnpm-lock.yaml"], {
|
|
422
|
+
runGit: async () => ({ stdout: MATERIALIZE_DIFF, stderr: "", exitCode: 0 }),
|
|
423
|
+
});
|
|
424
|
+
expect(verdict.tolerated).toEqual([{ path: "pnpm-lock.yaml", class: "importer-materialize" }]);
|
|
425
|
+
expect(verdict.unattributed).toEqual([]);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
it("importer add-block without an open mission stays unattributed", async () => {
|
|
429
|
+
const io = ioWith({ missionsByRepo: { "/repo": { m000214: "state: closed\n" } } });
|
|
430
|
+
const verdict = await classifyDirt("/repo", io, [" M pnpm-lock.yaml"], {
|
|
431
|
+
runGit: async () => ({ stdout: MATERIALIZE_DIFF, stderr: "", exitCode: 0 }),
|
|
432
|
+
});
|
|
433
|
+
expect(verdict.tolerated).toEqual([]);
|
|
434
|
+
expect(verdict.unattributed).toEqual([" M pnpm-lock.yaml"]);
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
it("byte-identical skill twin → skill-twin-sync", async () => {
|
|
438
|
+
const body = "# fo-x skill\n";
|
|
439
|
+
const io = ioWith({
|
|
440
|
+
files: {
|
|
441
|
+
"/repo/.agents/skills/fo-x/SKILL.md": body,
|
|
442
|
+
"/repo/packages/forge/skills/fo/fo-x/SKILL.md": body,
|
|
443
|
+
},
|
|
444
|
+
dirs: ["/repo/packages/forge/skills/fo/fo-x"],
|
|
445
|
+
});
|
|
446
|
+
const verdict = await classifyDirt("/repo", io, ["?? .agents/skills/fo-x/SKILL.md"]);
|
|
447
|
+
expect(verdict.tolerated).toEqual([
|
|
448
|
+
{ path: ".agents/skills/fo-x/SKILL.md", class: "skill-twin-sync" },
|
|
449
|
+
]);
|
|
450
|
+
expect(verdict.unattributed).toEqual([]);
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it("an edited skill twin is unattributed — real work, never tolerated", async () => {
|
|
454
|
+
const io = ioWith({
|
|
455
|
+
files: {
|
|
456
|
+
"/repo/.agents/skills/fo-x/SKILL.md": "# fo-x skill\n# EDITED\n",
|
|
457
|
+
"/repo/packages/forge/skills/fo/fo-x/SKILL.md": "# fo-x skill\n",
|
|
458
|
+
},
|
|
459
|
+
dirs: ["/repo/packages/forge/skills/fo/fo-x"],
|
|
460
|
+
});
|
|
461
|
+
const verdict = await classifyDirt("/repo", io, ["?? .agents/skills/fo-x/SKILL.md"]);
|
|
462
|
+
expect(verdict.tolerated).toEqual([]);
|
|
463
|
+
expect(verdict.unattributed).toEqual(["?? .agents/skills/fo-x/SKILL.md"]);
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
it(".prettierignore twin-sync additions → skill-twin-sync", async () => {
|
|
467
|
+
const io = ioWith({});
|
|
468
|
+
const diff = `@@ -1,2 +1,4 @@\n node_modules/\n+.agents/skills/fo-x/\n+.agents/skills/fo-y/\n`;
|
|
469
|
+
const verdict = await classifyDirt("/repo", io, [" M .prettierignore"], {
|
|
470
|
+
runGit: async () => ({ stdout: diff, stderr: "", exitCode: 0 }),
|
|
471
|
+
});
|
|
472
|
+
expect(verdict.tolerated).toEqual([{ path: ".prettierignore", class: "skill-twin-sync" }]);
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
it("an untracked twin directory tolerates only when every file byte-matches (F-0118 shape)", async () => {
|
|
476
|
+
const body = "# fo-x skill\n";
|
|
477
|
+
const io = ioWith({
|
|
478
|
+
files: {
|
|
479
|
+
"/repo/.agents/skills/fo-x/SKILL.md": body,
|
|
480
|
+
"/repo/.agents/skills/fo-x/.forge-managed": "",
|
|
481
|
+
"/repo/packages/forge/skills/fo/fo-x/SKILL.md": body,
|
|
482
|
+
},
|
|
483
|
+
dirs: ["/repo/packages/forge/skills/fo/fo-x"],
|
|
484
|
+
});
|
|
485
|
+
const verdict = await classifyDirt("/repo", io, ["?? .agents/skills/fo-x/"]);
|
|
486
|
+
expect(verdict.tolerated).toEqual([{ path: ".agents/skills/fo-x/", class: "skill-twin-sync" }]);
|
|
487
|
+
expect(verdict.unattributed).toEqual([]);
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
it("a stray file inside an untracked twin dir keeps the whole entry unattributed", async () => {
|
|
491
|
+
const io = ioWith({
|
|
492
|
+
files: {
|
|
493
|
+
"/repo/.agents/skills/fo-x/SKILL.md": "# fo-x skill\n",
|
|
494
|
+
"/repo/.agents/skills/fo-x/notes.md": "mine\n",
|
|
495
|
+
"/repo/packages/forge/skills/fo/fo-x/SKILL.md": "# fo-x skill\n",
|
|
496
|
+
},
|
|
497
|
+
dirs: ["/repo/packages/forge/skills/fo/fo-x"],
|
|
498
|
+
});
|
|
499
|
+
const verdict = await classifyDirt("/repo", io, ["?? .agents/skills/fo-x/"]);
|
|
500
|
+
expect(verdict.tolerated).toEqual([]);
|
|
501
|
+
expect(verdict.unattributed).toEqual(["?? .agents/skills/fo-x/"]);
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
it("unknown dirt stays unattributed", async () => {
|
|
505
|
+
const verdict = await classifyDirt("/repo", ioWith({}), [" M src/x.ts", "?? stray/"]);
|
|
506
|
+
expect(verdict.tolerated).toEqual([]);
|
|
507
|
+
expect(verdict.unattributed).toEqual([" M src/x.ts", "?? stray/"]);
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
describe("open-mission preflight ordering (RFC-1537 AC-3)", () => {
|
|
512
|
+
it("an open mission in the integrating worktree refuses before validators spawn", async () => {
|
|
513
|
+
const invokes: string[] = [];
|
|
514
|
+
const result = await runIntegratePreflight(
|
|
515
|
+
baseOpts({
|
|
516
|
+
io: ioWith({ missionsByRepo: { "/wt": { m000214: "state: open\n" } } }),
|
|
517
|
+
invoke: async (name) => {
|
|
518
|
+
invokes.push(name);
|
|
519
|
+
return { ok: true, exitCode: 0 } as ForgeInvokeResult;
|
|
520
|
+
},
|
|
521
|
+
}),
|
|
522
|
+
stubDeps({}),
|
|
523
|
+
);
|
|
524
|
+
expect(result.ok).toBe(false);
|
|
525
|
+
expect(result.refuse?.ruleId).toBe("WT-GATE-01");
|
|
526
|
+
expect(result.checked).toEqual(["open-mission"]);
|
|
527
|
+
expect(invokes).toEqual([]);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
it("a corrupt mission manifest counts as open (DNA-106 parity)", async () => {
|
|
531
|
+
const result = await runIntegratePreflight(
|
|
532
|
+
baseOpts({ io: ioWith({ missionsByRepo: { "/wt": { m000214: "corrupt" } } }) }),
|
|
533
|
+
stubDeps({}),
|
|
534
|
+
);
|
|
535
|
+
expect(result.refuse?.ruleId).toBe("WT-GATE-01");
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
it("no open missions → the check runs clean and ordering continues", async () => {
|
|
539
|
+
const result = await runIntegratePreflight(
|
|
540
|
+
baseOpts({ io: ioWith({ missionsByRepo: { "/wt": { m000214: "state: closed\n" } } }) }),
|
|
541
|
+
stubDeps({}),
|
|
542
|
+
);
|
|
543
|
+
expect(result.ok).toBe(true);
|
|
544
|
+
expect(result.checked[0]).toBe("open-mission");
|
|
545
|
+
});
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
describe("primary importer-materialize tolerance (RFC-1537 AC-2)", () => {
|
|
549
|
+
it("a primary lockfile materialize for another session's open mission is tolerated", async () => {
|
|
550
|
+
const io = ioWith({ missionsByRepo: { "/primary": { m000214: "state: open\n" } } });
|
|
551
|
+
const result = await runIntegratePreflight(
|
|
552
|
+
baseOpts({ io }),
|
|
553
|
+
stubDeps({
|
|
554
|
+
primaryDirty: { entries: [" M pnpm-lock.yaml"], toleratedState: [], vanished: false },
|
|
555
|
+
lockfileDiff: MATERIALIZE_DIFF,
|
|
556
|
+
}),
|
|
557
|
+
);
|
|
558
|
+
expect(result.ok).toBe(true);
|
|
559
|
+
expect(result.tolerated).toEqual([{ path: "pnpm-lock.yaml", class: "importer-materialize" }]);
|
|
560
|
+
});
|
|
561
|
+
});
|