@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
package/docs/reference/cli.md
CHANGED
|
@@ -142,13 +142,13 @@ forge pinned.init
|
|
|
142
142
|
## Package health
|
|
143
143
|
|
|
144
144
|
```sh
|
|
145
|
-
forge
|
|
145
|
+
werkstatt run forge.package.health
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
## Autonomy
|
|
149
149
|
|
|
150
150
|
```sh
|
|
151
|
-
forge
|
|
151
|
+
werkstatt run forge.autonomy.validate
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
## Authority delegations (RFC-1336)
|
|
@@ -268,3 +268,9 @@ forge note.link.validate
|
|
|
268
268
|
forge note.frontmatter.validate
|
|
269
269
|
forge note.orphan.detect
|
|
270
270
|
```
|
|
271
|
+
|
|
272
|
+
## Registered command surface
|
|
273
|
+
|
|
274
|
+
Canonical registry names (see `docs/command-manifest.generated.yaml` for the full inventory) not covered in the usage sections above:
|
|
275
|
+
|
|
276
|
+
`audit.archive`, `file.size.lint`, `flow.publication.retire`, `flow.status`, `flow.version`, `forge.assets.check`, `forge.assets.list`, `forge.build`, `forge.conformance.run`, `forge.conformance.validate`, `forge.create`, `forge.determinism.check`, `forge.dev`, `forge.doctor`, `forge.port.scaffold`, `forge.port.validate`, `forge.profile.validate`, `forge.public-surface.validate`, `forge.release.prepare`, `forge.release.publish`, `forge.scaffold`, `forge.skill.knowledge.compact`, `forge.skill.list`, `forge.skill.validate`, `forge.validate`, `memory.compact`, `mission.archive`, `outbox.validate`, `plan.archive`, `spec.live.rebuild`, `system.map.validate`, `system.outbox.scan`, `system.task.collect`, `system.task.create`, `system.task.dispatch`, `system.task.move`, `system.task.status`, `system.versionset.record`.
|
|
@@ -30,7 +30,7 @@ pnpm exec forge profile.validate
|
|
|
30
30
|
When bringing an existing project through the `/forge-bootstrap` transplant mode, Forge detects the matching profile by checking for marker files:
|
|
31
31
|
|
|
32
32
|
- `phaser.config.*` → `phaser-game`
|
|
33
|
-
- `project.godot` → `godot-game`
|
|
33
|
+
- `project.godot` → `godot-game` <!-- pkg-health-12: code/config path, not a command -->
|
|
34
34
|
- `tsconfig.json` + `pnpm-workspace.yaml` → `typescript`
|
|
35
35
|
|
|
36
36
|
## Project-agnostic
|
|
@@ -11,10 +11,13 @@
|
|
|
11
11
|
<item>RFC-1097: sweep — packages/forge + services clean
|
|
12
12
|
|
|
13
13
|
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
14
|
+
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
14
15
|
</CHANGE_SUMMARY>
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
import { ambientIo as fs } from "../../../src/utils/io.ts";
|
|
18
|
+
import { ambientIo as fs, resolveIo } from "../../../src/utils/io.ts";
|
|
19
|
+
import { allocateNextAdrId, appendReservation } from "../../rfc/next-id.ts";
|
|
20
|
+
import { currentBranch } from "../../flow/git.ts";
|
|
18
21
|
import { existsSync } from "../../../src/utils/sync-fs.ts";
|
|
19
22
|
import path from "node:path";
|
|
20
23
|
import { fileURLToPath } from "node:url";
|
|
@@ -144,7 +147,13 @@ export async function runAdrCreate(
|
|
|
144
147
|
if (num > maxId) maxId = num;
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
|
-
|
|
150
|
+
// RFC-1536 (Q-2): ADR ids share the RFC reservation surface and discipline.
|
|
151
|
+
const io = resolveIo(context.io);
|
|
152
|
+
const allocation = await allocateNextAdrId(io, workspaceRoot, maxId);
|
|
153
|
+
for (const warning of allocation.warnings) {
|
|
154
|
+
if (outputFormat === "pretty") logger.warn(`adr.create: ${warning}`);
|
|
155
|
+
}
|
|
156
|
+
const nextNum = allocation.id;
|
|
148
157
|
const paddedNum = String(nextNum).padStart(4, "0");
|
|
149
158
|
const nextSlug = `adr-${paddedNum}`;
|
|
150
159
|
const nextId = `ADR-${paddedNum}`;
|
|
@@ -196,6 +205,20 @@ export async function runAdrCreate(
|
|
|
196
205
|
}
|
|
197
206
|
|
|
198
207
|
const targetPath = path.join(adrDirPath, fileName);
|
|
208
|
+
// RFC-1536: reserve before the file write (see rfc.create for the rationale).
|
|
209
|
+
const landed = new Set<number>(files.map((f) => {
|
|
210
|
+
const m = path.basename(f).match(/^adr-(\d{4})/);
|
|
211
|
+
return m ? parseInt(m[1]!, 10) : 0;
|
|
212
|
+
}));
|
|
213
|
+
const reserved = await appendReservation(
|
|
214
|
+
io,
|
|
215
|
+
workspaceRoot,
|
|
216
|
+
{ kind: "adr", id: nextNum, session: await currentBranch(workspaceRoot, io) },
|
|
217
|
+
landed,
|
|
218
|
+
);
|
|
219
|
+
for (const warning of reserved.warnings) {
|
|
220
|
+
if (outputFormat === "pretty") logger.warn(`adr.create: ${warning}`);
|
|
221
|
+
}
|
|
199
222
|
await fs.writeFile(targetPath, content);
|
|
200
223
|
|
|
201
224
|
const relativeFile = path.join(ADR_DIR, fileName);
|
|
@@ -212,6 +235,7 @@ export async function runAdrCreate(
|
|
|
212
235
|
status: "ok",
|
|
213
236
|
file: relativeFile,
|
|
214
237
|
id: nextId,
|
|
238
|
+
idSource: allocation.source,
|
|
215
239
|
},
|
|
216
240
|
summary: `Created ${nextId}: ${title}`,
|
|
217
241
|
};
|
package/os/adr/types.ts
CHANGED
|
@@ -11,7 +11,6 @@ statuses, scopes, frontmatter shape, validation results, and list output.
|
|
|
11
11
|
</non-goals>
|
|
12
12
|
</MODULE_CONTRACT>
|
|
13
13
|
<CHANGE_SUMMARY>
|
|
14
|
-
<item>RFC-0521: migrated from packages/os/site-kernel/src/adr/ to packages/forge/os/adr/.</item>
|
|
15
14
|
<item>RFC-0727: add AdrImplementStamp types for atomic ADR status transition.</item>
|
|
16
15
|
<item>RFC-0996: add AV-17 acceptance criteria completeness check for implemented post-cutoff ADRs.</item>
|
|
17
16
|
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
@@ -20,7 +19,8 @@ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten
|
|
|
20
19
|
<item>RFC-1097: sweep — packages/forge + services clean
|
|
21
20
|
|
|
22
21
|
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
23
|
-
<
|
|
22
|
+
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
23
|
+
<history>RFC-0366, RFC-0367, RFC-0521</history>
|
|
24
24
|
</CHANGE_SUMMARY>
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -93,6 +93,8 @@ export interface AdrCreateResult {
|
|
|
93
93
|
status: "ok";
|
|
94
94
|
file: string;
|
|
95
95
|
id: string;
|
|
96
|
+
/** RFC-1536 (Q-2): which allocation surface yielded the winning maximum. */
|
|
97
|
+
idSource?: "primary" | "develop" | "reservation" | "worktree";
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
export const ADR_DIR = "docs/adrs";
|
|
@@ -320,7 +320,12 @@ export async function runCompassAuditRecord(
|
|
|
320
320
|
return { exitCode: 1, data: { path: rawFilePath, action: "recorded" } };
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
// Ledger entries key on the repo-relative logical path — forward slashes
|
|
324
|
+
// so a path recorded on one platform matches baseline filters everywhere.
|
|
325
|
+
const filePath = relative(context.workspaceRoot, resolve(process.cwd(), rawFilePath)).replace(
|
|
326
|
+
/\\/g,
|
|
327
|
+
"/",
|
|
328
|
+
);
|
|
324
329
|
|
|
325
330
|
// RFC-1143: warn when recording an audit for a ledger-ineligible path — the
|
|
326
331
|
// entry will be swept by the next baseline run (RFC-1139). Operator intent
|
|
@@ -19,7 +19,6 @@ dirty-target refusal before any write, and reports census/apply manifests.</purp
|
|
|
19
19
|
|
|
20
20
|
import { ambientIo } from "../../../src/utils/io.ts";
|
|
21
21
|
import { writeFileIfChanged } from "../../../src/utils/fs-idempotent.ts";
|
|
22
|
-
import { realpathSync } from "../../../src/utils/sync-fs.ts";
|
|
23
22
|
import { relative, resolve } from "node:path";
|
|
24
23
|
import {
|
|
25
24
|
createCompassInventoryEntries,
|
|
@@ -38,7 +37,13 @@ import {
|
|
|
38
37
|
type ScaffoldFileInput,
|
|
39
38
|
type ScaffoldFileResult,
|
|
40
39
|
} from "./compass-header-scaffold.ts";
|
|
41
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
canonicalRepoDir,
|
|
42
|
+
DIRTY_LIST_CAP,
|
|
43
|
+
isDirtyPath,
|
|
44
|
+
listDirtyPaths,
|
|
45
|
+
repoTopLevel,
|
|
46
|
+
} from "./git-revision.ts";
|
|
42
47
|
import { resolveCompassScanRoot } from "./resolve-scan-root.ts";
|
|
43
48
|
import { resolveCompassPolicy } from "../policy.ts";
|
|
44
49
|
import type {
|
|
@@ -250,16 +255,12 @@ export async function runCompassHeaderScaffold(
|
|
|
250
255
|
// Porcelain paths are repo-top-relative while reports carry
|
|
251
256
|
// workspace-relative paths — rebase through the actual top-level so a
|
|
252
257
|
// scoped scan (--package/--packages inside one repo, or a nested
|
|
253
|
-
// --workpiece repo) still sees its dirty targets.
|
|
254
|
-
// git reports canonical paths while workspaceRoot may be
|
|
258
|
+
// --workpiece repo) still sees its dirty targets. Canonicalize BOTH
|
|
259
|
+
// sides: git reports canonical paths while workspaceRoot may be
|
|
260
|
+
// symlinked — or an 8.3 alias under Windows (tmp RUNNER~1 dirs).
|
|
255
261
|
const topLevel = repoTopLevel(baseRoot);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
wsRoot = realpathSync(wsRoot);
|
|
259
|
-
} catch {
|
|
260
|
-
// keep the workspace root as given
|
|
261
|
-
}
|
|
262
|
-
const gitBase = topLevel ?? baseRoot;
|
|
262
|
+
const wsRoot = canonicalRepoDir(context.workspaceRoot);
|
|
263
|
+
const gitBase = canonicalRepoDir(topLevel ?? baseRoot);
|
|
263
264
|
const dirty = rawDirty.map((d) => {
|
|
264
265
|
const rebased = relative(wsRoot, resolve(gitBase, d)).replace(/\\/g, "/");
|
|
265
266
|
return d.endsWith("/") && !rebased.endsWith("/") ? `${rebased}/` : rebased;
|
|
@@ -20,6 +20,7 @@ plus getFileRevisionFromHistory and the porcelain dirty-path helpers
|
|
|
20
20
|
|
|
21
21
|
import { execFile, execFileSync } from "../../../src/utils/sync-fs.ts";
|
|
22
22
|
import { ambientIo } from "../../../src/utils/io.ts";
|
|
23
|
+
import { canonicalRepoDir } from "../../../src/utils/repo-path.ts";
|
|
23
24
|
import { promisify } from "node:util";
|
|
24
25
|
import { createHash } from "node:crypto";
|
|
25
26
|
|
|
@@ -34,6 +35,10 @@ const DEFAULT_GIT_TIMEOUT_MS = 15_000;
|
|
|
34
35
|
|
|
35
36
|
export const DIRTY_LIST_CAP = 20;
|
|
36
37
|
|
|
38
|
+
// Re-exported for the compass handlers that canonicalize through this
|
|
39
|
+
// module's git seam; the implementation lives in src/utils/repo-path.ts.
|
|
40
|
+
export { canonicalRepoDir };
|
|
41
|
+
|
|
37
42
|
/** The repository top-level containing `repoRoot` — null when not a git repo. */
|
|
38
43
|
export function repoTopLevel(repoRoot: string): string | null {
|
|
39
44
|
try {
|
|
@@ -61,8 +66,9 @@ export function listDirtyPaths(repoRoot: string): string[] | null {
|
|
|
61
66
|
.filter((line) => line.length >= 3)
|
|
62
67
|
.map((line) => {
|
|
63
68
|
// Porcelain is `XY <path>` — slice the raw line so leading-space
|
|
64
|
-
// status pairs (e.g. " M") keep their offsets.
|
|
65
|
-
|
|
69
|
+
// status pairs (e.g. " M") keep their offsets. A stray \r survives
|
|
70
|
+
// the split when git output is CRLF-terminated — never part of a path.
|
|
71
|
+
let path = line.slice(3).replace(/\r$/, "");
|
|
66
72
|
// Rename entries read `old -> new`; the live path is the target.
|
|
67
73
|
const arrow = path.indexOf(" -> ");
|
|
68
74
|
if (arrow >= 0) path = path.slice(arrow + 4);
|
|
@@ -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
|