@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
|
@@ -23,6 +23,7 @@ file (DNA-106).</purpose>
|
|
|
23
23
|
<item>RFC-1511: scenarios, version sets and system.versionset.record</item>
|
|
24
24
|
<item>RFC-1511: accept recorded products map in verified gate, guard folders lookup and exec edges (RFC-1511 review r1)</item>
|
|
25
25
|
<item>RFC-1511: record KEY_DECISIONS for exported tag-schema regex and exec edge handling (RFC-1511 review r1)</item>
|
|
26
|
+
<item>RFC-1541: version-set@2 contracts with validator and pin-drift scenario checks</item>
|
|
26
27
|
</CHANGE_SUMMARY>
|
|
27
28
|
*/
|
|
28
29
|
|
|
@@ -42,18 +43,19 @@ import type {
|
|
|
42
43
|
import { git } from "../../flow/git.ts";
|
|
43
44
|
import { RELEASE_TAG_SCHEMA_LINE } from "../../flow/release-tags.ts";
|
|
44
45
|
import { runFlowScript } from "../../flow/scripts.ts";
|
|
45
|
-
import {
|
|
46
|
-
assertSystemRepository,
|
|
47
|
-
loadScenarios,
|
|
48
|
-
loadSystemMap,
|
|
49
|
-
type SystemMap,
|
|
50
|
-
} from "../repo.ts";
|
|
46
|
+
import { assertSystemRepository, loadScenarios, loadSystemMap, type SystemMap } from "../repo.ts";
|
|
51
47
|
import {
|
|
52
48
|
SYSTEM_VERSION_SETS_DIR,
|
|
53
49
|
versionSetSchema,
|
|
50
|
+
type PinDriftCheck,
|
|
54
51
|
type SystemScenario,
|
|
55
52
|
type VersionSet,
|
|
56
53
|
} from "../scenario-schemas.ts";
|
|
54
|
+
import { contractProducerSchema } from "../../../src/config/forge-config.ts";
|
|
55
|
+
import {
|
|
56
|
+
runProducerConformance,
|
|
57
|
+
type ContractProducerDecl,
|
|
58
|
+
} from "../../../src/conformance/index.ts";
|
|
57
59
|
|
|
58
60
|
export interface VersionSetRecordResult {
|
|
59
61
|
command: "system.versionset.record";
|
|
@@ -61,10 +63,58 @@ export interface VersionSetRecordResult {
|
|
|
61
63
|
products: Record<string, string>;
|
|
62
64
|
scenarios: string[];
|
|
63
65
|
evidence: Record<string, string>;
|
|
66
|
+
/** RFC-1541: product → package → version resolved at each tag. */
|
|
67
|
+
contracts: Record<string, Record<string, string>>;
|
|
68
|
+
/** RFC-1541: warning-only findings recorded in the set (pin drift). */
|
|
69
|
+
warnings: VersionSetWarning[];
|
|
64
70
|
created: boolean;
|
|
65
71
|
diagnostics: Diagnostic[];
|
|
66
72
|
}
|
|
67
73
|
|
|
74
|
+
export interface VersionSetWarning {
|
|
75
|
+
code: string;
|
|
76
|
+
product?: string;
|
|
77
|
+
package?: string;
|
|
78
|
+
from?: string;
|
|
79
|
+
to?: string;
|
|
80
|
+
message: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** RFC-1541: the contract packages a product declares in its forge.yaml (spec packages + validator packages). */
|
|
84
|
+
function declaredContractPackages(forgeYaml: unknown): string[] {
|
|
85
|
+
const doc = (forgeYaml ?? {}) as {
|
|
86
|
+
specPackages?: Array<{ package?: unknown }>;
|
|
87
|
+
contractProducers?: Array<{ consumer?: { package?: unknown } }>;
|
|
88
|
+
};
|
|
89
|
+
const out = new Set<string>();
|
|
90
|
+
for (const e of doc.specPackages ?? []) if (typeof e?.package === "string") out.add(e.package);
|
|
91
|
+
for (const e of doc.contractProducers ?? []) {
|
|
92
|
+
if (typeof e?.consumer?.package === "string") out.add(e.consumer.package);
|
|
93
|
+
}
|
|
94
|
+
return [...out].sort();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Root-importer version from a pnpm v9 lockfile, peer suffix stripped; null when absent. */
|
|
98
|
+
export function lockfileVersion(lockYaml: unknown, pkg: string): string | null {
|
|
99
|
+
const importer = (
|
|
100
|
+
lockYaml as {
|
|
101
|
+
importers?: Record<string, Record<string, Record<string, { version?: unknown }>>>;
|
|
102
|
+
}
|
|
103
|
+
)?.importers?.["."];
|
|
104
|
+
for (const field of ["dependencies", "devDependencies"]) {
|
|
105
|
+
const v = importer?.[field]?.[pkg]?.version;
|
|
106
|
+
if (typeof v === "string") return v.split("(")[0]!;
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function compareSemver(a: string, b: string): number {
|
|
112
|
+
const pa = a.split(/[.+-]/).map((x) => Number(x));
|
|
113
|
+
const pb = b.split(/[.+-]/).map((x) => Number(x));
|
|
114
|
+
for (let i = 0; i < 3; i++) if (pa[i] !== pb[i]) return (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
68
118
|
function diag(
|
|
69
119
|
ruleId: string,
|
|
70
120
|
severity: Diagnostic["severity"],
|
|
@@ -110,10 +160,7 @@ function parseProductsFlag(
|
|
|
110
160
|
return out;
|
|
111
161
|
}
|
|
112
162
|
|
|
113
|
-
function parseScenariosFlag(
|
|
114
|
-
raw: string | undefined,
|
|
115
|
-
diagnostics: Diagnostic[],
|
|
116
|
-
): string[] | null {
|
|
163
|
+
function parseScenariosFlag(raw: string | undefined, diagnostics: Diagnostic[]): string[] | null {
|
|
117
164
|
if (raw === undefined || raw.trim() === "") {
|
|
118
165
|
diagnostics.push(
|
|
119
166
|
diag(
|
|
@@ -257,7 +304,8 @@ export async function runSystemVersionSetRecord(
|
|
|
257
304
|
const neededProducts = new Set<string>();
|
|
258
305
|
for (const scenario of scenarios) {
|
|
259
306
|
for (const p of scenario.products) neededProducts.add(p);
|
|
260
|
-
for (const check of scenario.checks)
|
|
307
|
+
for (const check of scenario.checks)
|
|
308
|
+
if (check.kind !== "pin-drift") neededProducts.add(check.product);
|
|
261
309
|
}
|
|
262
310
|
|
|
263
311
|
const productRoots = new Map<string, string>();
|
|
@@ -319,6 +367,8 @@ export async function runSystemVersionSetRecord(
|
|
|
319
367
|
products: productTags ? Object.fromEntries(productTags) : {},
|
|
320
368
|
scenarios: scenarioIds ?? [],
|
|
321
369
|
evidence: {},
|
|
370
|
+
contracts: {},
|
|
371
|
+
warnings: [],
|
|
322
372
|
created: false,
|
|
323
373
|
diagnostics,
|
|
324
374
|
};
|
|
@@ -342,7 +392,13 @@ export async function runSystemVersionSetRecord(
|
|
|
342
392
|
try {
|
|
343
393
|
for (const [product, productRoot] of productRoots) {
|
|
344
394
|
const tmp = await io.mkdtemp(path.join(os.tmpdir(), `versionset-${product}-`));
|
|
345
|
-
const added = await git(productRoot, io, [
|
|
395
|
+
const added = await git(productRoot, io, [
|
|
396
|
+
"worktree",
|
|
397
|
+
"add",
|
|
398
|
+
"--detach",
|
|
399
|
+
tmp,
|
|
400
|
+
productTags.get(product)!,
|
|
401
|
+
]);
|
|
346
402
|
if (added.exitCode !== 0) {
|
|
347
403
|
aborted = diag(
|
|
348
404
|
"SYSTEM-VS-04",
|
|
@@ -368,11 +424,73 @@ export async function runSystemVersionSetRecord(
|
|
|
368
424
|
}
|
|
369
425
|
}
|
|
370
426
|
|
|
427
|
+
// RFC-1541: resolve the contract package versions each product carries at its tag.
|
|
428
|
+
for (const [product, tmp] of worktrees) {
|
|
429
|
+
if (aborted) break;
|
|
430
|
+
let forgeYaml: unknown = null;
|
|
431
|
+
try {
|
|
432
|
+
forgeYaml = YAML.parse(await io.readFile(path.join(tmp, "forge.yaml")));
|
|
433
|
+
} catch {
|
|
434
|
+
forgeYaml = null;
|
|
435
|
+
}
|
|
436
|
+
const packages = declaredContractPackages(forgeYaml);
|
|
437
|
+
if (packages.length === 0) continue;
|
|
438
|
+
let lock: unknown = null;
|
|
439
|
+
try {
|
|
440
|
+
lock = YAML.parse(await io.readFile(path.join(tmp, "pnpm-lock.yaml")));
|
|
441
|
+
} catch {
|
|
442
|
+
lock = null;
|
|
443
|
+
}
|
|
444
|
+
const resolved: Record<string, string> = {};
|
|
445
|
+
for (const pkg of packages) {
|
|
446
|
+
let version = lockfileVersion(lock, pkg);
|
|
447
|
+
if (version === null) {
|
|
448
|
+
try {
|
|
449
|
+
const manifest = JSON.parse(
|
|
450
|
+
await io.readFile(path.join(tmp, "node_modules", ...pkg.split("/"), "package.json")),
|
|
451
|
+
) as { version?: unknown };
|
|
452
|
+
version = typeof manifest.version === "string" ? manifest.version : null;
|
|
453
|
+
} catch {
|
|
454
|
+
version = null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (version === null) {
|
|
458
|
+
aborted = diag(
|
|
459
|
+
"SYSTEM-VS-06",
|
|
460
|
+
"error",
|
|
461
|
+
`"${product}" declares contract package ${pkg} but its version cannot be resolved at ${productTags.get(product)} (no root lockfile entry, not installed)`,
|
|
462
|
+
"Add the package as an exact root dependency and commit the lockfile in the product release.",
|
|
463
|
+
);
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
resolved[pkg] = version;
|
|
467
|
+
}
|
|
468
|
+
result.contracts[product] = resolved;
|
|
469
|
+
}
|
|
470
|
+
|
|
371
471
|
for (const scenario of scenarios) {
|
|
372
472
|
if (aborted) break;
|
|
373
473
|
const log: string[] = [];
|
|
374
474
|
for (const check of scenario.checks) {
|
|
475
|
+
if (check.kind === "pin-drift") {
|
|
476
|
+
log.push(...(await runPinDrift(check, scenario, result, io, root)));
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
375
479
|
const cwd = worktrees.get(check.product)!;
|
|
480
|
+
if (check.kind === "validator") {
|
|
481
|
+
const outcome = await runValidatorCheck(check.producer, check.product, cwd, result, io);
|
|
482
|
+
log.push(...outcome.log);
|
|
483
|
+
if (outcome.failure) {
|
|
484
|
+
aborted = diag(
|
|
485
|
+
outcome.failure.code,
|
|
486
|
+
"error",
|
|
487
|
+
`scenario "${scenario.id}" validator check failed in "${check.product}" (producer ${check.producer}) — ${outcome.failure.message}`,
|
|
488
|
+
"Fix the producer, its pinned validator, or the release — no set file is written.",
|
|
489
|
+
);
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
376
494
|
log.push(`### ${check.product}$ ${check.argv.join(" ")}\n`);
|
|
377
495
|
let res;
|
|
378
496
|
let spawnError = "";
|
|
@@ -405,14 +523,20 @@ export async function runSystemVersionSetRecord(
|
|
|
405
523
|
const logText = log.join("");
|
|
406
524
|
await io.writeFile(path.join(evidenceDir, `${scenario.id}.log`), logText);
|
|
407
525
|
if (!aborted) {
|
|
408
|
-
result.evidence[scenario.id] =
|
|
526
|
+
result.evidence[scenario.id] =
|
|
527
|
+
`sha256:${createHash("sha256").update(logText).digest("hex")}`;
|
|
409
528
|
}
|
|
410
529
|
}
|
|
411
530
|
} finally {
|
|
412
531
|
for (const [product, tmp] of worktrees) {
|
|
413
532
|
let removalNote = "";
|
|
414
533
|
try {
|
|
415
|
-
const removed = await git(productRoots.get(product)!, io, [
|
|
534
|
+
const removed = await git(productRoots.get(product)!, io, [
|
|
535
|
+
"worktree",
|
|
536
|
+
"remove",
|
|
537
|
+
"--force",
|
|
538
|
+
tmp,
|
|
539
|
+
]);
|
|
416
540
|
removalNote = removed.exitCode === 0 ? "" : removed.stderr.trim();
|
|
417
541
|
} catch (error) {
|
|
418
542
|
removalNote = error instanceof Error ? error.message : String(error);
|
|
@@ -434,17 +558,23 @@ export async function runSystemVersionSetRecord(
|
|
|
434
558
|
diagnostics.push(aborted);
|
|
435
559
|
} else {
|
|
436
560
|
const set: VersionSet = {
|
|
437
|
-
schema: "forge/version-set@
|
|
561
|
+
schema: "forge/version-set@2",
|
|
438
562
|
id,
|
|
439
563
|
products: result.products,
|
|
564
|
+
contracts: result.contracts,
|
|
440
565
|
scenarios: scenarios.map((s) => s.id),
|
|
441
566
|
evidence: result.evidence,
|
|
567
|
+
warnings: result.warnings,
|
|
442
568
|
verifiedAt: new Date().toISOString(),
|
|
443
569
|
};
|
|
444
570
|
const parsed = versionSetSchema.safeParse(set);
|
|
445
571
|
if (!parsed.success) {
|
|
446
572
|
diagnostics.push(
|
|
447
|
-
diag(
|
|
573
|
+
diag(
|
|
574
|
+
"SYSTEM-VS-04",
|
|
575
|
+
"error",
|
|
576
|
+
`internal: assembled set failed schema: ${parsed.error.message}`,
|
|
577
|
+
),
|
|
448
578
|
);
|
|
449
579
|
} else {
|
|
450
580
|
await io.mkdir(path.join(root, SYSTEM_VERSION_SETS_DIR));
|
|
@@ -474,3 +604,158 @@ export async function runSystemVersionSetRecord(
|
|
|
474
604
|
: [{ action: "Fix the error-severity diagnostics and re-run", kind: "required" as const }],
|
|
475
605
|
};
|
|
476
606
|
}
|
|
607
|
+
|
|
608
|
+
// ---------------------------------------------------------------------------
|
|
609
|
+
// RFC-1541 check kinds
|
|
610
|
+
// ---------------------------------------------------------------------------
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* `validator`: run the producer's golden conformance through the shared
|
|
614
|
+
* execution path (`runProducerConformance`, the same path forge.conformance.run
|
|
615
|
+
* uses) against the tag worktree. Only a `consumer.package` producer counts.
|
|
616
|
+
*/
|
|
617
|
+
async function runValidatorCheck(
|
|
618
|
+
producerId: string,
|
|
619
|
+
product: string,
|
|
620
|
+
cwd: string,
|
|
621
|
+
result: VersionSetRecordResult,
|
|
622
|
+
io: ReturnType<typeof resolveIo>,
|
|
623
|
+
): Promise<{ log: string[]; failure: { code: string; message: string } | null }> {
|
|
624
|
+
const log = [
|
|
625
|
+
`### ${product}$ forge.conformance.run --producer ${producerId} --require-consumer\n`,
|
|
626
|
+
];
|
|
627
|
+
let forgeYaml: { contractProducers?: unknown[] } | null = null;
|
|
628
|
+
try {
|
|
629
|
+
forgeYaml = YAML.parse(await io.readFile(path.join(cwd, "forge.yaml"))) as {
|
|
630
|
+
contractProducers?: unknown[];
|
|
631
|
+
};
|
|
632
|
+
} catch {
|
|
633
|
+
forgeYaml = null;
|
|
634
|
+
}
|
|
635
|
+
const raw = (forgeYaml?.contractProducers ?? []).find(
|
|
636
|
+
(p) => (p as { id?: unknown })?.id === producerId,
|
|
637
|
+
);
|
|
638
|
+
const parsed = raw === undefined ? null : contractProducerSchema.safeParse(raw);
|
|
639
|
+
if (!parsed || !parsed.success) {
|
|
640
|
+
return {
|
|
641
|
+
log,
|
|
642
|
+
failure: {
|
|
643
|
+
code: "SYSTEM-VS-07",
|
|
644
|
+
message: `producer "${producerId}" is not declared (or malformed) in ${product}'s forge.yaml at this tag`,
|
|
645
|
+
},
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
const decl = parsed.data as ContractProducerDecl;
|
|
649
|
+
if (decl.consumer.package === undefined) {
|
|
650
|
+
return {
|
|
651
|
+
log,
|
|
652
|
+
failure: {
|
|
653
|
+
code: "SYSTEM-VS-07",
|
|
654
|
+
message: `producer "${producerId}" uses consumer.root — a validator check needs a published consumer.package (RFC-1539)`,
|
|
655
|
+
},
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
const verdict = await runProducerConformance(decl, { repoRoot: cwd, requireConsumer: true });
|
|
659
|
+
const version = result.contracts[product]?.[decl.consumer.package] ?? "unresolved";
|
|
660
|
+
log.push(
|
|
661
|
+
`validator: ${decl.consumer.package}@${version}\n`,
|
|
662
|
+
`verdict: ${verdict.status}${verdict.failedLeg ? ` (failed leg: ${verdict.failedLeg})` : ""}\n`,
|
|
663
|
+
...verdict.diagnostics.map((d) => `${d}\n`),
|
|
664
|
+
);
|
|
665
|
+
if (verdict.status !== "pass") {
|
|
666
|
+
return {
|
|
667
|
+
log,
|
|
668
|
+
failure: {
|
|
669
|
+
code: "SYSTEM-VS-04",
|
|
670
|
+
message: `conformance verdict ${verdict.status}${verdict.failedLeg ? ` at the ${verdict.failedLeg} leg` : ""}`,
|
|
671
|
+
},
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
return { log, failure: null };
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/** `pin-drift`: compare each scenario product's recorded pin with npm's latest; warning-only. */
|
|
678
|
+
async function runPinDrift(
|
|
679
|
+
check: PinDriftCheck,
|
|
680
|
+
scenario: SystemScenario,
|
|
681
|
+
result: VersionSetRecordResult,
|
|
682
|
+
io: ReturnType<typeof resolveIo>,
|
|
683
|
+
cwd: string,
|
|
684
|
+
): Promise<string[]> {
|
|
685
|
+
const log = [
|
|
686
|
+
`### pin-drift ${check.package} (authority ${check.authority}, maxLag ${check.maxLag})\n`,
|
|
687
|
+
];
|
|
688
|
+
const npm = async (args: string[]) => {
|
|
689
|
+
try {
|
|
690
|
+
return await io.exec("npm", [...args, "--fetch-retries=0", "--fetch-timeout=15000"], {
|
|
691
|
+
cwd,
|
|
692
|
+
timeoutMs: 60_000,
|
|
693
|
+
});
|
|
694
|
+
} catch (error) {
|
|
695
|
+
return {
|
|
696
|
+
exitCode: null as number | null,
|
|
697
|
+
stdout: "",
|
|
698
|
+
stderr: error instanceof Error ? error.message : String(error),
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
const latestRes = await npm(["view", check.package, "dist-tags.latest"]);
|
|
703
|
+
const versionsRes = await npm(["view", check.package, "versions", "--json"]);
|
|
704
|
+
let versions: string[] = [];
|
|
705
|
+
try {
|
|
706
|
+
const parsed = JSON.parse(versionsRes.stdout) as unknown;
|
|
707
|
+
versions = Array.isArray(parsed)
|
|
708
|
+
? (parsed as string[])
|
|
709
|
+
: typeof parsed === "string"
|
|
710
|
+
? [parsed]
|
|
711
|
+
: [];
|
|
712
|
+
} catch {
|
|
713
|
+
versions = [];
|
|
714
|
+
}
|
|
715
|
+
const latest = latestRes.stdout.trim();
|
|
716
|
+
if (
|
|
717
|
+
latestRes.exitCode !== 0 ||
|
|
718
|
+
versionsRes.exitCode !== 0 ||
|
|
719
|
+
latest === "" ||
|
|
720
|
+
versions.length === 0
|
|
721
|
+
) {
|
|
722
|
+
const message = `npm registry unreachable for ${check.package} — pin drift not compared`;
|
|
723
|
+
result.warnings.push({ code: "SYSTEM-VS-W02", package: check.package, message });
|
|
724
|
+
log.push(`${message}\n`);
|
|
725
|
+
return log;
|
|
726
|
+
}
|
|
727
|
+
versions.sort(compareSemver);
|
|
728
|
+
const latestIndex = versions.indexOf(latest);
|
|
729
|
+
for (const product of scenario.products) {
|
|
730
|
+
if (product === check.authority) continue;
|
|
731
|
+
const pinned = result.contracts[product]?.[check.package];
|
|
732
|
+
if (pinned === undefined) continue;
|
|
733
|
+
const index = versions.indexOf(pinned);
|
|
734
|
+
if (index === -1) {
|
|
735
|
+
const message = `${product} pins ${check.package}@${pinned}, which npm does not list — cannot measure drift`;
|
|
736
|
+
result.warnings.push({
|
|
737
|
+
code: "SYSTEM-VS-W01",
|
|
738
|
+
product,
|
|
739
|
+
package: check.package,
|
|
740
|
+
from: pinned,
|
|
741
|
+
to: latest,
|
|
742
|
+
message,
|
|
743
|
+
});
|
|
744
|
+
log.push(`${message}\n`);
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
const lag = latestIndex - index;
|
|
748
|
+
log.push(`${product}: ${pinned} (latest ${latest}, lag ${lag})\n`);
|
|
749
|
+
if (lag >= check.maxLag) {
|
|
750
|
+
result.warnings.push({
|
|
751
|
+
code: "SYSTEM-VS-W01",
|
|
752
|
+
product,
|
|
753
|
+
package: check.package,
|
|
754
|
+
from: pinned,
|
|
755
|
+
to: latest,
|
|
756
|
+
message: `${product} is ${lag} published version(s) behind ${check.package}@${latest} (maxLag ${check.maxLag})`,
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
return log;
|
|
761
|
+
}
|
package/os/system/repo.ts
CHANGED
|
@@ -15,18 +15,17 @@ resolver shared with the task queue and outbox RFCs.</purpose>
|
|
|
15
15
|
<item>RFC-1508: review r1 — contract-exact map shape (root, folders-based local map, strict schemas), read failures stay diagnostics, stat-based folder check</item>
|
|
16
16
|
<item>RFC-1508: close rfc-1508 review r2 findings on folder lookup and diagnostics</item>
|
|
17
17
|
<item>RFC-1511: scenarios, version sets and system.versionset.record</item>
|
|
18
|
+
<item>RFC-1541: version-set@2 contracts with validator and pin-drift scenario checks</item>
|
|
18
19
|
</CHANGE_SUMMARY>
|
|
19
20
|
*/
|
|
20
21
|
|
|
22
|
+
import { readFileSync } from "node:fs";
|
|
21
23
|
import path from "node:path";
|
|
22
24
|
import YAML from "yaml";
|
|
23
25
|
import type { z } from "zod";
|
|
24
26
|
|
|
25
27
|
import type { Diagnostic, WorkspaceIO } from "../../src/types.ts";
|
|
26
|
-
import {
|
|
27
|
-
SYSTEM_SCENARIOS_DIR,
|
|
28
|
-
systemScenarioSchema,
|
|
29
|
-
} from "./scenario-schemas.ts";
|
|
28
|
+
import { SYSTEM_SCENARIOS_DIR, systemScenarioSchema } from "./scenario-schemas.ts";
|
|
30
29
|
import type { SystemScenario } from "./scenario-schemas.ts";
|
|
31
30
|
import {
|
|
32
31
|
systemEdgesSchema,
|
|
@@ -178,10 +177,7 @@ async function loadRequired<S extends z.ZodType>(
|
|
|
178
177
|
* map. An absent products.local.yaml is not an error (local: null); a
|
|
179
178
|
* malformed one is SYSTEM-MAP-01 like any required file.
|
|
180
179
|
*/
|
|
181
|
-
export async function loadSystemMap(
|
|
182
|
-
root: string,
|
|
183
|
-
io: WorkspaceIO,
|
|
184
|
-
): Promise<SystemMapLoadResult> {
|
|
180
|
+
export async function loadSystemMap(root: string, io: WorkspaceIO): Promise<SystemMapLoadResult> {
|
|
185
181
|
const diagnostics: Diagnostic[] = [];
|
|
186
182
|
|
|
187
183
|
const [sys, pro, edg] = await Promise.all([
|
|
@@ -225,10 +221,7 @@ function edgeKey(consumer: string, contract: string): string {
|
|
|
225
221
|
* Evaluate every cross-file rule against a loaded map. Needs the io port only
|
|
226
222
|
* for the products.local.yaml folder checks (SYSTEM-MAP-05).
|
|
227
223
|
*/
|
|
228
|
-
export async function validateSystemMap(
|
|
229
|
-
map: SystemMap,
|
|
230
|
-
io: WorkspaceIO,
|
|
231
|
-
): Promise<Diagnostic[]> {
|
|
224
|
+
export async function validateSystemMap(map: SystemMap, io: WorkspaceIO): Promise<Diagnostic[]> {
|
|
232
225
|
const diagnostics: Diagnostic[] = [];
|
|
233
226
|
const products = map.products.products;
|
|
234
227
|
const ids = new Set<string>();
|
|
@@ -394,13 +387,17 @@ export async function loadScenarios(
|
|
|
394
387
|
export function validateScenarios(
|
|
395
388
|
map: SystemMap,
|
|
396
389
|
scenarios: Map<string, SystemScenario>,
|
|
390
|
+
root?: string,
|
|
397
391
|
): Diagnostic[] {
|
|
398
392
|
const diagnostics: Diagnostic[] = [];
|
|
399
393
|
const productIds = new Set(map.products.products.map((p) => p.id));
|
|
400
394
|
const offered = new Set(map.products.products.flatMap((p) => p.offers));
|
|
401
395
|
for (const scenario of scenarios.values()) {
|
|
402
396
|
const file = `${SYSTEM_SCENARIOS_DIR}/${scenario.id}.yaml`;
|
|
403
|
-
|
|
397
|
+
const checkProducts = scenario.checks.flatMap((c) =>
|
|
398
|
+
c.kind === "pin-drift" ? [c.authority] : [c.product],
|
|
399
|
+
);
|
|
400
|
+
for (const named of new Set([...scenario.products, ...checkProducts])) {
|
|
404
401
|
if (!productIds.has(named)) {
|
|
405
402
|
diagnostics.push({
|
|
406
403
|
ruleId: "SYSTEM-MAP-06",
|
|
@@ -411,6 +408,54 @@ export function validateScenarios(
|
|
|
411
408
|
});
|
|
412
409
|
}
|
|
413
410
|
}
|
|
411
|
+
// RFC-1541 SYSTEM-MAP-07 — check-kind lints.
|
|
412
|
+
for (const check of scenario.checks) {
|
|
413
|
+
if (check.kind === "pin-drift") {
|
|
414
|
+
const authority = map.products.products.find((p) => p.id === check.authority);
|
|
415
|
+
if (authority && !authority.offers.includes(check.contract)) {
|
|
416
|
+
diagnostics.push({
|
|
417
|
+
ruleId: "SYSTEM-MAP-07",
|
|
418
|
+
severity: "error",
|
|
419
|
+
file,
|
|
420
|
+
message: `scenario "${scenario.id}" pin-drift names authority "${check.authority}", which does not offer contract "${check.contract}"`,
|
|
421
|
+
fixHint: `Name the product that offers "${check.contract}" in ${SYSTEM_PRODUCTS_FILE}.`,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
} else if (check.kind === "validator") {
|
|
425
|
+
const folder =
|
|
426
|
+
map.local !== null && Object.hasOwn(map.local.folders, check.product)
|
|
427
|
+
? map.local.folders[check.product]
|
|
428
|
+
: undefined;
|
|
429
|
+
if (!folder || root === undefined) {
|
|
430
|
+
diagnostics.push({
|
|
431
|
+
ruleId: "SYSTEM-MAP-07",
|
|
432
|
+
severity: "warning",
|
|
433
|
+
file,
|
|
434
|
+
message: `scenario "${scenario.id}" validator check on "${check.product}" not linted — no local checkout mapped`,
|
|
435
|
+
});
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
const productRoot = path.isAbsolute(folder) ? folder : path.join(root, folder);
|
|
439
|
+
let producers: unknown[] = [];
|
|
440
|
+
try {
|
|
441
|
+
const doc = YAML.parse(readFileSync(path.join(productRoot, "forge.yaml"), "utf8")) as {
|
|
442
|
+
contractProducers?: unknown[];
|
|
443
|
+
};
|
|
444
|
+
producers = doc?.contractProducers ?? [];
|
|
445
|
+
} catch {
|
|
446
|
+
producers = [];
|
|
447
|
+
}
|
|
448
|
+
if (!producers.some((p) => (p as { id?: unknown })?.id === check.producer)) {
|
|
449
|
+
diagnostics.push({
|
|
450
|
+
ruleId: "SYSTEM-MAP-07",
|
|
451
|
+
severity: "error",
|
|
452
|
+
file,
|
|
453
|
+
message: `scenario "${scenario.id}" validator check names producer "${check.producer}", which ${check.product}'s forge.yaml does not declare`,
|
|
454
|
+
fixHint: `Declare "${check.producer}" in ${check.product}'s forge.yaml contractProducers[] or fix the scenario.`,
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
414
459
|
for (const contract of scenario.contracts) {
|
|
415
460
|
if (!offered.has(contract)) {
|
|
416
461
|
diagnostics.push({
|
|
@@ -434,11 +479,7 @@ export function validateScenarios(
|
|
|
434
479
|
* Fixed precedence: a contract the consumer itself offers is `own-contract`
|
|
435
480
|
* (product-internal call), then `forbidden`, then `allowed`, else `undeclared`.
|
|
436
481
|
*/
|
|
437
|
-
export function edgeVerdict(
|
|
438
|
-
map: SystemMap,
|
|
439
|
-
consumer: string,
|
|
440
|
-
contract: string,
|
|
441
|
-
): EdgeVerdict {
|
|
482
|
+
export function edgeVerdict(map: SystemMap, consumer: string, contract: string): EdgeVerdict {
|
|
442
483
|
const product = map.products.products.find((p) => p.id === consumer);
|
|
443
484
|
if (product?.offers.includes(contract)) return "own-contract";
|
|
444
485
|
if (map.edges.forbidden.some((e) => e.consumer === consumer && e.contract === contract)) {
|
|
@@ -16,6 +16,7 @@ named scenario with sha256 evidence per scenario.</purpose>
|
|
|
16
16
|
<CHANGE_SUMMARY>
|
|
17
17
|
<item>RFC-1511: step 2 — scenario and version-set schemas</item>
|
|
18
18
|
<item>RFC-1511: scenarios, version sets and system.versionset.record</item>
|
|
19
|
+
<item>RFC-1541: version-set@2 contracts with validator and pin-drift scenario checks</item>
|
|
19
20
|
</CHANGE_SUMMARY>
|
|
20
21
|
*/
|
|
21
22
|
|
|
@@ -24,6 +25,53 @@ import { z } from "zod";
|
|
|
24
25
|
export const SYSTEM_SCENARIOS_DIR = "system/scenarios";
|
|
25
26
|
export const SYSTEM_VERSION_SETS_DIR = "system/version-sets";
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* RFC-1541: a scenario check is an argv run (default — a check without `kind`
|
|
30
|
+
* is `argv`, so RFC-1511 scenarios parse unchanged), a published-validator
|
|
31
|
+
* conformance run (`validator`), or a contract pin-drift comparison
|
|
32
|
+
* (`pin-drift`, warning-only).
|
|
33
|
+
*/
|
|
34
|
+
export const argvCheckSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
kind: z.literal("argv"),
|
|
37
|
+
product: z.string().min(1),
|
|
38
|
+
argv: z.array(z.string().min(1)).min(1),
|
|
39
|
+
timeoutSec: z.number().int().positive().default(600),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
|
|
43
|
+
export const validatorCheckSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
kind: z.literal("validator"),
|
|
46
|
+
product: z.string().min(1),
|
|
47
|
+
producer: z.string().min(1),
|
|
48
|
+
timeoutSec: z.number().int().positive().default(900),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
|
|
52
|
+
export const pinDriftCheckSchema = z
|
|
53
|
+
.object({
|
|
54
|
+
kind: z.literal("pin-drift"),
|
|
55
|
+
/** Contract id the authority offers (products.yaml offers). */
|
|
56
|
+
contract: z.string().min(1),
|
|
57
|
+
/** npm package name the contract is published as. */
|
|
58
|
+
package: z.string().min(1),
|
|
59
|
+
authority: z.string().min(1),
|
|
60
|
+
maxLag: z.number().int().positive(),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
|
|
64
|
+
export const scenarioCheckSchema = z.preprocess(
|
|
65
|
+
(raw) =>
|
|
66
|
+
raw !== null && typeof raw === "object" && !("kind" in raw) ? { kind: "argv", ...raw } : raw,
|
|
67
|
+
z.discriminatedUnion("kind", [argvCheckSchema, validatorCheckSchema, pinDriftCheckSchema]),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export type ScenarioCheck = z.infer<typeof scenarioCheckSchema>;
|
|
71
|
+
export type ArgvCheck = z.infer<typeof argvCheckSchema>;
|
|
72
|
+
export type ValidatorCheck = z.infer<typeof validatorCheckSchema>;
|
|
73
|
+
export type PinDriftCheck = z.infer<typeof pinDriftCheckSchema>;
|
|
74
|
+
|
|
27
75
|
export const systemScenarioSchema = z
|
|
28
76
|
.object({
|
|
29
77
|
schema: z.literal("forge/system-scenario@1"),
|
|
@@ -31,23 +79,13 @@ export const systemScenarioSchema = z
|
|
|
31
79
|
title: z.string().min(1),
|
|
32
80
|
products: z.array(z.string().min(1)).min(1),
|
|
33
81
|
contracts: z.array(z.string().min(1)).default([]),
|
|
34
|
-
checks: z
|
|
35
|
-
.array(
|
|
36
|
-
z
|
|
37
|
-
.object({
|
|
38
|
-
product: z.string().min(1),
|
|
39
|
-
argv: z.array(z.string().min(1)).min(1),
|
|
40
|
-
timeoutSec: z.number().int().positive().default(600),
|
|
41
|
-
})
|
|
42
|
-
.strict(),
|
|
43
|
-
)
|
|
44
|
-
.min(1),
|
|
82
|
+
checks: z.array(scenarioCheckSchema).min(1),
|
|
45
83
|
})
|
|
46
84
|
.strict();
|
|
47
85
|
|
|
48
86
|
export type SystemScenario = z.infer<typeof systemScenarioSchema>;
|
|
49
87
|
|
|
50
|
-
export const
|
|
88
|
+
export const versionSetV1Schema = z
|
|
51
89
|
.object({
|
|
52
90
|
schema: z.literal("forge/version-set@1"),
|
|
53
91
|
id: z.string().regex(/^VS-\d{4}$/),
|
|
@@ -59,4 +97,45 @@ export const versionSetSchema = z
|
|
|
59
97
|
})
|
|
60
98
|
.strict();
|
|
61
99
|
|
|
100
|
+
/**
|
|
101
|
+
* RFC-1541: @2 adds `contracts` (product → package → exact version, resolved
|
|
102
|
+
* from each tag's root lockfile importer) and warning-only `warnings[]`
|
|
103
|
+
* (pin drift). Recorded @1 files are immutable evidence and stay readable.
|
|
104
|
+
*/
|
|
105
|
+
export const versionSetV2Schema = z
|
|
106
|
+
.object({
|
|
107
|
+
schema: z.literal("forge/version-set@2"),
|
|
108
|
+
id: z.string().regex(/^VS-\d{4}$/),
|
|
109
|
+
products: z.record(z.string(), z.string().min(1)),
|
|
110
|
+
contracts: z.record(
|
|
111
|
+
z.string(),
|
|
112
|
+
z.record(
|
|
113
|
+
z.string(),
|
|
114
|
+
z.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/),
|
|
115
|
+
),
|
|
116
|
+
),
|
|
117
|
+
scenarios: z.array(z.string().min(1)).min(1),
|
|
118
|
+
evidence: z.record(z.string(), z.string().regex(/^sha256:[0-9a-f]{64}$/)),
|
|
119
|
+
warnings: z
|
|
120
|
+
.array(
|
|
121
|
+
z
|
|
122
|
+
.object({
|
|
123
|
+
code: z.string().min(1),
|
|
124
|
+
product: z.string().min(1).optional(),
|
|
125
|
+
package: z.string().min(1).optional(),
|
|
126
|
+
from: z.string().min(1).optional(),
|
|
127
|
+
to: z.string().min(1).optional(),
|
|
128
|
+
message: z.string().min(1),
|
|
129
|
+
})
|
|
130
|
+
.strict(),
|
|
131
|
+
)
|
|
132
|
+
.default([]),
|
|
133
|
+
verifiedAt: z.string().min(1),
|
|
134
|
+
})
|
|
135
|
+
.strict();
|
|
136
|
+
|
|
137
|
+
export const versionSetSchema = z.union([versionSetV1Schema, versionSetV2Schema]);
|
|
138
|
+
|
|
139
|
+
export type VersionSetV1 = z.infer<typeof versionSetV1Schema>;
|
|
140
|
+
export type VersionSetV2 = z.infer<typeof versionSetV2Schema>;
|
|
62
141
|
export type VersionSet = z.infer<typeof versionSetSchema>;
|