@warpgogol/forge 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +32 -0
- package/CHANGELOG.md +33 -0
- package/README.md +2 -2
- package/bin/cli.ts +4 -4
- package/dist/bin/cli.js +4 -4
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
- package/dist/os/adr/handlers/list-create.js +23 -2
- package/dist/os/adr/handlers/list-create.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/adr/types.js +2 -2
- package/dist/os/adr/types.js.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +2 -0
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +7 -2
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +24 -14
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/conformance/conformance.module.d.ts.map +1 -1
- package/dist/os/conformance/conformance.module.js +21 -4
- package/dist/os/conformance/conformance.module.js.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.js +64 -8
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
- package/dist/os/core/archive-regen.d.ts +99 -0
- package/dist/os/core/archive-regen.d.ts.map +1 -0
- package/dist/os/core/archive-regen.js +220 -0
- package/dist/os/core/archive-regen.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +159 -18
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +8 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/package-health.d.ts +130 -0
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +548 -7
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +5 -2
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +3 -1
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dirty-classify.d.ts +48 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -0
- package/dist/os/flow/dirty-classify.js +81 -0
- package/dist/os/flow/dirty-classify.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +85 -19
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/gate-engine.d.ts +13 -0
- package/dist/os/flow/gate-engine.d.ts.map +1 -0
- package/dist/os/flow/gate-engine.js +32 -0
- package/dist/os/flow/gate-engine.js.map +1 -0
- package/dist/os/flow/git.d.ts +45 -4
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +95 -27
- package/dist/os/flow/git.js.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.js +12 -5
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +25 -3
- package/dist/os/flow/handlers/flow-check.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +54 -31
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +33 -5
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +13 -10
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-hold.js +13 -7
- package/dist/os/flow/handlers/flow-hold.js.map +1 -1
- package/dist/os/flow/handlers/flow-install.d.ts +2 -1
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-install.js +56 -13
- package/dist/os/flow/handlers/flow-install.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +48 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +536 -65
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts +14 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +117 -12
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/handlers/flow-status.d.ts +13 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-status.js +35 -14
- package/dist/os/flow/handlers/flow-status.js.map +1 -1
- package/dist/os/flow/index.d.ts +1 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +3 -1
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/line-version.d.ts.map +1 -1
- package/dist/os/flow/line-version.js +2 -1
- package/dist/os/flow/line-version.js.map +1 -1
- package/dist/os/flow/locks.d.ts +37 -1
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +34 -14
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/preflight.d.ts +114 -0
- package/dist/os/flow/preflight.d.ts.map +1 -0
- package/dist/os/flow/preflight.js +620 -0
- package/dist/os/flow/preflight.js.map +1 -0
- package/dist/os/flow/publish.d.ts +7 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +165 -3
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +26 -1
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +27 -6
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/scripts.d.ts +4 -0
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +13 -3
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/session-checkout.d.ts +33 -0
- package/dist/os/flow/session-checkout.d.ts.map +1 -0
- package/dist/os/flow/session-checkout.js +151 -0
- package/dist/os/flow/session-checkout.js.map +1 -0
- package/dist/os/flow/worktree-path.d.ts.map +1 -1
- package/dist/os/flow/worktree-path.js +9 -3
- package/dist/os/flow/worktree-path.js.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.js +12 -4
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +4 -1
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/mission/open-missions.d.ts +8 -0
- package/dist/os/mission/open-missions.d.ts.map +1 -0
- package/dist/os/mission/open-missions.js +42 -0
- package/dist/os/mission/open-missions.js.map +1 -0
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +11 -1
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts +14 -0
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +18 -10
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +11 -2
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts +23 -0
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +82 -1
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +16 -3
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +5 -4
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +83 -8
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +77 -5
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +64 -6
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/next-id.d.ts +38 -0
- package/dist/os/rfc/next-id.d.ts.map +1 -0
- package/dist/os/rfc/next-id.js +165 -0
- package/dist/os/rfc/next-id.js.map +1 -0
- package/dist/os/rfc/probe-batch.d.ts.map +1 -1
- package/dist/os/rfc/probe-batch.js +6 -1
- package/dist/os/rfc/probe-batch.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +36 -8
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +35 -6
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +6 -6
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +81 -28
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +47 -0
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +31 -7
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/spec/spec-schema.d.ts +8 -0
- package/dist/os/spec/spec-schema.d.ts.map +1 -1
- package/dist/os/spec/spec-schema.js +1 -0
- package/dist/os/spec/spec-schema.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts +8 -0
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +18 -6
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +62 -15
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +13 -5
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
- package/dist/os/system/handlers/system-map-validate.js +2 -1
- package/dist/os/system/handlers/system-map-validate.js.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.js +54 -6
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-create.js +6 -1
- package/dist/os/system/handlers/system-task-create.js.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.js +246 -6
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
- package/dist/os/system/repo.d.ts +1 -1
- package/dist/os/system/repo.d.ts.map +1 -1
- package/dist/os/system/repo.js +53 -3
- package/dist/os/system/repo.js.map +1 -1
- package/dist/os/system/scenario-schemas.d.ts +109 -3
- package/dist/os/system/scenario-schemas.d.ts.map +1 -1
- package/dist/os/system/scenario-schemas.js +66 -10
- package/dist/os/system/scenario-schemas.js.map +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +69 -17
- package/dist/os/system/system.module.js.map +1 -1
- package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
- package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
- package/dist/os/system/tests/contract-fixtures.js +109 -0
- package/dist/os/system/tests/contract-fixtures.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +54 -18
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +41 -9
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +6 -0
- package/dist/src/conformance/index.d.ts.map +1 -1
- package/dist/src/conformance/index.js +36 -1
- package/dist/src/conformance/index.js.map +1 -1
- package/dist/src/formal/proof-runner.d.ts.map +1 -1
- package/dist/src/formal/proof-runner.js +10 -2
- package/dist/src/formal/proof-runner.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.js +4 -4
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +3 -1
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +2 -2
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +14 -2
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +3 -1
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/skill-schema.d.ts +3 -0
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +9 -2
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/spec/resolve-spec-source.d.ts +45 -0
- package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
- package/dist/src/spec/resolve-spec-source.js +153 -0
- package/dist/src/spec/resolve-spec-source.js.map +1 -0
- package/dist/src/utils/command-inventory.d.ts +28 -0
- package/dist/src/utils/command-inventory.d.ts.map +1 -0
- package/dist/src/utils/command-inventory.js +84 -0
- package/dist/src/utils/command-inventory.js.map +1 -0
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +6 -1
- package/dist/src/utils/io.js.map +1 -1
- package/dist/src/utils/repo-path.d.ts +10 -0
- package/dist/src/utils/repo-path.d.ts.map +1 -0
- package/dist/src/utils/repo-path.js +52 -0
- package/dist/src/utils/repo-path.js.map +1 -0
- package/dist/src/utils/spawn.d.ts +23 -0
- package/dist/src/utils/spawn.d.ts.map +1 -0
- package/dist/src/utils/spawn.js +83 -0
- package/dist/src/utils/spawn.js.map +1 -0
- package/docs/branch-model.md +1 -1
- package/docs/guides/existing-project.md +1 -1
- package/docs/maintainers/publishing.md +1 -1
- package/docs/reference/cli.md +8 -2
- package/docs/reference/profiles.md +1 -1
- package/os/adr/handlers/list-create.ts +26 -2
- package/os/adr/types.ts +4 -2
- package/os/compass/handlers/compass-audit-handler.ts +6 -1
- package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
- package/os/compass/handlers/git-revision.ts +8 -2
- package/os/compass/handlers/summary-record.ts +25 -14
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
- package/os/conformance/conformance.module.ts +21 -4
- package/os/conformance/handlers/conformance-validate.ts +108 -16
- package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
- package/os/core/archive-regen.ts +279 -0
- package/os/core/core.module.ts +176 -29
- package/os/core/docs-archive.test.ts +413 -3
- package/os/core/handlers/assets-helpers.ts +8 -3
- package/os/core/handlers/forge-autonomy-validate.ts +3 -1
- package/os/core/handlers/package-health.test.ts +418 -4
- package/os/core/handlers/package-health.ts +629 -7
- package/os/core/handlers/release-prepare.ts +5 -2
- package/os/flow/digest.ts +3 -1
- package/os/flow/dirty-classify.ts +112 -0
- package/os/flow/flow.module.ts +92 -24
- package/os/flow/gate-engine.ts +45 -0
- package/os/flow/git.ts +117 -29
- package/os/flow/handlers/flow-backmerge.ts +14 -4
- package/os/flow/handlers/flow-check.ts +27 -2
- package/os/flow/handlers/flow-cut.ts +97 -46
- package/os/flow/handlers/flow-discard.ts +33 -5
- package/os/flow/handlers/flow-fix.ts +22 -10
- package/os/flow/handlers/flow-hold.ts +20 -7
- package/os/flow/handlers/flow-install.ts +59 -12
- package/os/flow/handlers/flow-integrate.ts +808 -182
- package/os/flow/handlers/flow-open.ts +135 -11
- package/os/flow/handlers/flow-status.ts +45 -13
- package/os/flow/index.ts +3 -1
- package/os/flow/line-version.ts +2 -1
- package/os/flow/locks.ts +56 -14
- package/os/flow/preflight.ts +763 -0
- package/os/flow/publish.ts +200 -5
- package/os/flow/registry.ts +43 -7
- package/os/flow/scripts.ts +23 -7
- package/os/flow/session-checkout.ts +186 -0
- package/os/flow/tests/dirty-classify.test.ts +116 -0
- package/os/flow/tests/fixtures/branch-names.yaml +40 -40
- package/os/flow/tests/flow-discard.test.ts +32 -0
- package/os/flow/tests/flow-guard-parity.test.ts +10 -2
- package/os/flow/tests/flow-install.test.ts +7 -3
- package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +561 -0
- package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
- package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
- package/os/flow/tests/flow-integrate.test.ts +348 -17
- package/os/flow/tests/flow-open.pending.test.ts +277 -0
- package/os/flow/tests/flow-open.test.ts +52 -9
- package/os/flow/tests/flow-push-publish.test.ts +124 -0
- package/os/flow/tests/flow-status.test.ts +31 -1
- package/os/flow/tests/locks.test.ts +39 -3
- package/os/flow/tests/scripts.test.ts +18 -2
- package/os/flow/tests/state-roots.test.ts +8 -5
- package/os/flow/worktree-path.ts +9 -3
- package/os/formal/handlers/proof-check.test.ts +6 -3
- package/os/instructions/budget.test.ts +31 -0
- package/os/instructions/handlers/budget-validate.ts +13 -4
- package/os/instructions/instructions.module.ts +4 -1
- package/os/mission/open-missions.ts +50 -0
- package/os/queue/decision-ledger.test.ts +18 -0
- package/os/queue/manifest.ts +17 -1
- package/os/rfc/acceptance.ts +30 -10
- package/os/rfc/decision-log.ts +13 -2
- package/os/rfc/frontmatter-io.ts +89 -1
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
- package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
- package/os/rfc/handlers/implement-stamp.ts +16 -3
- package/os/rfc/handlers/index-graph.ts +5 -4
- package/os/rfc/handlers/lifecycle.test.ts +136 -0
- package/os/rfc/handlers/list-create.test.ts +82 -0
- package/os/rfc/handlers/list-create.ts +101 -8
- package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
- package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
- package/os/rfc/handlers/validate-rules.ts +103 -7
- package/os/rfc/handlers/validate.ts +68 -4
- package/os/rfc/next-id.ts +232 -0
- package/os/rfc/probe-batch.ts +6 -1
- package/os/rfc/rfc.module.ts +41 -8
- package/os/rfc/types.ts +28 -6
- package/os/rfc/verification-emit-freshness.test.ts +5 -1
- package/os/rfc/verification-emit.test.ts +5 -1
- package/os/rfc/verification-evidence.ts +99 -33
- package/os/rfc/verification-origin.ts +59 -0
- package/os/rfc/verification-refresh.test.ts +5 -1
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
- package/os/session/handlers/save.ts +35 -7
- package/os/session/tests/session-save.test.ts +154 -0
- package/os/spec/spec-schema.ts +3 -0
- package/os/spec/spec-status.ts +22 -6
- package/os/spec/spec-validate.package-source.test.ts +187 -0
- package/os/spec/spec-validate.ts +65 -14
- package/os/spec/spec.module.ts +13 -5
- package/os/system/handlers/system-map-validate.ts +4 -2
- package/os/system/handlers/system-outbox-scan.ts +65 -21
- package/os/system/handlers/system-task-create.ts +6 -1
- package/os/system/handlers/system-versionset-record.ts +301 -16
- package/os/system/repo.ts +59 -18
- package/os/system/scenario-schemas.ts +91 -12
- package/os/system/system.module.ts +70 -17
- package/os/system/tests/contract-fixtures.ts +139 -0
- package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
- package/os/system/tests/scenario-validator-check.test.ts +96 -0
- package/os/system/tests/system-task-dispatch.test.ts +4 -1
- package/os/system/tests/system-versionset.test.ts +7 -3
- package/os/system/tests/version-set-v2.test.ts +78 -0
- package/package.json +9 -1
- package/profiles/forge-shell.yaml +1 -2
- package/profiles/knowledge.yaml +1 -1
- package/profiles/system.yaml +2 -2
- package/profiles/typescript.yaml +0 -1
- package/skills/fo/fo-doctor/SKILL.md +151 -0
- package/skills/fo/fo-handoff/SKILL.md +22 -0
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
- package/skills/fo/fo-idea-implement/SKILL.md +5 -2
- package/skills/fo/fo-idea-plan/SKILL.md +5 -5
- package/skills/fo/fo-session-retro/SKILL.md +37 -11
- package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
- package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
- package/skills/meta/skill-create/SKILL.md +2 -1
- package/src/bin-entry.test.ts +3 -1
- package/src/config/forge-config.ts +57 -13
- package/src/conformance/index.ts +46 -1
- package/src/formal/proof-runner.ts +10 -2
- package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
- package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
- package/src/onboarding/agents-generate.ts +4 -4
- package/src/onboarding/nested-agents-generate.ts +3 -1
- package/src/onboarding/scaffold-project.ts +2 -2
- package/src/onboarding/upgrade.ts +13 -2
- package/src/onboarding/workspace-discovery.ts +3 -1
- package/src/pipeline-status.test.ts +1 -1
- package/src/skill-schema.ts +9 -2
- package/src/spec/resolve-spec-source.ts +184 -0
- package/src/tests/acceptance-probe-kinds.test.ts +3 -1
- package/src/tests/agents-generate-domain.test.ts +3 -2
- package/src/tests/agents-generate.test.ts +2 -1
- package/src/tests/create-flow.test.ts +3 -1
- package/src/tests/create.test.ts +12 -2
- package/src/tests/editable-generated-region.test.ts +2 -2
- package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
- package/src/tests/implement-stamp.test.ts +5 -2
- package/src/tests/profile-flow-hooks.test.ts +15 -0
- package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
- package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
- package/src/tests/scaffold-project.test.ts +3 -1
- package/src/tests/upgrade.test.ts +79 -3
- package/src/tests/workspace-discovery.test.ts +4 -3
- package/src/utils/command-inventory.ts +105 -0
- package/src/utils/io.ts +6 -1
- package/src/utils/repo-path.ts +49 -0
- package/src/utils/spawn.ts +88 -0
- package/src/tests/rfc-evidence-sync.test.ts +0 -369
- package/src/tests/skill-agents-sync.test.ts +0 -192
|
@@ -362,14 +362,18 @@ function execGit(cwd: string, args: string[]): Promise<string | null> {
|
|
|
362
362
|
|
|
363
363
|
/**
|
|
364
364
|
* Read `path`'s content at HEAD — the baseline for the id-in-diff dedup.
|
|
365
|
-
*
|
|
366
|
-
* repo
|
|
365
|
+
* `repoCwd` is a directory inside the work tree; the `./` pathspec resolves
|
|
366
|
+
* against it, so no repo-top string math is needed (a Windows 8.3 alias or
|
|
367
|
+
* drive-case drift between git's toplevel and the tempdir cwd would silently
|
|
368
|
+
* escape with `..` otherwise). Returns undefined when the file is untracked
|
|
369
|
+
* or the workspace is not a git repo (the dedup then falls back to
|
|
370
|
+
* exact-text matching only).
|
|
367
371
|
*/
|
|
368
|
-
async function readHeadSource(
|
|
369
|
-
if (!
|
|
370
|
-
const rel = relative(
|
|
372
|
+
async function readHeadSource(repoCwd: string | null, absPath: string): Promise<string | undefined> {
|
|
373
|
+
if (!repoCwd) return undefined;
|
|
374
|
+
const rel = relative(repoCwd, absPath).replace(/\\/g, "/");
|
|
371
375
|
if (rel === "" || rel.startsWith("..")) return undefined;
|
|
372
|
-
const source = await execGit(
|
|
376
|
+
const source = await execGit(repoCwd, ["show", `HEAD:./${rel}`]);
|
|
373
377
|
return source ?? undefined;
|
|
374
378
|
}
|
|
375
379
|
|
|
@@ -383,14 +387,16 @@ async function readHeadSource(gitTop: string | null, absPath: string): Promise<s
|
|
|
383
387
|
* still yield their leading ID. Returns undefined when git is unavailable.
|
|
384
388
|
*/
|
|
385
389
|
async function readDiffAddedItemIds(
|
|
386
|
-
|
|
390
|
+
repoCwd: string | null,
|
|
387
391
|
absPath: string,
|
|
388
392
|
policy: CompassPolicy,
|
|
389
393
|
): Promise<ReadonlySet<string> | undefined> {
|
|
390
|
-
if (!
|
|
391
|
-
const rel = relative(
|
|
394
|
+
if (!repoCwd) return undefined;
|
|
395
|
+
const rel = relative(repoCwd, absPath).replace(/\\/g, "/");
|
|
392
396
|
if (rel === "" || rel.startsWith("..")) return undefined;
|
|
393
|
-
|
|
397
|
+
// Pathspec after `--` resolves against the process cwd — prefix-relative,
|
|
398
|
+
// no toplevel string comparison (see readHeadSource for the Windows case).
|
|
399
|
+
const diff = await execGit(repoCwd, ["diff", "-U0", "HEAD", "--", rel]);
|
|
394
400
|
if (diff === null) return undefined;
|
|
395
401
|
const added = diff
|
|
396
402
|
.split("\n")
|
|
@@ -507,8 +513,13 @@ export async function runCompassSummaryRecord(
|
|
|
507
513
|
neutralized: [],
|
|
508
514
|
};
|
|
509
515
|
|
|
510
|
-
|
|
511
|
-
|
|
516
|
+
// Repo presence probe — the toplevel string itself is never compared
|
|
517
|
+
// (pathspecs resolve against the exec cwd), so path-frame drift between
|
|
518
|
+
// git output and the workspace path can't occur.
|
|
519
|
+
const gitCwd =
|
|
520
|
+
(await execGit(baseRoot, ["rev-parse", "--is-inside-work-tree"]))?.trim() === "true"
|
|
521
|
+
? baseRoot
|
|
522
|
+
: null;
|
|
512
523
|
|
|
513
524
|
for (const file of files) {
|
|
514
525
|
const absPath = resolve(baseRoot, file);
|
|
@@ -519,9 +530,9 @@ export async function runCompassSummaryRecord(
|
|
|
519
530
|
continue;
|
|
520
531
|
}
|
|
521
532
|
try {
|
|
522
|
-
const headSource = await readHeadSource(
|
|
533
|
+
const headSource = await readHeadSource(gitCwd, absPath);
|
|
523
534
|
const addedItemIds =
|
|
524
|
-
headSource !== undefined ? await readDiffAddedItemIds(
|
|
535
|
+
headSource !== undefined ? await readDiffAddedItemIds(gitCwd, absPath, policy) : undefined;
|
|
525
536
|
const outcome = await recordSummaryItem(
|
|
526
537
|
absPath,
|
|
527
538
|
relPath,
|
|
@@ -10,11 +10,12 @@ semantics, and the COMPASS-INVARIANT-02..07 rule table over tmp workspaces.
|
|
|
10
10
|
</non-goals>
|
|
11
11
|
</MODULE_CONTRACT>
|
|
12
12
|
<CHANGE_SUMMARY>
|
|
13
|
-
<item>RFC-1390: binding-rule fixtures — parser, resolvers, severity table, baseline keying.</item>
|
|
14
13
|
<item>RFC-1390: bind code invariants to enforcing checks (INV-tags, checked-by, baseline, generator)</item>
|
|
15
14
|
<item>RFC-1390: close review findings on invariant binding machinery</item>
|
|
16
15
|
<item>RFC-1390: close round-2 review findings on invariant binding machinery</item>
|
|
17
16
|
<item>RFC-1390: close round-3 review residue on invariant binding machinery</item>
|
|
17
|
+
<item>RFC-1517: make pkg-health-10 shipped-set faithful and scan the publish ref</item>
|
|
18
|
+
<history>RFC-1390</history>
|
|
18
19
|
</CHANGE_SUMMARY>
|
|
19
20
|
*/
|
|
20
21
|
|
|
@@ -344,7 +345,7 @@ describe("RFC-1390 invariant bindings", () => {
|
|
|
344
345
|
it("rejects a binding target that escapes the workspace via ../", async () => {
|
|
345
346
|
writeSource(
|
|
346
347
|
HIGH_FILE,
|
|
347
|
-
`// ${AI_INV}[INV-guard-11]: the guard fails closed (checked-by: test:../../outside.test.ts)
|
|
348
|
+
`// ${AI_INV}[INV-guard-11]: the guard fails closed (checked-by: test:../../outside.test.ts)` // pkg-health-10: fixture content — the escape is the test data, never resolved,
|
|
348
349
|
);
|
|
349
350
|
const result = await validate();
|
|
350
351
|
const diags = dataOf(result).diagnostics.filter(
|
|
@@ -8,11 +8,14 @@ contract producers plus the CONF-01..06 declaration lint.</purpose>
|
|
|
8
8
|
</non-goals>
|
|
9
9
|
</MODULE_CONTRACT>
|
|
10
10
|
<CHANGE_SUMMARY>
|
|
11
|
-
<item>RFC-1365: step 2 — forge-conformance module with run + validate commands.</item>
|
|
12
11
|
<item>RFC-1365: step 2 — forge.conformance.run/validate commands + dual-surface registration</item>
|
|
13
12
|
<item>RFC-1365: review round 1 — CONF-03 rescoped producer-side (Q-9), producers[] json shape, crash guard + leg output, transport attribution, env semantics, writes declared, regen sweep</item>
|
|
14
13
|
<item>RFC-1366: kernel resolves mission workpieceEnv + KERNEL-ENV-01 gate on required envInputs</item>
|
|
15
14
|
<item>RFC-1461: declare rules[] severity via CommandRuleDecl workspace-wide (RFC-1461)</item>
|
|
15
|
+
<item>RFC-1539: amend dna-55 and dna-115 for published spec packages
|
|
16
|
+
|
|
17
|
+
Guides, fo-spec-ingest routing, command descriptions and regenerated command docs, remediation entries for SPEC-15..18 and CONF-07..09; resyncs the stale .agents fo-system-dispatch mirror (ADR-0126 source line).</item>
|
|
18
|
+
<history>RFC-1365</history>
|
|
16
19
|
</CHANGE_SUMMARY>
|
|
17
20
|
*/
|
|
18
21
|
|
|
@@ -33,7 +36,8 @@ export async function createForgeConformanceModule(): Promise<ForgeModule> {
|
|
|
33
36
|
"Run golden-conformance legs (emit → mirror → consumer) for declared " +
|
|
34
37
|
"contractProducers[] against the authoritative consumer validator " +
|
|
35
38
|
"(RFC-1365). One shared execution path backs this command and the " +
|
|
36
|
-
"@warpgogol/forge/conformance vitest helper.
|
|
39
|
+
"@warpgogol/forge/conformance vitest helper. A consumer.package consumer " +
|
|
40
|
+
"(RFC-1539) runs its installed bin and never self-skips. An absent consumer.root " +
|
|
37
41
|
"self-skips with an explicit verdict; --require-consumer or " +
|
|
38
42
|
"FORGE_CONFORMANCE_REQUIRE=1 fails closed instead. Aggregate exit: " +
|
|
39
43
|
"1 iff any producer verdict is fail; {pass, skip} mixes exit 0. " +
|
|
@@ -82,11 +86,24 @@ export async function createForgeConformanceModule(): Promise<ForgeModule> {
|
|
|
82
86
|
"@warpgogol/forge/conformance or forge.conformance.run), CONF-03 " +
|
|
83
87
|
"unresolvable producer-side argv script path, CONF-04 consumer.root absent on this " +
|
|
84
88
|
"machine (warning — dead-gate risk), CONF-05 duplicate producer id, " +
|
|
85
|
-
"CONF-06 mirror omitted (warning — drift leg unarmed)
|
|
89
|
+
"CONF-06 mirror omitted (warning — drift leg unarmed); RFC-1539 CONF-07 " +
|
|
90
|
+
"consumer.package not an exact-pinned devDependency, CONF-08 consumer.package " +
|
|
91
|
+
"not installed or its bin missing, CONF-09 consumer.root while a published " +
|
|
92
|
+
"conformance validator is installed (warning). No producers " +
|
|
86
93
|
"declared → pass with no work.",
|
|
87
94
|
scope: "workspace",
|
|
88
95
|
contract: "conformance",
|
|
89
|
-
rules: [
|
|
96
|
+
rules: [
|
|
97
|
+
{ id: "CONF-01", severity: "error" },
|
|
98
|
+
{ id: "CONF-02", severity: "error" },
|
|
99
|
+
{ id: "CONF-03", severity: "error" },
|
|
100
|
+
{ id: "CONF-04", severity: "error" },
|
|
101
|
+
{ id: "CONF-05", severity: "error" },
|
|
102
|
+
{ id: "CONF-06", severity: "error" },
|
|
103
|
+
{ id: "CONF-07", severity: "error" },
|
|
104
|
+
{ id: "CONF-08", severity: "error" },
|
|
105
|
+
{ id: "CONF-09", severity: "warning" },
|
|
106
|
+
],
|
|
90
107
|
mutatesState: false,
|
|
91
108
|
writes: [],
|
|
92
109
|
coverage: "operator",
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
lint over forge.yaml contractProducers[] declarations. CONF-01 entry schema +
|
|
5
5
|
{bundle} placeholder, CONF-02 test wiring, CONF-03 argv script-path resolution,
|
|
6
6
|
CONF-04 absent consumer.root (warning), CONF-05 duplicate ids, CONF-06 missing
|
|
7
|
-
mirror (warning)
|
|
7
|
+
mirror (warning); RFC-1539 CONF-07 consumer.package not exact-pinned, CONF-08
|
|
8
|
+
consumer.package not installed / bin missing, CONF-09 consumer.root while a
|
|
9
|
+
published conformance validator is installed (warning).</purpose>
|
|
8
10
|
<non-goals>
|
|
9
11
|
<item>Do not run the conformance legs — this is a static lint; forge.conformance.run executes.</item>
|
|
10
12
|
<item>Do not execute or re-implement consumer validation rules.</item>
|
|
@@ -14,6 +16,10 @@ mirror (warning).</purpose>
|
|
|
14
16
|
<item>RFC-1365: step 2 — forge.conformance.validate handler (CONF-01..06).</item>
|
|
15
17
|
<item>RFC-1365: step 2 — forge.conformance.run/validate commands + dual-surface registration</item>
|
|
16
18
|
<item>RFC-1365: review round 1 — CONF-03 rescoped producer-side (Q-9), producers[] json shape, crash guard + leg output, transport attribution, env semantics, writes declared, regen sweep</item>
|
|
19
|
+
<item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
|
|
20
|
+
<item>RFC-1539: amend dna-55 and dna-115 for published spec packages
|
|
21
|
+
|
|
22
|
+
Guides, fo-spec-ingest routing, command descriptions and regenerated command docs, remediation entries for SPEC-15..18 and CONF-07..09; resyncs the stale .agents fo-system-dispatch mirror (ADR-0126 source line).</item>
|
|
17
23
|
</CHANGE_SUMMARY>
|
|
18
24
|
*/
|
|
19
25
|
|
|
@@ -21,7 +27,50 @@ import path from "node:path";
|
|
|
21
27
|
import { parse as parseYaml } from "yaml";
|
|
22
28
|
import * as fs from "../../../src/utils/sync-fs.ts";
|
|
23
29
|
import { contractProducerSchema } from "../../../src/config/forge-config.ts";
|
|
24
|
-
import
|
|
30
|
+
import {
|
|
31
|
+
resolvePackageConsumerBin,
|
|
32
|
+
type ContractProducerDecl,
|
|
33
|
+
} from "../../../src/conformance/index.ts";
|
|
34
|
+
import { createRequire } from "node:module";
|
|
35
|
+
|
|
36
|
+
/** An exact semver pin: no range operators, wildcards, tags or protocols (RFC-1539 CONF-07). */
|
|
37
|
+
const EXACT_PIN = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
38
|
+
|
|
39
|
+
function readRootDevDependencies(workspaceRoot: string): Record<string, string> {
|
|
40
|
+
try {
|
|
41
|
+
const manifest = JSON.parse(
|
|
42
|
+
fs.readFileSync(path.join(workspaceRoot, "package.json"), "utf8"),
|
|
43
|
+
) as {
|
|
44
|
+
devDependencies?: Record<string, string>;
|
|
45
|
+
};
|
|
46
|
+
return manifest.devDependencies ?? {};
|
|
47
|
+
} catch {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function installedManifest(workspaceRoot: string, pkg: string): Record<string, unknown> | null {
|
|
53
|
+
try {
|
|
54
|
+
const req = createRequire(path.join(workspaceRoot, "package.json"));
|
|
55
|
+
return JSON.parse(fs.readFileSync(req.resolve(`${pkg}/package.json`), "utf8")) as Record<
|
|
56
|
+
string,
|
|
57
|
+
unknown
|
|
58
|
+
>;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function isPackageInstalled(workspaceRoot: string, pkg: string): boolean {
|
|
65
|
+
return installedManifest(workspaceRoot, pkg) !== null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** A validator package marks itself with `"forge": { "conformanceValidator": true }` (RFC-1539 CONF-09). */
|
|
69
|
+
function isPublishedConformanceValidator(workspaceRoot: string, pkg: string): boolean {
|
|
70
|
+
const forge = installedManifest(workspaceRoot, pkg)?.["forge"] as
|
|
71
|
+
{ conformanceValidator?: unknown } | undefined;
|
|
72
|
+
return forge?.conformanceValidator === true;
|
|
73
|
+
}
|
|
25
74
|
import type {
|
|
26
75
|
Diagnostic,
|
|
27
76
|
ForgeCommandInput,
|
|
@@ -190,6 +239,11 @@ export async function runConformanceValidate(
|
|
|
190
239
|
}
|
|
191
240
|
}
|
|
192
241
|
|
|
242
|
+
const rootDevDependencies = readRootDevDependencies(workspaceRoot);
|
|
243
|
+
const publishedValidators = Object.keys(rootDevDependencies).filter((name) =>
|
|
244
|
+
isPublishedConformanceValidator(workspaceRoot, name),
|
|
245
|
+
);
|
|
246
|
+
|
|
193
247
|
const seenIds = new Set<string>();
|
|
194
248
|
for (const entry of entries) {
|
|
195
249
|
const decl = entry.decl;
|
|
@@ -280,20 +334,58 @@ export async function runConformanceValidate(
|
|
|
280
334
|
}
|
|
281
335
|
}
|
|
282
336
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
)
|
|
296
|
-
|
|
337
|
+
if (decl.consumer.package !== undefined) {
|
|
338
|
+
// RFC-1539 — a published validator package: exact pin (CONF-07), installed with its bin (CONF-08).
|
|
339
|
+
const pkgName = decl.consumer.package;
|
|
340
|
+
const pin = rootDevDependencies[pkgName];
|
|
341
|
+
if (pin === undefined || !EXACT_PIN.test(pin)) {
|
|
342
|
+
diagnostics.push(
|
|
343
|
+
diagnostic(
|
|
344
|
+
"CONF-07",
|
|
345
|
+
"error",
|
|
346
|
+
`producer "${decl.id}": consumer.package ${pkgName} must be an exact-pinned devDependency of the root package.json (found ${pin === undefined ? "no entry" : `"${pin}"`})`,
|
|
347
|
+
decl.id,
|
|
348
|
+
),
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
const bin = resolvePackageConsumerBin(workspaceRoot, decl.consumer.validator.argv[0]);
|
|
352
|
+
if (!isPackageInstalled(workspaceRoot, pkgName) || bin === null) {
|
|
353
|
+
diagnostics.push(
|
|
354
|
+
diagnostic(
|
|
355
|
+
"CONF-08",
|
|
356
|
+
"error",
|
|
357
|
+
`producer "${decl.id}": consumer.package ${pkgName} is not installed or has no bin "${decl.consumer.validator.argv[0]}" in node_modules/.bin — the consumer leg would fail`,
|
|
358
|
+
decl.id,
|
|
359
|
+
),
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
} else {
|
|
363
|
+
// CONF-04: consumer root absent — self-skip dead-gate risk (warning)
|
|
364
|
+
const consumerRoot = path.isAbsolute(decl.consumer.root)
|
|
365
|
+
? decl.consumer.root
|
|
366
|
+
: path.resolve(workspaceRoot, decl.consumer.root);
|
|
367
|
+
const consumerRootExists = fs.existsSync(consumerRoot);
|
|
368
|
+
if (!consumerRootExists) {
|
|
369
|
+
diagnostics.push(
|
|
370
|
+
diagnostic(
|
|
371
|
+
"CONF-04",
|
|
372
|
+
"warning",
|
|
373
|
+
`producer "${decl.id}": consumer.root absent on this machine (${decl.consumer.root}) — runs will self-skip here; enforce --require-consumer where the checkout is guaranteed`,
|
|
374
|
+
decl.id,
|
|
375
|
+
),
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
// CONF-09: a published conformance validator is installed, yet this producer still uses a checkout.
|
|
379
|
+
if (publishedValidators.length > 0) {
|
|
380
|
+
diagnostics.push(
|
|
381
|
+
diagnostic(
|
|
382
|
+
"CONF-09",
|
|
383
|
+
"warning",
|
|
384
|
+
`producer "${decl.id}": consumer.root is used while ${publishedValidators.join(", ")} ${publishedValidators.length === 1 ? "is a published conformance validator" : "are published conformance validators"} in devDependencies — switch to consumer.package if it validates this contract (RFC-1539)`,
|
|
385
|
+
decl.id,
|
|
386
|
+
),
|
|
387
|
+
);
|
|
388
|
+
}
|
|
297
389
|
}
|
|
298
390
|
|
|
299
391
|
// CONF-03 (Q-9): producer-side argv only — consumer-side execution errors
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Prove RFC-1539 package consumers: consumer.package runs the installed validator bin, never self-skips, and forge.conformance.validate enforces CONF-07/08/09.</purpose>
|
|
4
|
+
<non-goals><item>Do not re-test the RFC-1365 root-form legs (conformance.test.ts owns them).</item></non-goals>
|
|
5
|
+
</MODULE_CONTRACT>
|
|
6
|
+
<CHANGE_SUMMARY>
|
|
7
|
+
<item>RFC-1539: package consumer tests</item>
|
|
8
|
+
<item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
|
|
9
|
+
<item>RFC-1539: amend dna-55 and dna-115 for published spec packages
|
|
10
|
+
|
|
11
|
+
Guides, fo-spec-ingest routing, command descriptions and regenerated command docs, remediation entries for SPEC-15..18 and CONF-07..09; resyncs the stale .agents fo-system-dispatch mirror (ADR-0126 source line).</item>
|
|
12
|
+
</CHANGE_SUMMARY>
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
16
|
+
import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
17
|
+
import { tmpdir } from "node:os";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import {
|
|
20
|
+
runProducerConformance,
|
|
21
|
+
type ContractProducerDecl,
|
|
22
|
+
} from "../../../../src/conformance/index.ts";
|
|
23
|
+
import { runConformanceValidate } from "../conformance-validate.ts";
|
|
24
|
+
import type { ForgeRuntimeContext } from "../../../../src/types.ts";
|
|
25
|
+
|
|
26
|
+
const NODE = process.execPath;
|
|
27
|
+
const PKG = "@acme/intake-validator";
|
|
28
|
+
const EMIT = `require("node:fs").writeFileSync(require("node:path").join(process.argv[1],"bundle.txt"),"x")`;
|
|
29
|
+
|
|
30
|
+
let ws: string;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
ws = mkdtempSync(join(tmpdir(), "conformance-pkg-"));
|
|
33
|
+
});
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
rmSync(ws, { recursive: true, force: true });
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
function ctx(): ForgeRuntimeContext {
|
|
39
|
+
const noop = () => {};
|
|
40
|
+
return {
|
|
41
|
+
workspaceRoot: ws,
|
|
42
|
+
dryRun: false,
|
|
43
|
+
outputFormat: "json",
|
|
44
|
+
logger: { section: noop, info: noop, warn: noop, error: noop, success: noop },
|
|
45
|
+
} as ForgeRuntimeContext;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Install a fake validator package with an `intake-validate` bin that exits `code` when bundle.txt exists. */
|
|
49
|
+
function installValidator(opts: { conformanceValidator?: boolean; bin?: boolean } = {}): void {
|
|
50
|
+
const dir = join(ws, "node_modules", ...PKG.split("/"));
|
|
51
|
+
mkdirSync(dir, { recursive: true });
|
|
52
|
+
writeFileSync(
|
|
53
|
+
join(dir, "package.json"),
|
|
54
|
+
JSON.stringify({
|
|
55
|
+
name: PKG,
|
|
56
|
+
version: "1.0.0",
|
|
57
|
+
...(opts.conformanceValidator ? { forge: { conformanceValidator: true } } : {}),
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
if (opts.bin === false) return;
|
|
61
|
+
const binDir = join(ws, "node_modules", ".bin");
|
|
62
|
+
mkdirSync(binDir, { recursive: true });
|
|
63
|
+
const bin = join(binDir, "intake-validate");
|
|
64
|
+
writeFileSync(
|
|
65
|
+
bin,
|
|
66
|
+
`#!/bin/sh\nexec "${NODE}" -e 'const f=require("node:path").join(process.argv.at(-1),"bundle.txt");process.exit(require("node:fs").existsSync(f)?0:4)' -- "$2"\n`,
|
|
67
|
+
);
|
|
68
|
+
chmodSync(bin, 0o755);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function rootManifest(devDependencies: Record<string, string>): void {
|
|
72
|
+
writeFileSync(
|
|
73
|
+
join(ws, "package.json"),
|
|
74
|
+
JSON.stringify({ name: "producer", private: true, devDependencies }),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function packageDecl(): ContractProducerDecl {
|
|
79
|
+
return {
|
|
80
|
+
id: "intake",
|
|
81
|
+
emit: { argv: [NODE, "-e", EMIT, "{bundle}"] },
|
|
82
|
+
consumer: { package: PKG, validator: { argv: ["intake-validate", "--bundle", "{bundle}"] } },
|
|
83
|
+
test: "conformance.test.ts",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function writeForgeYaml(consumerYaml: string): void {
|
|
88
|
+
writeFileSync(
|
|
89
|
+
join(ws, "forge.yaml"),
|
|
90
|
+
`schema: forge/config@1
|
|
91
|
+
project:
|
|
92
|
+
name: producer
|
|
93
|
+
paths: {}
|
|
94
|
+
contractProducers:
|
|
95
|
+
- id: intake
|
|
96
|
+
emit:
|
|
97
|
+
argv: ["${NODE}", "-e", "1", "{bundle}"]
|
|
98
|
+
consumer:
|
|
99
|
+
${consumerYaml}
|
|
100
|
+
validator:
|
|
101
|
+
argv: ["intake-validate", "--bundle", "{bundle}"]
|
|
102
|
+
test: conformance.test.ts
|
|
103
|
+
`,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
describe("runProducerConformance — consumer.package (RFC-1539)", () => {
|
|
108
|
+
it("AC-10: runs the installed validator bin and passes", async () => {
|
|
109
|
+
installValidator();
|
|
110
|
+
const verdict = await runProducerConformance(packageDecl(), { repoRoot: ws });
|
|
111
|
+
expect(verdict.status).toBe("pass");
|
|
112
|
+
expect(verdict.legs.map((l) => [l.leg, l.status])).toEqual([
|
|
113
|
+
["emit", "pass"],
|
|
114
|
+
["consumer", "pass"],
|
|
115
|
+
]);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("a failing validator fails the consumer leg", async () => {
|
|
119
|
+
installValidator();
|
|
120
|
+
const d = packageDecl();
|
|
121
|
+
d.emit = {
|
|
122
|
+
argv: [
|
|
123
|
+
NODE,
|
|
124
|
+
"-e",
|
|
125
|
+
`require("node:fs").writeFileSync(require("node:path").join(process.argv[1],"other.txt"),"x")`,
|
|
126
|
+
"{bundle}",
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
const verdict = await runProducerConformance(d, { repoRoot: ws });
|
|
130
|
+
expect(verdict).toMatchObject({ status: "fail", failedLeg: "consumer" });
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("AC-11: an absent package fails and never reports skipped", async () => {
|
|
134
|
+
const verdict = await runProducerConformance(packageDecl(), { repoRoot: ws });
|
|
135
|
+
expect(verdict.status).toBe("fail");
|
|
136
|
+
expect(verdict.failedLeg).toBe("consumer");
|
|
137
|
+
expect(verdict.legs.some((l) => l.status === "skip")).toBe(false);
|
|
138
|
+
expect(verdict.diagnostics.join(" ")).toContain("never self-skips");
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
describe("forge.conformance.validate — CONF-07/08/09 (RFC-1539)", () => {
|
|
143
|
+
const codes = async () =>
|
|
144
|
+
(
|
|
145
|
+
(await runConformanceValidate({ argv: [], flags: {} }, ctx())).data as {
|
|
146
|
+
diagnostics: { ruleId: string; severity: string }[];
|
|
147
|
+
}
|
|
148
|
+
).diagnostics;
|
|
149
|
+
|
|
150
|
+
it("AC-12: CONF-07 fails a range-pinned consumer package", async () => {
|
|
151
|
+
installValidator();
|
|
152
|
+
rootManifest({ [PKG]: "^1.0.0" });
|
|
153
|
+
writeForgeYaml(` package: "${PKG}"`);
|
|
154
|
+
expect(await codes()).toContainEqual(
|
|
155
|
+
expect.objectContaining({ ruleId: "CONF-07", severity: "error" }),
|
|
156
|
+
);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("an exact pin with an installed bin raises neither CONF-07 nor CONF-08", async () => {
|
|
160
|
+
installValidator();
|
|
161
|
+
rootManifest({ [PKG]: "1.0.0" });
|
|
162
|
+
writeForgeYaml(` package: "${PKG}"`);
|
|
163
|
+
const ids = (await codes()).map((d) => d.ruleId);
|
|
164
|
+
expect(ids).not.toContain("CONF-07");
|
|
165
|
+
expect(ids).not.toContain("CONF-08");
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("AC-13: CONF-08 fails an uninstalled package", async () => {
|
|
169
|
+
rootManifest({ [PKG]: "1.0.0" });
|
|
170
|
+
writeForgeYaml(` package: "${PKG}"`);
|
|
171
|
+
expect(await codes()).toContainEqual(
|
|
172
|
+
expect.objectContaining({ ruleId: "CONF-08", severity: "error" }),
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("AC-13: CONF-08 fails an installed package without the argv[0] bin", async () => {
|
|
177
|
+
installValidator({ bin: false });
|
|
178
|
+
rootManifest({ [PKG]: "1.0.0" });
|
|
179
|
+
writeForgeYaml(` package: "${PKG}"`);
|
|
180
|
+
expect(await codes()).toContainEqual(expect.objectContaining({ ruleId: "CONF-08" }));
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it("AC-14: CONF-09 warns on consumer.root while a published conformance validator is installed", async () => {
|
|
184
|
+
installValidator({ conformanceValidator: true });
|
|
185
|
+
rootManifest({ [PKG]: "1.0.0" });
|
|
186
|
+
mkdirSync(join(ws, "consumer"));
|
|
187
|
+
writeForgeYaml(` root: ./consumer`);
|
|
188
|
+
expect(await codes()).toContainEqual(
|
|
189
|
+
expect.objectContaining({ ruleId: "CONF-09", severity: "warning" }),
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it("no CONF-09 for consumer.root without a published validator", async () => {
|
|
194
|
+
installValidator();
|
|
195
|
+
rootManifest({ [PKG]: "1.0.0" });
|
|
196
|
+
mkdirSync(join(ws, "consumer"));
|
|
197
|
+
writeForgeYaml(` root: ./consumer`);
|
|
198
|
+
expect((await codes()).map((d) => d.ruleId)).not.toContain("CONF-09");
|
|
199
|
+
});
|
|
200
|
+
});
|