@warpgogol/forge 9.3.1 → 9.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +32 -0
- package/CHANGELOG.md +40 -0
- package/README.md +6 -4
- package/README.uk.md +10 -8
- package/bin/cli.ts +4 -4
- package/dist/bin/cli.js +4 -4
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
- package/dist/os/adr/handlers/list-create.js +23 -2
- package/dist/os/adr/handlers/list-create.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/adr/types.js +2 -2
- package/dist/os/adr/types.js.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +2 -0
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +7 -2
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +24 -14
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/conformance/conformance.module.d.ts.map +1 -1
- package/dist/os/conformance/conformance.module.js +21 -4
- package/dist/os/conformance/conformance.module.js.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.js +64 -8
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
- package/dist/os/core/archive-regen.d.ts +99 -0
- package/dist/os/core/archive-regen.d.ts.map +1 -0
- package/dist/os/core/archive-regen.js +220 -0
- package/dist/os/core/archive-regen.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +159 -18
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +8 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/package-health.d.ts +130 -0
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +548 -7
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +5 -2
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +3 -1
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dirty-classify.d.ts +51 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -0
- package/dist/os/flow/dirty-classify.js +83 -0
- package/dist/os/flow/dirty-classify.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +110 -19
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/gate-engine.d.ts +13 -0
- package/dist/os/flow/gate-engine.d.ts.map +1 -0
- package/dist/os/flow/gate-engine.js +32 -0
- package/dist/os/flow/gate-engine.js.map +1 -0
- package/dist/os/flow/git.d.ts +45 -4
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +95 -27
- package/dist/os/flow/git.js.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.js +12 -5
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +25 -3
- package/dist/os/flow/handlers/flow-check.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +75 -38
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +33 -5
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +13 -10
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-hold.js +13 -7
- package/dist/os/flow/handlers/flow-hold.js.map +1 -1
- package/dist/os/flow/handlers/flow-install.d.ts +2 -1
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-install.js +56 -13
- package/dist/os/flow/handlers/flow-install.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +54 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +614 -65
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts +14 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +117 -12
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
- package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-peers.js +99 -0
- package/dist/os/flow/handlers/flow-peers.js.map +1 -0
- package/dist/os/flow/handlers/flow-status.d.ts +13 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-status.js +35 -14
- package/dist/os/flow/handlers/flow-status.js.map +1 -1
- package/dist/os/flow/index.d.ts +3 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +7 -2
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/line-version.d.ts.map +1 -1
- package/dist/os/flow/line-version.js +2 -1
- package/dist/os/flow/line-version.js.map +1 -1
- package/dist/os/flow/locks.d.ts +37 -1
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +34 -14
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/ops-registry.d.ts +33 -0
- package/dist/os/flow/ops-registry.d.ts.map +1 -0
- package/dist/os/flow/ops-registry.js +177 -0
- package/dist/os/flow/ops-registry.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +157 -0
- package/dist/os/flow/preflight.d.ts.map +1 -0
- package/dist/os/flow/preflight.js +772 -0
- package/dist/os/flow/preflight.js.map +1 -0
- package/dist/os/flow/publish.d.ts +7 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +165 -3
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +26 -1
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +27 -6
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/scripts.d.ts +4 -0
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +8 -2
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/session-checkout.d.ts +33 -0
- package/dist/os/flow/session-checkout.d.ts.map +1 -0
- package/dist/os/flow/session-checkout.js +151 -0
- package/dist/os/flow/session-checkout.js.map +1 -0
- package/dist/os/flow/standalone-invoke.d.ts +11 -0
- package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
- package/dist/os/flow/standalone-invoke.js +75 -0
- package/dist/os/flow/standalone-invoke.js.map +1 -0
- package/dist/os/flow/worktree-path.d.ts.map +1 -1
- package/dist/os/flow/worktree-path.js +9 -3
- package/dist/os/flow/worktree-path.js.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.js +12 -4
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +4 -1
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +12 -8
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/importer-block.d.ts +19 -0
- package/dist/os/mission/importer-block.d.ts.map +1 -0
- package/dist/os/mission/importer-block.js +124 -0
- package/dist/os/mission/importer-block.js.map +1 -0
- package/dist/os/mission/lockfile.d.ts +17 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -1
- package/dist/os/mission/lockfile.js +38 -0
- package/dist/os/mission/lockfile.js.map +1 -1
- package/dist/os/mission/open-missions.d.ts +8 -0
- package/dist/os/mission/open-missions.d.ts.map +1 -0
- package/dist/os/mission/open-missions.js +42 -0
- package/dist/os/mission/open-missions.js.map +1 -0
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +11 -1
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts +14 -0
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +18 -10
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +11 -2
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts +23 -0
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +82 -1
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +16 -3
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +5 -4
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +107 -10
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +77 -5
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +64 -6
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/next-id.d.ts +38 -0
- package/dist/os/rfc/next-id.d.ts.map +1 -0
- package/dist/os/rfc/next-id.js +165 -0
- package/dist/os/rfc/next-id.js.map +1 -0
- package/dist/os/rfc/probe-batch.d.ts.map +1 -1
- package/dist/os/rfc/probe-batch.js +6 -1
- package/dist/os/rfc/probe-batch.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +36 -8
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +42 -6
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +6 -6
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +81 -28
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +47 -0
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +31 -7
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/spec/spec-schema.d.ts +8 -0
- package/dist/os/spec/spec-schema.d.ts.map +1 -1
- package/dist/os/spec/spec-schema.js +1 -0
- package/dist/os/spec/spec-schema.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts +8 -0
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +18 -6
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +62 -15
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +13 -5
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
- package/dist/os/system/handlers/system-map-validate.js +2 -1
- package/dist/os/system/handlers/system-map-validate.js.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.js +54 -6
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-collect.js +11 -5
- package/dist/os/system/handlers/system-task-collect.js.map +1 -1
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-create.js +6 -1
- package/dist/os/system/handlers/system-task-create.js.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.js +246 -6
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
- package/dist/os/system/repo.d.ts +1 -1
- package/dist/os/system/repo.d.ts.map +1 -1
- package/dist/os/system/repo.js +53 -3
- package/dist/os/system/repo.js.map +1 -1
- package/dist/os/system/scenario-schemas.d.ts +109 -3
- package/dist/os/system/scenario-schemas.d.ts.map +1 -1
- package/dist/os/system/scenario-schemas.js +66 -10
- package/dist/os/system/scenario-schemas.js.map +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +69 -17
- package/dist/os/system/system.module.js.map +1 -1
- package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
- package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
- package/dist/os/system/tests/contract-fixtures.js +109 -0
- package/dist/os/system/tests/contract-fixtures.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +54 -18
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +41 -9
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +6 -0
- package/dist/src/conformance/index.d.ts.map +1 -1
- package/dist/src/conformance/index.js +36 -1
- package/dist/src/conformance/index.js.map +1 -1
- package/dist/src/formal/proof-runner.d.ts.map +1 -1
- package/dist/src/formal/proof-runner.js +10 -2
- package/dist/src/formal/proof-runner.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.js +4 -4
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +3 -1
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
- package/dist/src/onboarding/prettierignore.js +2 -0
- package/dist/src/onboarding/prettierignore.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +2 -2
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +14 -2
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +3 -1
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/skill-schema.d.ts +3 -0
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +9 -2
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/spec/resolve-spec-source.d.ts +45 -0
- package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
- package/dist/src/spec/resolve-spec-source.js +153 -0
- package/dist/src/spec/resolve-spec-source.js.map +1 -0
- package/dist/src/utils/command-inventory.d.ts +28 -0
- package/dist/src/utils/command-inventory.d.ts.map +1 -0
- package/dist/src/utils/command-inventory.js +84 -0
- package/dist/src/utils/command-inventory.js.map +1 -0
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +6 -1
- package/dist/src/utils/io.js.map +1 -1
- package/dist/src/utils/repo-path.d.ts +10 -0
- package/dist/src/utils/repo-path.d.ts.map +1 -0
- package/dist/src/utils/repo-path.js +52 -0
- package/dist/src/utils/repo-path.js.map +1 -0
- package/dist/src/utils/spawn.d.ts +23 -0
- package/dist/src/utils/spawn.d.ts.map +1 -0
- package/dist/src/utils/spawn.js +83 -0
- package/dist/src/utils/spawn.js.map +1 -0
- package/docs/branch-model.md +1 -1
- package/docs/guides/existing-project.md +1 -1
- package/docs/maintainers/publishing.md +1 -1
- package/docs/reference/cli.md +8 -2
- package/docs/reference/profiles.md +1 -1
- package/os/adr/handlers/list-create.ts +26 -2
- package/os/adr/types.ts +4 -2
- package/os/compass/handlers/compass-audit-handler.ts +6 -1
- package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
- package/os/compass/handlers/git-revision.ts +8 -2
- package/os/compass/handlers/summary-record.ts +25 -14
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
- package/os/conformance/conformance.module.ts +21 -4
- package/os/conformance/handlers/conformance-validate.ts +108 -16
- package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
- package/os/core/archive-regen.ts +279 -0
- package/os/core/core.module.ts +176 -29
- package/os/core/docs-archive.test.ts +413 -3
- package/os/core/handlers/assets-helpers.ts +8 -3
- package/os/core/handlers/forge-autonomy-validate.ts +3 -1
- package/os/core/handlers/package-health.test.ts +418 -4
- package/os/core/handlers/package-health.ts +629 -7
- package/os/core/handlers/release-prepare.ts +5 -2
- package/os/flow/digest.ts +3 -1
- package/os/flow/dirty-classify.ts +120 -0
- package/os/flow/flow.module.ts +119 -24
- package/os/flow/gate-engine.ts +45 -0
- package/os/flow/git.ts +117 -29
- package/os/flow/handlers/flow-backmerge.ts +14 -4
- package/os/flow/handlers/flow-check.ts +27 -2
- package/os/flow/handlers/flow-cut.ts +124 -56
- package/os/flow/handlers/flow-discard.ts +33 -5
- package/os/flow/handlers/flow-fix.ts +22 -10
- package/os/flow/handlers/flow-hold.ts +20 -7
- package/os/flow/handlers/flow-install.ts +59 -12
- package/os/flow/handlers/flow-integrate.ts +933 -180
- package/os/flow/handlers/flow-open.ts +135 -11
- package/os/flow/handlers/flow-peers.ts +142 -0
- package/os/flow/handlers/flow-status.ts +45 -13
- package/os/flow/index.ts +8 -2
- package/os/flow/line-version.ts +2 -1
- package/os/flow/locks.ts +56 -14
- package/os/flow/ops-registry.ts +194 -0
- package/os/flow/preflight.ts +974 -0
- package/os/flow/publish.ts +200 -5
- package/os/flow/registry.ts +43 -7
- package/os/flow/scripts.ts +13 -2
- package/os/flow/session-checkout.ts +186 -0
- package/os/flow/standalone-invoke.ts +85 -0
- package/os/flow/tests/dirty-classify.test.ts +251 -0
- package/os/flow/tests/fixtures/branch-names.yaml +40 -40
- package/os/flow/tests/flow-cut.test.ts +21 -0
- package/os/flow/tests/flow-discard.test.ts +32 -0
- package/os/flow/tests/flow-guard-parity.test.ts +10 -2
- package/os/flow/tests/flow-install.test.ts +7 -3
- package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +565 -0
- package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
- package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
- package/os/flow/tests/flow-integrate.test.ts +698 -17
- package/os/flow/tests/flow-open.pending.test.ts +277 -0
- package/os/flow/tests/flow-open.test.ts +52 -9
- package/os/flow/tests/flow-push-publish.test.ts +124 -0
- package/os/flow/tests/flow-status.test.ts +31 -1
- package/os/flow/tests/locks.test.ts +39 -3
- package/os/flow/tests/ops-registry.test.ts +136 -0
- package/os/flow/tests/scripts.test.ts +5 -2
- package/os/flow/tests/state-roots.test.ts +8 -5
- package/os/flow/worktree-path.ts +9 -3
- package/os/formal/handlers/proof-check.test.ts +6 -3
- package/os/instructions/budget.test.ts +31 -0
- package/os/instructions/handlers/budget-validate.ts +13 -4
- package/os/instructions/instructions.module.ts +4 -1
- package/os/mission/handlers/archive.ts +22 -14
- package/os/mission/importer-block.ts +119 -0
- package/os/mission/lockfile.ts +41 -0
- package/os/mission/open-missions.ts +50 -0
- package/os/queue/decision-ledger.test.ts +18 -0
- package/os/queue/manifest.ts +17 -1
- package/os/rfc/acceptance.ts +30 -10
- package/os/rfc/decision-log.ts +13 -2
- package/os/rfc/frontmatter-io.ts +89 -1
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
- package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
- package/os/rfc/handlers/implement-stamp.ts +16 -3
- package/os/rfc/handlers/index-graph.ts +5 -4
- package/os/rfc/handlers/lifecycle.test.ts +136 -0
- package/os/rfc/handlers/list-create.test.ts +126 -0
- package/os/rfc/handlers/list-create.ts +130 -10
- package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
- package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
- package/os/rfc/handlers/validate-rules.ts +103 -7
- package/os/rfc/handlers/validate.ts +68 -4
- package/os/rfc/next-id.ts +232 -0
- package/os/rfc/probe-batch.ts +6 -1
- package/os/rfc/rfc.module.ts +41 -8
- package/os/rfc/types.ts +31 -6
- package/os/rfc/verification-emit-freshness.test.ts +5 -1
- package/os/rfc/verification-emit.test.ts +5 -1
- package/os/rfc/verification-evidence.ts +99 -33
- package/os/rfc/verification-origin.ts +59 -0
- package/os/rfc/verification-refresh.test.ts +5 -1
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
- package/os/session/handlers/save.ts +35 -7
- package/os/session/tests/session-save.test.ts +154 -0
- package/os/spec/spec-schema.ts +3 -0
- package/os/spec/spec-status.ts +22 -6
- package/os/spec/spec-validate.package-source.test.ts +187 -0
- package/os/spec/spec-validate.ts +65 -14
- package/os/spec/spec.module.ts +13 -5
- package/os/system/handlers/system-map-validate.ts +4 -2
- package/os/system/handlers/system-outbox-scan.ts +65 -21
- package/os/system/handlers/system-task-collect.ts +11 -5
- package/os/system/handlers/system-task-create.ts +6 -1
- package/os/system/handlers/system-versionset-record.ts +301 -16
- package/os/system/repo.ts +59 -18
- package/os/system/scenario-schemas.ts +91 -12
- package/os/system/system.module.ts +70 -17
- package/os/system/tests/contract-fixtures.ts +139 -0
- package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
- package/os/system/tests/scenario-validator-check.test.ts +96 -0
- package/os/system/tests/system-task-collect.test.ts +16 -0
- package/os/system/tests/system-task-dispatch.test.ts +4 -1
- package/os/system/tests/system-versionset.test.ts +7 -3
- package/os/system/tests/version-set-v2.test.ts +78 -0
- package/package.json +9 -1
- package/skills/fo/fo-doctor/SKILL.md +151 -0
- package/skills/fo/fo-handoff/SKILL.md +22 -0
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
- package/skills/fo/fo-idea-implement/SKILL.md +5 -2
- package/skills/fo/fo-idea-plan/SKILL.md +5 -5
- package/skills/fo/fo-session-retro/SKILL.md +45 -13
- package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
- package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
- package/skills/meta/skill-create/SKILL.md +2 -1
- package/src/bin-entry.test.ts +3 -1
- package/src/config/forge-config.ts +57 -13
- package/src/conformance/index.ts +46 -1
- package/src/formal/proof-runner.ts +10 -2
- package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
- package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
- package/src/onboarding/agents-generate.ts +4 -4
- package/src/onboarding/nested-agents-generate.ts +3 -1
- package/src/onboarding/prettierignore.ts +2 -0
- package/src/onboarding/scaffold-project.ts +2 -2
- package/src/onboarding/upgrade.ts +13 -2
- package/src/onboarding/workspace-discovery.ts +3 -1
- package/src/pipeline-status.test.ts +1 -1
- package/src/skill-schema.ts +9 -2
- package/src/spec/resolve-spec-source.ts +184 -0
- package/src/tests/acceptance-probe-kinds.test.ts +3 -1
- package/src/tests/agents-generate-domain.test.ts +3 -2
- package/src/tests/agents-generate.test.ts +2 -1
- package/src/tests/create-flow.test.ts +3 -1
- package/src/tests/create.test.ts +12 -2
- package/src/tests/editable-generated-region.test.ts +2 -2
- package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
- package/src/tests/implement-stamp.test.ts +5 -2
- package/src/tests/prettierignore-manage.test.ts +11 -0
- package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
- package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
- package/src/tests/scaffold-project.test.ts +3 -1
- package/src/tests/upgrade.test.ts +79 -3
- package/src/tests/workspace-discovery.test.ts +4 -3
- package/src/utils/command-inventory.ts +105 -0
- package/src/utils/io.ts +6 -1
- package/src/utils/repo-path.ts +49 -0
- package/src/utils/spawn.ts +88 -0
- package/src/tests/rfc-evidence-sync.test.ts +0 -369
- package/src/tests/skill-agents-sync.test.ts +0 -192
|
@@ -13,12 +13,12 @@ dispatch's product side is limited to opening the task branch and writing
|
|
|
13
13
|
</non-goals>
|
|
14
14
|
</MODULE_CONTRACT>
|
|
15
15
|
<CHANGE_SUMMARY>
|
|
16
|
-
<item>RFC-1509: address RFC-1509 review r2 — mark-failed without product, journal-read warning, status map diagnostics, V-49 deviations</item>
|
|
17
|
-
<item>RFC-1510: implement RFC-1510 — product outbox for dependency-contract requests</item>
|
|
18
16
|
<item>RFC-1510: close RFC-1510 review r2 — declare OUTBOX-02 in scan rules, flat-scope test, readdir TOCTOU guard</item>
|
|
19
17
|
<item>RFC-1511: scenarios, version sets and system.versionset.record</item>
|
|
20
18
|
<item>RFC-1511: accept recorded products map in verified gate, guard folders lookup and exec edges (RFC-1511 review r1)</item>
|
|
21
|
-
<
|
|
19
|
+
<item>RFC-1533: surface pending flow branches in flow.open and the pre-user-prompt nudge</item>
|
|
20
|
+
<item>RFC-1541: version-set@2 contracts with validator and pin-drift scenario checks</item>
|
|
21
|
+
<history>RFC-1508, RFC-1509, RFC-1510</history>
|
|
22
22
|
</CHANGE_SUMMARY>
|
|
23
23
|
*/
|
|
24
24
|
|
|
@@ -43,7 +43,8 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
43
43
|
{
|
|
44
44
|
name: "system.map.validate",
|
|
45
45
|
description:
|
|
46
|
-
"Read-only system-map validator (RFC-1508
|
|
46
|
+
"Read-only system-map validator (RFC-1508; RFC-1541 SYSTEM-MAP-07 " +
|
|
47
|
+
"lints pin-drift authorities and validator producers). Refuses outside the " +
|
|
47
48
|
"system profile (SYSTEM-01), reports missing or schema-invalid map " +
|
|
48
49
|
"files (SYSTEM-MAP-01), duplicate product ids and unknown edge " +
|
|
49
50
|
"consumers (SYSTEM-MAP-02), edges naming contracts no product " +
|
|
@@ -62,6 +63,7 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
62
63
|
{ id: "SYSTEM-MAP-04", severity: "error" },
|
|
63
64
|
{ id: "SYSTEM-MAP-05", severity: "warning" },
|
|
64
65
|
{ id: "SYSTEM-MAP-06", severity: "error" },
|
|
66
|
+
{ id: "SYSTEM-MAP-07", severity: "error" },
|
|
65
67
|
],
|
|
66
68
|
mutatesState: false,
|
|
67
69
|
writes: [],
|
|
@@ -112,14 +114,36 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
112
114
|
],
|
|
113
115
|
cacheable: false,
|
|
114
116
|
flags: {
|
|
115
|
-
product: {
|
|
116
|
-
|
|
117
|
+
product: {
|
|
118
|
+
kind: "string",
|
|
119
|
+
required: true,
|
|
120
|
+
description: "Product id from system/products.yaml",
|
|
121
|
+
},
|
|
122
|
+
slug: {
|
|
123
|
+
kind: "string",
|
|
124
|
+
required: true,
|
|
125
|
+
description: "kebab-case slug for the product branch",
|
|
126
|
+
},
|
|
117
127
|
title: { kind: "string", required: true, description: "Human-readable task title" },
|
|
118
|
-
kind: {
|
|
128
|
+
kind: {
|
|
129
|
+
kind: "string",
|
|
130
|
+
required: true,
|
|
131
|
+
description: "change | adoption | dependency-update | verification",
|
|
132
|
+
},
|
|
119
133
|
contracts: { kind: "string[]", description: "Contracts the task touches (repeatable)" },
|
|
120
|
-
"depends-on": {
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
"depends-on": {
|
|
135
|
+
kind: "string[]",
|
|
136
|
+
description: "Task ids that must be done first (repeatable)",
|
|
137
|
+
},
|
|
138
|
+
origin: {
|
|
139
|
+
kind: "string",
|
|
140
|
+
description:
|
|
141
|
+
"<kind>:<ref> — operator | outbox | decision | scenario (default operator)",
|
|
142
|
+
},
|
|
143
|
+
reason: {
|
|
144
|
+
kind: "string",
|
|
145
|
+
description: "Optional note recorded on the creation history row",
|
|
146
|
+
},
|
|
123
147
|
"dry-run": { kind: "boolean", description: "Plan only — write nothing" },
|
|
124
148
|
},
|
|
125
149
|
execute: runSystemTaskCreate,
|
|
@@ -165,8 +189,14 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
165
189
|
flags: {
|
|
166
190
|
task: { kind: "string", required: true, description: "Task id T-NNNN" },
|
|
167
191
|
to: { kind: "string", required: true, description: "Target state" },
|
|
168
|
-
reason: {
|
|
169
|
-
|
|
192
|
+
reason: {
|
|
193
|
+
kind: "string",
|
|
194
|
+
description: "Required by transitions the table marks reason-bearing",
|
|
195
|
+
},
|
|
196
|
+
"version-set": {
|
|
197
|
+
kind: "string",
|
|
198
|
+
description: "Required for integrated → verified — names system/version-sets/<id>.yaml",
|
|
199
|
+
},
|
|
170
200
|
"dry-run": { kind: "boolean", description: "Plan only — write nothing" },
|
|
171
201
|
},
|
|
172
202
|
execute: runSystemTaskMove,
|
|
@@ -198,12 +228,13 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
198
228
|
{ id: "SYSTEM-TASK-09", severity: "warning" },
|
|
199
229
|
{ id: "FLOW-07", severity: "error" },
|
|
200
230
|
{ id: "FLOW-OPEN-01", severity: "error" },
|
|
201
|
-
{ id: "FLOW-OPEN-02", severity: "
|
|
231
|
+
{ id: "FLOW-OPEN-02", severity: "warning" },
|
|
202
232
|
{ id: "FLOW-OPEN-03", severity: "error" },
|
|
203
233
|
{ id: "FLOW-OPEN-04", severity: "error" },
|
|
204
234
|
{ id: "FLOW-OPEN-05", severity: "error" },
|
|
205
235
|
{ id: "FLOW-OPEN-06", severity: "error" },
|
|
206
236
|
{ id: "FLOW-OPEN-07", severity: "error" },
|
|
237
|
+
{ id: "FLOW-OPEN-11", severity: "error" },
|
|
207
238
|
],
|
|
208
239
|
mutatesState: true,
|
|
209
240
|
idempotency: "rerun-safe",
|
|
@@ -275,8 +306,15 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
275
306
|
],
|
|
276
307
|
cacheable: false,
|
|
277
308
|
flags: {
|
|
278
|
-
task: {
|
|
279
|
-
|
|
309
|
+
task: {
|
|
310
|
+
kind: "string",
|
|
311
|
+
required: true,
|
|
312
|
+
description: "Task id T-NNNN (dispatched or reported)",
|
|
313
|
+
},
|
|
314
|
+
"mark-failed": {
|
|
315
|
+
kind: "boolean",
|
|
316
|
+
description: "Mark the task failed instead of collecting a report",
|
|
317
|
+
},
|
|
280
318
|
reason: { kind: "string", description: "Required with --mark-failed" },
|
|
281
319
|
"dry-run": { kind: "boolean", description: "Plan only — write nothing" },
|
|
282
320
|
},
|
|
@@ -345,6 +383,8 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
345
383
|
description:
|
|
346
384
|
"Scan every product's committed docs/outbox/ entries from develop " +
|
|
347
385
|
"(RFC-1510). Matches each open entry's contract to the offering " +
|
|
386
|
+
"product (RFC-1541: also lists pin-bump proposals from the newest " +
|
|
387
|
+
"version set's W01 warnings — never materialized as tasks), " +
|
|
348
388
|
"product, classifies the edge via edgeVerdict and prints " +
|
|
349
389
|
"OutboxProposal rows. SYSTEM-OUTBOX-01 warns on contracts nobody " +
|
|
350
390
|
"offers, SYSTEM-OUTBOX-02 errors on forbidden edges (no task), " +
|
|
@@ -397,7 +437,13 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
397
437
|
"system/version-sets/VS-NNNN.yaml with sha256 evidence per " +
|
|
398
438
|
"scenario only when all checks pass — a failing check leaves the " +
|
|
399
439
|
"logs but writes no set (DNA-106). --dry-run validates flags, " +
|
|
400
|
-
"scenarios, folders and tags without creating worktrees."
|
|
440
|
+
"scenarios, folders and tags without creating worktrees. " +
|
|
441
|
+
"RFC-1541: writes forge/version-set@2 — contracts (product → package → " +
|
|
442
|
+
"version from each tag's root lockfile importer; SYSTEM-VS-06 when a " +
|
|
443
|
+
"declared spec/validator package cannot be resolved), check kinds " +
|
|
444
|
+
"validator (producer conformance over the shared path; SYSTEM-VS-07 " +
|
|
445
|
+
"for a consumer.root producer) and pin-drift (warning-only W01 lag ≥ " +
|
|
446
|
+
"maxLag or unlisted pin, W02 registry unreachable).",
|
|
401
447
|
scope: "workspace",
|
|
402
448
|
contract: "system",
|
|
403
449
|
rules: [
|
|
@@ -408,6 +454,10 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
408
454
|
{ id: "SYSTEM-VS-03", severity: "error" },
|
|
409
455
|
{ id: "SYSTEM-VS-04", severity: "error" },
|
|
410
456
|
{ id: "SYSTEM-VS-05", severity: "warning" },
|
|
457
|
+
{ id: "SYSTEM-VS-06", severity: "error" },
|
|
458
|
+
{ id: "SYSTEM-VS-07", severity: "error" },
|
|
459
|
+
{ id: "SYSTEM-VS-W01", severity: "warning" },
|
|
460
|
+
{ id: "SYSTEM-VS-W02", severity: "warning" },
|
|
411
461
|
],
|
|
412
462
|
mutatesState: true,
|
|
413
463
|
idempotency: "rerun-safe",
|
|
@@ -439,7 +489,10 @@ export async function createForgeSystemModule(): Promise<ForgeModule> {
|
|
|
439
489
|
required: true,
|
|
440
490
|
description: "Comma-separated scenario ids from system/scenarios/",
|
|
441
491
|
},
|
|
442
|
-
"dry-run": {
|
|
492
|
+
"dry-run": {
|
|
493
|
+
kind: "boolean",
|
|
494
|
+
description: "Validate only — create no worktree, write nothing",
|
|
495
|
+
},
|
|
443
496
|
},
|
|
444
497
|
execute: runSystemVersionSetRecord,
|
|
445
498
|
},
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1541 test fixtures — tagged product repos carrying forge.yaml contract declarations, a pnpm v9 lockfile and (for validator checks) a committed fake validator package; a fake npm on PATH for pin-drift.</purpose>
|
|
4
|
+
<non-goals><item>No network, no real package manager.</item></non-goals>
|
|
5
|
+
</MODULE_CONTRACT>
|
|
6
|
+
*/
|
|
7
|
+
import { chmod, mkdir, mkdtemp, writeFile } from "node:fs/promises";
|
|
8
|
+
import os from "node:os";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { gitExec } from "../../flow/tests/helpers.ts";
|
|
11
|
+
import {
|
|
12
|
+
localMapFor,
|
|
13
|
+
makeProduct,
|
|
14
|
+
makeSystemRepo,
|
|
15
|
+
VALID_EDGES_YAML,
|
|
16
|
+
VALID_SYSTEM_YAML,
|
|
17
|
+
} from "./helpers.ts";
|
|
18
|
+
|
|
19
|
+
export const TAG = "v1.0.0";
|
|
20
|
+
export const SPEC_PKG = "@acme/demo-spec";
|
|
21
|
+
export const VALIDATOR_PKG = "@acme/demo-validator";
|
|
22
|
+
|
|
23
|
+
const RELEASE_ANNOTATION = [
|
|
24
|
+
"release v1.0.0",
|
|
25
|
+
"",
|
|
26
|
+
"schema: forge/release-tag@1",
|
|
27
|
+
"line: v",
|
|
28
|
+
"version: 1.0.0",
|
|
29
|
+
"level: minor",
|
|
30
|
+
"previous: null",
|
|
31
|
+
'rfcs: ["RFC-0001"]',
|
|
32
|
+
"fingerprints: {}",
|
|
33
|
+
].join("\n");
|
|
34
|
+
|
|
35
|
+
export const PRODUCTS_YAML = `schema: forge/system-products@1
|
|
36
|
+
products:
|
|
37
|
+
- id: alpha
|
|
38
|
+
remote: https://example.invalid/alpha.git
|
|
39
|
+
offers:
|
|
40
|
+
- demo-spec
|
|
41
|
+
- id: beta
|
|
42
|
+
remote: https://example.invalid/beta.git
|
|
43
|
+
offers: []
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
async function commitAndTag(
|
|
47
|
+
root: string,
|
|
48
|
+
files: Record<string, string>,
|
|
49
|
+
executable: string[] = [],
|
|
50
|
+
): Promise<void> {
|
|
51
|
+
for (const [rel, content] of Object.entries(files)) {
|
|
52
|
+
const abs = path.join(root, rel);
|
|
53
|
+
await mkdir(path.dirname(abs), { recursive: true });
|
|
54
|
+
await writeFile(abs, content);
|
|
55
|
+
if (executable.includes(rel)) await chmod(abs, 0o755);
|
|
56
|
+
}
|
|
57
|
+
await gitExec(root, ["add", "-f", "-A"]);
|
|
58
|
+
const c = await gitExec(root, ["commit", "-m", "release content"]);
|
|
59
|
+
if (c.exitCode !== 0) throw new Error(`commit failed: ${c.stderr}`);
|
|
60
|
+
const t = await gitExec(root, ["tag", "-a", TAG, "HEAD", "-m", RELEASE_ANNOTATION]);
|
|
61
|
+
if (t.exitCode !== 0) throw new Error(`tag failed: ${t.stderr}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** A product that pins the spec package at `version` in its root lockfile importer. */
|
|
65
|
+
export async function specConsumer(version: string | null): Promise<string> {
|
|
66
|
+
const root = await makeProduct();
|
|
67
|
+
const files: Record<string, string> = {
|
|
68
|
+
"forge.yaml": `schema: "forge/workspace@1"\nspecPackages:\n - id: demo-spec\n package: "${SPEC_PKG}"\n`,
|
|
69
|
+
};
|
|
70
|
+
if (version !== null) {
|
|
71
|
+
files["pnpm-lock.yaml"] =
|
|
72
|
+
`lockfileVersion: '9.0'\nimporters:\n .:\n dependencies:\n '${SPEC_PKG}':\n specifier: ${version}\n version: ${version}(zod@4.6.5)\n`;
|
|
73
|
+
}
|
|
74
|
+
await commitAndTag(root, files);
|
|
75
|
+
return root;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** A producer whose `intake` contract runs a committed fake validator package (package or root form). */
|
|
79
|
+
export async function validatorProducer(
|
|
80
|
+
form: "package" | "root",
|
|
81
|
+
validatorExit = 0,
|
|
82
|
+
): Promise<string> {
|
|
83
|
+
const root = await makeProduct();
|
|
84
|
+
const emit = `require("node:fs").writeFileSync(require("node:path").join(process.argv[1],"bundle.txt"),"x")`;
|
|
85
|
+
const consumer =
|
|
86
|
+
form === "package"
|
|
87
|
+
? ` consumer:\n package: "${VALIDATOR_PKG}"\n validator:\n argv: ["demo-validate", "{bundle}"]\n`
|
|
88
|
+
: ` consumer:\n root: ../elsewhere\n validator:\n argv: ["demo-validate", "{bundle}"]\n`;
|
|
89
|
+
await commitAndTag(
|
|
90
|
+
root,
|
|
91
|
+
{
|
|
92
|
+
"forge.yaml": `schema: "forge/workspace@1"\ncontractProducers:\n - id: intake\n emit:\n argv: ["${process.execPath}", "-e", ${JSON.stringify(emit)}, "{bundle}"]\n${consumer} test: conformance.test.ts\n`,
|
|
93
|
+
"pnpm-lock.yaml": `lockfileVersion: '9.0'\nimporters:\n .:\n devDependencies:\n '${VALIDATOR_PKG}':\n specifier: 2.1.0\n version: 2.1.0\n`,
|
|
94
|
+
[`node_modules/${VALIDATOR_PKG}/package.json`]: JSON.stringify({
|
|
95
|
+
name: VALIDATOR_PKG,
|
|
96
|
+
version: "2.1.0",
|
|
97
|
+
}),
|
|
98
|
+
"node_modules/.bin/demo-validate": `#!/bin/sh\nexit ${validatorExit}\n`,
|
|
99
|
+
},
|
|
100
|
+
["node_modules/.bin/demo-validate"],
|
|
101
|
+
);
|
|
102
|
+
return root;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export async function systemWith(
|
|
106
|
+
products: Record<string, string>,
|
|
107
|
+
files: Record<string, string>,
|
|
108
|
+
): Promise<string> {
|
|
109
|
+
return makeSystemRepo({
|
|
110
|
+
"system/system.yaml": VALID_SYSTEM_YAML,
|
|
111
|
+
"system/products.yaml": PRODUCTS_YAML,
|
|
112
|
+
"system/edges.yaml": VALID_EDGES_YAML,
|
|
113
|
+
"system/products.local.yaml": localMapFor(products),
|
|
114
|
+
...files,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Install a fake `npm` first on PATH answering `view <pkg> dist-tags.latest` and `view <pkg> versions --json`. */
|
|
119
|
+
export async function fakeNpm(opts: {
|
|
120
|
+
versions?: string[];
|
|
121
|
+
latest?: string;
|
|
122
|
+
offline?: boolean;
|
|
123
|
+
}): Promise<() => void> {
|
|
124
|
+
const bin = await mkdtemp(path.join(os.tmpdir(), "fake-npm-"));
|
|
125
|
+
const script = opts.offline
|
|
126
|
+
? `#!/bin/sh\necho "npm error code ENOTFOUND" >&2\nexit 1\n`
|
|
127
|
+
: `#!/bin/sh\ncase "$3" in\n dist-tags.latest) echo "${opts.latest}" ;;\n versions) echo '${JSON.stringify(opts.versions)}' ;;\n *) exit 1 ;;\nesac\n`;
|
|
128
|
+
await writeFile(path.join(bin, "npm"), script);
|
|
129
|
+
await chmod(path.join(bin, "npm"), 0o755);
|
|
130
|
+
const saved = process.env.PATH;
|
|
131
|
+
process.env.PATH = `${bin}:${saved}`;
|
|
132
|
+
return () => {
|
|
133
|
+
process.env.PATH = saved;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function scenario(id: string, products: string[], checks: string): string {
|
|
138
|
+
return `schema: forge/system-scenario@1\nid: ${id}\ntitle: ${id}\nproducts: [${products.join(", ")}]\ncontracts: []\nchecks:\n${checks}`;
|
|
139
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1541 AC-7..AC-13 — the warning-only pin-drift check against a fake npm, pin-bump proposals in system.outbox.scan, and the authority lint.</purpose>
|
|
4
|
+
<non-goals><item>No real registry.</item></non-goals>
|
|
5
|
+
</MODULE_CONTRACT>
|
|
6
|
+
*/
|
|
7
|
+
// @vitest-environment node
|
|
8
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
9
|
+
import { runSystemVersionSetRecord } from "../handlers/system-versionset-record.ts";
|
|
10
|
+
import { runSystemOutboxScan } from "../handlers/system-outbox-scan.ts";
|
|
11
|
+
import { runSystemMapValidate } from "../handlers/system-map-validate.ts";
|
|
12
|
+
import { makeContext } from "./helpers.ts";
|
|
13
|
+
import { SPEC_PKG, TAG, fakeNpm, scenario, specConsumer, systemWith } from "./contract-fixtures.ts";
|
|
14
|
+
|
|
15
|
+
const VERSIONS = ["0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.1.10"];
|
|
16
|
+
const drift = (authority = "alpha", contract = "demo-spec") =>
|
|
17
|
+
` - product: beta\n argv: ["${process.execPath}", "-e", "0"]\n - kind: pin-drift\n contract: ${contract}\n package: "${SPEC_PKG}"\n authority: ${authority}\n maxLag: 3\n`;
|
|
18
|
+
|
|
19
|
+
let restore: (() => void) | null = null;
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
restore?.();
|
|
22
|
+
restore = null;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
async function recordWith(pinned: string, npm: Parameters<typeof fakeNpm>[0]) {
|
|
26
|
+
restore = await fakeNpm(npm);
|
|
27
|
+
const beta = await specConsumer(pinned);
|
|
28
|
+
const root = await systemWith(
|
|
29
|
+
{ beta },
|
|
30
|
+
{ "system/scenarios/d.yaml": scenario("d", ["beta"], drift()) },
|
|
31
|
+
);
|
|
32
|
+
const res = await runSystemVersionSetRecord(
|
|
33
|
+
{ argv: [], flags: { products: `beta=${TAG}`, scenarios: "d" } },
|
|
34
|
+
makeContext(root),
|
|
35
|
+
);
|
|
36
|
+
return { root, res };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
describe("pin-drift check kind (RFC-1541)", () => {
|
|
40
|
+
it("AC-7: warns W01 for a consumer three published versions behind", async () => {
|
|
41
|
+
const { res } = await recordWith("0.1.7", { versions: VERSIONS, latest: "0.1.10" });
|
|
42
|
+
expect(res.data!.warnings).toContainEqual(
|
|
43
|
+
expect.objectContaining({
|
|
44
|
+
code: "SYSTEM-VS-W01",
|
|
45
|
+
product: "beta",
|
|
46
|
+
from: "0.1.7",
|
|
47
|
+
to: "0.1.10",
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("AC-8: stays silent for a consumer two versions behind", async () => {
|
|
53
|
+
const { res } = await recordWith("0.1.8", { versions: VERSIONS, latest: "0.1.10" });
|
|
54
|
+
expect(res.data!.warnings).toEqual([]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("AC-9: the record succeeds in both drift cases", async () => {
|
|
58
|
+
for (const pinned of ["0.1.7", "0.1.8"]) {
|
|
59
|
+
const { res } = await recordWith(pinned, { versions: VERSIONS, latest: "0.1.10" });
|
|
60
|
+
expect(res.exitCode, pinned).toBe(0);
|
|
61
|
+
expect(res.data!.created, pinned).toBe(true);
|
|
62
|
+
restore?.();
|
|
63
|
+
restore = null;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("AC-10: an unreachable registry emits W02 and still records", async () => {
|
|
68
|
+
const { res } = await recordWith("0.1.7", { offline: true });
|
|
69
|
+
expect(res.data!.warnings.map((w) => w.code)).toEqual(["SYSTEM-VS-W02"]);
|
|
70
|
+
expect(res.data!.created).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("an unlisted pin is reported as W01 instead of crashing", async () => {
|
|
74
|
+
const { res } = await recordWith("0.0.1", { versions: VERSIONS, latest: "0.1.10" });
|
|
75
|
+
expect(res.data!.warnings[0]!.message).toContain("does not list");
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("AC-11: system.outbox.scan lists one pin-bump proposal per W01 warning", async () => {
|
|
79
|
+
const { root } = await recordWith("0.1.7", { versions: VERSIONS, latest: "0.1.10" });
|
|
80
|
+
const scan = await runSystemOutboxScan({ argv: [], flags: {} }, makeContext(root));
|
|
81
|
+
expect(scan.data!.pinBumps).toEqual([
|
|
82
|
+
{
|
|
83
|
+
kind: "pin-bump",
|
|
84
|
+
versionSet: "VS-0001",
|
|
85
|
+
product: "beta",
|
|
86
|
+
package: SPEC_PKG,
|
|
87
|
+
from: "0.1.7",
|
|
88
|
+
to: "0.1.10",
|
|
89
|
+
},
|
|
90
|
+
]);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("AC-12: --create materializes no task for a pin-bump proposal", async () => {
|
|
94
|
+
const { root } = await recordWith("0.1.7", { versions: VERSIONS, latest: "0.1.10" });
|
|
95
|
+
const scan = await runSystemOutboxScan(
|
|
96
|
+
{ argv: [], flags: { create: true } },
|
|
97
|
+
makeContext(root),
|
|
98
|
+
);
|
|
99
|
+
expect(scan.data!.pinBumps).toHaveLength(1);
|
|
100
|
+
expect(scan.data!.created).toEqual([]);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("AC-13: map.validate rejects a pin-drift whose authority does not offer the contract", async () => {
|
|
104
|
+
const beta = await specConsumer("0.1.9");
|
|
105
|
+
const root = await systemWith(
|
|
106
|
+
{ beta },
|
|
107
|
+
{ "system/scenarios/d.yaml": scenario("d", ["beta"], drift("beta")) },
|
|
108
|
+
);
|
|
109
|
+
const res = await runSystemMapValidate({ argv: [], flags: {} }, makeContext(root));
|
|
110
|
+
expect(res.data!.diagnostics).toContainEqual(
|
|
111
|
+
expect.objectContaining({ ruleId: "SYSTEM-MAP-07", severity: "error" }),
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1541 AC-4..AC-6, AC-14 — the validator check kind over the shared conformance path, and its SYSTEM-MAP-07 lint.</purpose>
|
|
4
|
+
<non-goals><item>Conformance leg semantics are owned by RFC-1365/1539 tests.</item></non-goals>
|
|
5
|
+
</MODULE_CONTRACT>
|
|
6
|
+
*/
|
|
7
|
+
// @vitest-environment node
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
import YAML from "yaml";
|
|
12
|
+
import { runSystemVersionSetRecord } from "../handlers/system-versionset-record.ts";
|
|
13
|
+
import { runSystemMapValidate } from "../handlers/system-map-validate.ts";
|
|
14
|
+
import { makeContext } from "./helpers.ts";
|
|
15
|
+
import {
|
|
16
|
+
TAG,
|
|
17
|
+
VALIDATOR_PKG,
|
|
18
|
+
scenario,
|
|
19
|
+
systemWith,
|
|
20
|
+
validatorProducer,
|
|
21
|
+
} from "./contract-fixtures.ts";
|
|
22
|
+
|
|
23
|
+
const validatorCheck = (producer = "intake") =>
|
|
24
|
+
` - kind: validator\n product: alpha\n producer: ${producer}\n`;
|
|
25
|
+
|
|
26
|
+
async function record(root: string) {
|
|
27
|
+
return runSystemVersionSetRecord(
|
|
28
|
+
{ argv: [], flags: { products: `alpha=${TAG}`, scenarios: "v" } },
|
|
29
|
+
makeContext(root),
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
describe("validator check kind (RFC-1541)", () => {
|
|
34
|
+
it("AC-4: passes for a consumer.package producer whose conformance run passes", async () => {
|
|
35
|
+
const alpha = await validatorProducer("package");
|
|
36
|
+
const root = await systemWith(
|
|
37
|
+
{ alpha },
|
|
38
|
+
{ "system/scenarios/v.yaml": scenario("v", ["alpha"], validatorCheck()) },
|
|
39
|
+
);
|
|
40
|
+
const res = await record(root);
|
|
41
|
+
expect(res.data!.diagnostics.filter((d) => d.severity === "error")).toEqual([]);
|
|
42
|
+
expect(res.data!.created).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("AC-5: the evidence names the validator package and version", async () => {
|
|
46
|
+
const alpha = await validatorProducer("package");
|
|
47
|
+
const root = await systemWith(
|
|
48
|
+
{ alpha },
|
|
49
|
+
{ "system/scenarios/v.yaml": scenario("v", ["alpha"], validatorCheck()) },
|
|
50
|
+
);
|
|
51
|
+
await record(root);
|
|
52
|
+
const log = await readFile(
|
|
53
|
+
path.join(root, "system/version-sets/evidence/VS-0001/v.log"),
|
|
54
|
+
"utf8",
|
|
55
|
+
);
|
|
56
|
+
expect(log).toContain(`validator: ${VALIDATOR_PKG}@2.1.0`);
|
|
57
|
+
const set = YAML.parse(
|
|
58
|
+
await readFile(path.join(root, "system/version-sets/VS-0001.yaml"), "utf8"),
|
|
59
|
+
);
|
|
60
|
+
expect(set.contracts.alpha[VALIDATOR_PKG]).toBe("2.1.0");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("AC-6: a consumer.root producer fails with SYSTEM-VS-07", async () => {
|
|
64
|
+
const alpha = await validatorProducer("root");
|
|
65
|
+
const root = await systemWith(
|
|
66
|
+
{ alpha },
|
|
67
|
+
{ "system/scenarios/v.yaml": scenario("v", ["alpha"], validatorCheck()) },
|
|
68
|
+
);
|
|
69
|
+
const res = await record(root);
|
|
70
|
+
expect(res.exitCode).toBe(1);
|
|
71
|
+
expect(res.data!.diagnostics.map((d) => d.ruleId)).toContain("SYSTEM-VS-07");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("a failing validator fails the record", async () => {
|
|
75
|
+
const alpha = await validatorProducer("package", 3);
|
|
76
|
+
const root = await systemWith(
|
|
77
|
+
{ alpha },
|
|
78
|
+
{ "system/scenarios/v.yaml": scenario("v", ["alpha"], validatorCheck()) },
|
|
79
|
+
);
|
|
80
|
+
const res = await record(root);
|
|
81
|
+
expect(res.exitCode).toBe(1);
|
|
82
|
+
expect(res.data!.created).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("AC-14: map.validate rejects a validator check naming an unknown producer", async () => {
|
|
86
|
+
const alpha = await validatorProducer("package");
|
|
87
|
+
const root = await systemWith(
|
|
88
|
+
{ alpha },
|
|
89
|
+
{ "system/scenarios/v.yaml": scenario("v", ["alpha"], validatorCheck("nope")) },
|
|
90
|
+
);
|
|
91
|
+
const res = await runSystemMapValidate({ argv: [], flags: {} }, makeContext(root));
|
|
92
|
+
expect(res.data!.diagnostics).toContainEqual(
|
|
93
|
+
expect.objectContaining({ ruleId: "SYSTEM-MAP-07", severity: "error" }),
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -10,6 +10,7 @@ reported→integrated, and --mark-failed.</purpose>
|
|
|
10
10
|
<item>RFC-1509: implement RFC-1509 — system task queue, dispatch briefs and task reports</item>
|
|
11
11
|
<item>RFC-1509: close RFC-1509 review r1 findings — mark-failed escape, open-error refusal, dry-run coverage</item>
|
|
12
12
|
<item>RFC-1509: address RFC-1509 review r2 — mark-failed without product, journal-read warning, status map diagnostics, V-49 deviations</item>
|
|
13
|
+
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
13
14
|
</CHANGE_SUMMARY>
|
|
14
15
|
*/
|
|
15
16
|
|
|
@@ -265,6 +266,21 @@ describe("system.task.collect", () => {
|
|
|
265
266
|
expect(result.exitCode).toBe(1);
|
|
266
267
|
expect(result.data?.diagnostics.some((d) => d.ruleId === "SYSTEM-TASK-02")).toBe(true);
|
|
267
268
|
});
|
|
269
|
+
|
|
270
|
+
it("RFC-1546 AC-5: a refusal's text summary names the ruleId and message", async () => {
|
|
271
|
+
const productRoot = await makeProduct();
|
|
272
|
+
const systemRoot = await makeSystemRepo({
|
|
273
|
+
"system/system.yaml": VALID_SYSTEM_YAML,
|
|
274
|
+
"system/products.yaml": VALID_PRODUCTS_YAML,
|
|
275
|
+
"system/edges.yaml": VALID_EDGES_YAML,
|
|
276
|
+
"system/products.local.yaml": localMapFor({ alpha: productRoot }),
|
|
277
|
+
"queue/tasks/T-0001.yaml": taskYaml({ state: "ready" }),
|
|
278
|
+
});
|
|
279
|
+
const result = await runSystemTaskCollect(input({ task: "T-0001" }), makeContext(systemRoot));
|
|
280
|
+
expect(result.exitCode).toBe(1);
|
|
281
|
+
expect(result.summary).toContain("SYSTEM-TASK-02");
|
|
282
|
+
expect(result.summary).toContain("T-0001 is ready");
|
|
283
|
+
});
|
|
268
284
|
});
|
|
269
285
|
|
|
270
286
|
async function SystemCollect(systemRoot: string) {
|
|
@@ -183,7 +183,10 @@ forbidden:
|
|
|
183
183
|
"system/edges.yaml": VALID_EDGES_YAML,
|
|
184
184
|
"system/products.local.yaml": localMapFor(
|
|
185
185
|
{ alpha: productRoot },
|
|
186
|
-
|
|
186
|
+
// The log path rides argv $3 — interpolating a Windows path
|
|
187
|
+
// (C:\Users\…) unquoted into the -c string would let sh consume
|
|
188
|
+
// every backslash as an escape.
|
|
189
|
+
["sh", "-c", 'echo "$1|$2" > "$3"', "sh", "{worktree}", "{task}", log],
|
|
187
190
|
),
|
|
188
191
|
"beta/.gitkeep": "",
|
|
189
192
|
"queue/tasks/T-0001.yaml": taskYaml({ state: "ready" }),
|
|
@@ -23,6 +23,7 @@ import { describe, expect, it } from "vitest";
|
|
|
23
23
|
import YAML from "yaml";
|
|
24
24
|
|
|
25
25
|
import type { ForgeCommandInput, ForgeFlagValue } from "../../../src/types.ts";
|
|
26
|
+
import { canonicalRepoDir } from "../../../src/utils/repo-path.ts";
|
|
26
27
|
import { gitExec } from "../../flow/tests/helpers.ts";
|
|
27
28
|
import { runSystemVersionSetRecord } from "../handlers/system-versionset-record.ts";
|
|
28
29
|
import { versionSetSchema } from "../scenario-schemas.ts";
|
|
@@ -105,7 +106,10 @@ async function worktreePaths(repo: string): Promise<string[]> {
|
|
|
105
106
|
return res.stdout
|
|
106
107
|
.split("\n")
|
|
107
108
|
.filter((l) => l.startsWith("worktree "))
|
|
108
|
-
.map((l) => l.slice("worktree ".length))
|
|
109
|
+
.map((l) => l.slice("worktree ".length))
|
|
110
|
+
// Git reports the resolved frame (long name, forward slashes) — bring
|
|
111
|
+
// each path into the same canonical spelling the fixture dirs get.
|
|
112
|
+
.map((p) => canonicalRepoDir(p));
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
describe("system.versionset.record", () => {
|
|
@@ -188,7 +192,7 @@ describe("system.versionset.record", () => {
|
|
|
188
192
|
);
|
|
189
193
|
for (const repo of [alpha, beta]) {
|
|
190
194
|
const paths = await worktreePaths(repo);
|
|
191
|
-
expect(paths).toEqual([repo]);
|
|
195
|
+
expect(paths).toEqual([canonicalRepoDir(repo)]);
|
|
192
196
|
}
|
|
193
197
|
});
|
|
194
198
|
|
|
@@ -232,7 +236,7 @@ describe("system.versionset.record", () => {
|
|
|
232
236
|
makeContext(systemRoot),
|
|
233
237
|
);
|
|
234
238
|
expect(result.exitCode).toBe(0);
|
|
235
|
-
expect(await worktreePaths(alpha)).toEqual([alpha]);
|
|
239
|
+
expect(await worktreePaths(alpha)).toEqual([canonicalRepoDir(alpha)]);
|
|
236
240
|
await expect(
|
|
237
241
|
readFile(path.join(systemRoot, "system/version-sets/VS-0001.yaml"), "utf8"),
|
|
238
242
|
).rejects.toThrow();
|