@warpgogol/forge 9.3.1 → 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 +25 -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 +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/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 +13 -2
- 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 +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/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/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/rfc-implement-stamp-governance.test.ts +6 -2
- package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
- package/src/tests/scaffold-project.test.ts +3 -1
- package/src/tests/upgrade.test.ts +79 -3
- package/src/tests/workspace-discovery.test.ts +4 -3
- package/src/utils/command-inventory.ts +105 -0
- package/src/utils/io.ts +6 -1
- package/src/utils/repo-path.ts +49 -0
- package/src/utils/spawn.ts +88 -0
- package/src/tests/rfc-evidence-sync.test.ts +0 -369
- package/src/tests/skill-agents-sync.test.ts +0 -192
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Prove RFC-1539 package-sourced specs: specPackages[] resolution, SPEC-01 on installed files, amendment rules skipped, SPEC-15..18, spec.status source reporting.</purpose>
|
|
4
|
+
<non-goals><item>Do not re-test the vendored rule set (spec-validate.test.ts owns it).</item></non-goals>
|
|
5
|
+
</MODULE_CONTRACT>
|
|
6
|
+
<CHANGE_SUMMARY>
|
|
7
|
+
<item>RFC-1539: package-sourced spec tests</item>
|
|
8
|
+
<item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
|
|
9
|
+
</CHANGE_SUMMARY>
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import fs from "node:fs/promises";
|
|
13
|
+
import os from "node:os";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
16
|
+
import type { ForgeRuntimeContext } from "../../src/types.ts";
|
|
17
|
+
import { byteHash } from "../../src/utils/hash.ts";
|
|
18
|
+
import { runSpecValidate } from "./spec-validate.ts";
|
|
19
|
+
import { runSpecStatus } from "./spec-status.ts";
|
|
20
|
+
import { listSpecSources, resolveSpecSource } from "../../src/spec/resolve-spec-source.ts";
|
|
21
|
+
|
|
22
|
+
const roots: string[] = [];
|
|
23
|
+
afterEach(async () => {
|
|
24
|
+
await Promise.all(roots.splice(0).map((r) => fs.rm(r, { recursive: true, force: true })));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const PKG = "@acme/demo-spec";
|
|
28
|
+
const README = "# Demo spec\n";
|
|
29
|
+
|
|
30
|
+
function forgeSpec(version: string): string {
|
|
31
|
+
return `schema: forge/spec@1
|
|
32
|
+
id: demo-spec-v${version}
|
|
33
|
+
title: Demo
|
|
34
|
+
version: ${version}
|
|
35
|
+
status: accepted
|
|
36
|
+
reviewers: []
|
|
37
|
+
sourceNote: test fixture
|
|
38
|
+
vendoredAt: 2026-11-08
|
|
39
|
+
documents: {}
|
|
40
|
+
decisions: []
|
|
41
|
+
rfcs: []
|
|
42
|
+
waves: []
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function writeSpecDir(dir: string, version: string, readme = README): Promise<void> {
|
|
47
|
+
await fs.mkdir(dir, { recursive: true });
|
|
48
|
+
await fs.writeFile(path.join(dir, "forge-spec.yaml"), forgeSpec(version));
|
|
49
|
+
await fs.writeFile(path.join(dir, "README.md"), readme);
|
|
50
|
+
await fs.writeFile(
|
|
51
|
+
path.join(dir, "integrity.yaml"),
|
|
52
|
+
`schema: forge/spec-integrity@1\nfiles:\n "README.md": ${byteHash(README)}\n`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function workspace(opts: {
|
|
57
|
+
pin?: string | null;
|
|
58
|
+
install?: boolean;
|
|
59
|
+
declare?: string;
|
|
60
|
+
vendored?: string;
|
|
61
|
+
tamper?: boolean;
|
|
62
|
+
} = {}): Promise<string> {
|
|
63
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), "spec-pkg-"));
|
|
64
|
+
roots.push(root);
|
|
65
|
+
const declare =
|
|
66
|
+
opts.declare ?? `specPackages:\n - id: demo-spec\n package: "${PKG}"\n`;
|
|
67
|
+
await fs.writeFile(
|
|
68
|
+
path.join(root, "forge.yaml"),
|
|
69
|
+
`schema: forge/config@1\nproject:\n name: ws\n consumer: werkstatt\npaths: {}\n${declare}`,
|
|
70
|
+
);
|
|
71
|
+
const pin = opts.pin === undefined ? "0.1.9" : opts.pin;
|
|
72
|
+
await fs.writeFile(
|
|
73
|
+
path.join(root, "package.json"),
|
|
74
|
+
JSON.stringify({ name: "ws", private: true, dependencies: pin === null ? {} : { [PKG]: pin } }),
|
|
75
|
+
);
|
|
76
|
+
if (opts.install !== false) {
|
|
77
|
+
const dir = path.join(root, "node_modules", ...PKG.split("/"));
|
|
78
|
+
await writeSpecDir(dir, "0.1.9", opts.tamper ? "# tampered\n" : README);
|
|
79
|
+
await fs.writeFile(path.join(dir, "package.json"), JSON.stringify({ name: PKG, version: "0.1.9" }));
|
|
80
|
+
}
|
|
81
|
+
if (opts.vendored) {
|
|
82
|
+
await writeSpecDir(path.join(root, "docs/specs", `demo-spec-v${opts.vendored}`), opts.vendored);
|
|
83
|
+
}
|
|
84
|
+
return root;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function ctx(workspaceRoot: string): ForgeRuntimeContext {
|
|
88
|
+
return {
|
|
89
|
+
workspaceRoot,
|
|
90
|
+
dryRun: false,
|
|
91
|
+
outputFormat: "json",
|
|
92
|
+
logger: { section() {}, info() {}, warn() {}, error() {}, success() {} },
|
|
93
|
+
} as ForgeRuntimeContext;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const rules = (r: Awaited<ReturnType<typeof runSpecValidate>>) =>
|
|
97
|
+
r.data!.specs.flatMap((s) => s.violations.map((v) => v.rule));
|
|
98
|
+
|
|
99
|
+
describe("resolver (RFC-1539)", () => {
|
|
100
|
+
it("AC-1: resolves a declared package as <id>-v<installed version>", async () => {
|
|
101
|
+
const root = await workspace();
|
|
102
|
+
const source = resolveSpecSource(root, "demo-spec");
|
|
103
|
+
expect(source).toMatchObject({ kind: "package", specId: "demo-spec-v0.1.9", package: PKG, version: "0.1.9" });
|
|
104
|
+
expect(resolveSpecSource(root, "demo-spec-v0.1.9").kind).toBe("package");
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("refuses a spec id whose version differs from the installed package", async () => {
|
|
108
|
+
const root = await workspace();
|
|
109
|
+
expect(() => resolveSpecSource(root, "demo-spec-v0.1.5")).toThrow(/installed version is demo-spec-v0.1.9/);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("AC-2: a duplicate specPackages id fails with SPEC-18", async () => {
|
|
113
|
+
const root = await workspace({
|
|
114
|
+
declare: `specPackages:\n - id: demo-spec\n package: "${PKG}"\n - id: demo-spec\n package: "${PKG}"\n`,
|
|
115
|
+
});
|
|
116
|
+
expect(listSpecSources(root).diagnostics.map((d) => d.rule)).toContain("SPEC-18");
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe("spec.validate over package sources (RFC-1539)", () => {
|
|
121
|
+
it("AC-3: validates an installed package and reports its source", async () => {
|
|
122
|
+
const root = await workspace();
|
|
123
|
+
const result = await runSpecValidate({ argv: [], flags: {} }, ctx(root));
|
|
124
|
+
expect(result.exitCode).toBe(0);
|
|
125
|
+
const spec = result.data!.specs.find((s) => s.id === "demo-spec-v0.1.9")!;
|
|
126
|
+
expect(spec.source).toEqual({ kind: "package", package: PKG, version: "0.1.9" });
|
|
127
|
+
expect(spec.violations).toEqual([]);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("AC-4: SPEC-01 detects a tampered file inside the installed package", async () => {
|
|
131
|
+
const root = await workspace({ tamper: true });
|
|
132
|
+
const result = await runSpecValidate({ argv: [], flags: { spec: "demo-spec-v0.1.9" } }, ctx(root));
|
|
133
|
+
expect(result.exitCode).toBe(1);
|
|
134
|
+
expect(rules(result)).toContain("SPEC-01");
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("AC-5: amendment rules do not run for a package-sourced spec", async () => {
|
|
138
|
+
const root = await workspace();
|
|
139
|
+
const dir = path.join(root, "node_modules", ...PKG.split("/"), "amendments");
|
|
140
|
+
await fs.mkdir(dir, { recursive: true });
|
|
141
|
+
await fs.writeFile(path.join(dir, "AMD-001.yaml"), "not: [valid amendment");
|
|
142
|
+
const result = await runSpecValidate({ argv: [], flags: { spec: "demo-spec-v0.1.9" } }, ctx(root));
|
|
143
|
+
expect(rules(result).filter((r) => /SPEC-(0[89]|1[01]|14)/.test(r))).toEqual([]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("AC-6: SPEC-15 warns for a vendored copy of a declared spec package", async () => {
|
|
147
|
+
const root = await workspace({ vendored: "0.1.5" });
|
|
148
|
+
const result = await runSpecValidate({ argv: [], flags: {} }, ctx(root));
|
|
149
|
+
const vendored = result.data!.specs.find((s) => s.id === "demo-spec-v0.1.5")!;
|
|
150
|
+
expect(vendored.source).toEqual({ kind: "vendored" });
|
|
151
|
+
expect(vendored.violations).toContainEqual(expect.objectContaining({ rule: "SPEC-15", severity: "warning" }));
|
|
152
|
+
expect(result.exitCode).toBe(0);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it("AC-7: SPEC-16 fails for a declared package that is not installed", async () => {
|
|
156
|
+
const root = await workspace({ install: false });
|
|
157
|
+
const result = await runSpecValidate({ argv: [], flags: {} }, ctx(root));
|
|
158
|
+
expect(result.exitCode).toBe(1);
|
|
159
|
+
expect(rules(result)).toContain("SPEC-16");
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it("AC-8: SPEC-17 fails for a range-pinned spec package", async () => {
|
|
163
|
+
for (const pin of ["^0.1.9", "~0.1.9", "*", "latest"]) {
|
|
164
|
+
const root = await workspace({ pin });
|
|
165
|
+
const result = await runSpecValidate({ argv: [], flags: {} }, ctx(root));
|
|
166
|
+
expect(rules(result), pin).toContain("SPEC-17");
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("--spec naming another version of a package-sourced spec fails with the installed version", async () => {
|
|
171
|
+
const root = await workspace({ vendored: "0.1.5" });
|
|
172
|
+
const result = await runSpecValidate({ argv: [], flags: { spec: "demo-spec-v0.1.5" } }, ctx(root));
|
|
173
|
+
expect(result.exitCode).toBe(1);
|
|
174
|
+
expect(result.summary).toContain("installed version is demo-spec-v0.1.9");
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe("spec.status over package sources (RFC-1539)", () => {
|
|
179
|
+
it("AC-9: reports source.kind for every spec", async () => {
|
|
180
|
+
const root = await workspace({ vendored: "0.1.5" });
|
|
181
|
+
const result = await runSpecStatus({ argv: [], flags: {} }, ctx(root));
|
|
182
|
+
const kinds = Object.fromEntries(
|
|
183
|
+
(result.data as { specs: { id: string; source: { kind: string } }[] }).specs.map((s) => [s.id, s.source.kind]),
|
|
184
|
+
);
|
|
185
|
+
expect(kinds).toEqual({ "demo-spec-v0.1.5": "vendored", "demo-spec-v0.1.9": "package" });
|
|
186
|
+
});
|
|
187
|
+
});
|
package/os/spec/spec-validate.ts
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
</non-goals>
|
|
9
9
|
</MODULE_CONTRACT>
|
|
10
10
|
<CHANGE_SUMMARY>
|
|
11
|
-
<item>Gap fix: resolve materialized RFCs recursively so terminal RFC archival does not invalidate accepted specs.</item>
|
|
12
11
|
<item>RFC-1240: SPEC-12 consumers list hygiene, SPEC-13 consumer-identity warning; warnings no longer fail validation.</item>
|
|
13
12
|
<item>Handoff xrepo-personal-agent-to-forge-spec-validate-sweep: sweep mode skips dirs without forge-spec.yaml (authored/live areas are not packages), reports them as skippedDirs; --spec keeps SPEC-02.</item>
|
|
14
13
|
<item>RFC-1302: consumer-aware SPEC-07, narrowed SPEC-10, source-first bin entry (RFC-1302)</item>
|
|
15
14
|
<item>RFC-1363: fail-closed amendment loader SPEC-14 + target repairs AMD-008..011</item>
|
|
15
|
+
<item>RFC-1539: package-sourced specs and published consumer validators in Forge</item>
|
|
16
16
|
<history>RFC-0394</history>
|
|
17
17
|
</CHANGE_SUMMARY>
|
|
18
18
|
*/
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
type SpecValidateResult,
|
|
42
42
|
} from "./spec-schema.ts";
|
|
43
43
|
import { loadAmendments as loadAmendmentsShared, type LoadedAmendments } from "./spec-amendments.ts";
|
|
44
|
+
import { listSpecSources, type SpecSource } from "../../src/spec/resolve-spec-source.ts";
|
|
44
45
|
|
|
45
46
|
// ---------------------------------------------------------------------------
|
|
46
47
|
// Helpers
|
|
@@ -78,6 +79,7 @@ async function listSnapshotFiles(
|
|
|
78
79
|
async function checkIntegrity(
|
|
79
80
|
specDir: string,
|
|
80
81
|
violations: SpecViolation[],
|
|
82
|
+
extraExclude: readonly string[] = [],
|
|
81
83
|
): Promise<void> {
|
|
82
84
|
const integrityPath = path.join(specDir, "integrity.yaml");
|
|
83
85
|
const integrity = await readYaml<SpecIntegrity>(integrityPath);
|
|
@@ -96,7 +98,8 @@ async function checkIntegrity(
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
const manifest = parsed.data;
|
|
99
|
-
|
|
101
|
+
// RFC-1539: an installed package adds its own package.json (and may hold node_modules).
|
|
102
|
+
const exclude = new Set(["forge-spec.yaml", "integrity.yaml", "amendments", ...extraExclude]);
|
|
100
103
|
|
|
101
104
|
for (const [relPath, expectedHash] of Object.entries(manifest.files)) {
|
|
102
105
|
const fullPath = path.join(specDir, relPath);
|
|
@@ -456,8 +459,39 @@ export async function runSpecValidate(
|
|
|
456
459
|
|
|
457
460
|
let specDirs = await listSpecDirs(specsRoot);
|
|
458
461
|
const skippedDirs: string[] = [];
|
|
462
|
+
|
|
463
|
+
// RFC-1539: published spec packages declared in forge.yaml specPackages[].
|
|
464
|
+
const sourceListing = listSpecSources(workspaceRoot);
|
|
465
|
+
const packageSources = sourceListing.sources.filter(
|
|
466
|
+
(s): s is Extract<SpecSource, { kind: "package" }> => s.kind === "package",
|
|
467
|
+
);
|
|
468
|
+
const declarationErrors: SpecViolation[] = sourceListing.diagnostics
|
|
469
|
+
.filter((d) => d.severity === "error")
|
|
470
|
+
.map((d) => ({ rule: d.rule, message: d.message }));
|
|
471
|
+
const vendoredWarnings = new Map<string, SpecViolation[]>();
|
|
472
|
+
for (const d of sourceListing.diagnostics) {
|
|
473
|
+
if (d.severity !== "warning" || !d.specId) continue;
|
|
474
|
+
const list = vendoredWarnings.get(d.specId) ?? [];
|
|
475
|
+
list.push({ rule: d.rule, message: d.message, severity: "warning" });
|
|
476
|
+
vendoredWarnings.set(d.specId, list);
|
|
477
|
+
}
|
|
478
|
+
let selectedPackages = packageSources;
|
|
479
|
+
|
|
459
480
|
if (filterSpec) {
|
|
460
|
-
|
|
481
|
+
const pkgMatch = packageSources.find((s) => s.specId === filterSpec);
|
|
482
|
+
const pkgBase = packageSources.find((s) =>
|
|
483
|
+
filterSpec.startsWith(`${s.specId.slice(0, -`-v${s.version}`.length)}-v`),
|
|
484
|
+
);
|
|
485
|
+
if (pkgMatch) {
|
|
486
|
+
selectedPackages = [pkgMatch];
|
|
487
|
+
specDirs = [];
|
|
488
|
+
} else if (pkgBase) {
|
|
489
|
+
return {
|
|
490
|
+
data: { command: "spec.validate", status: "fail", specs: [], skippedDirs },
|
|
491
|
+
exitCode: 1,
|
|
492
|
+
summary: `spec.validate: spec '${filterSpec}' is package-sourced (${pkgBase.package}) but the installed version is ${pkgBase.specId}`,
|
|
493
|
+
};
|
|
494
|
+
} else if (!specDirs.includes(filterSpec)) {
|
|
461
495
|
return {
|
|
462
496
|
data: {
|
|
463
497
|
command: "spec.validate",
|
|
@@ -468,8 +502,10 @@ export async function runSpecValidate(
|
|
|
468
502
|
exitCode: 1,
|
|
469
503
|
summary: `spec.validate: spec '${filterSpec}' not found. Available: ${specDirs.join(", ") || "(none)"}`,
|
|
470
504
|
};
|
|
505
|
+
} else {
|
|
506
|
+
specDirs = [filterSpec];
|
|
507
|
+
selectedPackages = [];
|
|
471
508
|
}
|
|
472
|
-
specDirs = [filterSpec];
|
|
473
509
|
} else {
|
|
474
510
|
// Sweep mode: only manifest-bearing dirs are spec packages — authored
|
|
475
511
|
// work areas and docs/specs/live/ carry no forge-spec.yaml and are skipped.
|
|
@@ -482,10 +518,20 @@ export async function runSpecValidate(
|
|
|
482
518
|
|
|
483
519
|
const rfcDir = path.join(workspaceRoot, "docs", "rfcs");
|
|
484
520
|
const results: SpecValidateResult["specs"] = [];
|
|
521
|
+
if (declarationErrors.length > 0) {
|
|
522
|
+
results.push({ id: "specPackages", status: "unknown", violations: declarationErrors });
|
|
523
|
+
}
|
|
485
524
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
525
|
+
const targets: Array<{ specId: string; specDir: string; pkg?: Extract<SpecSource, { kind: "package" }> }> = [
|
|
526
|
+
...specDirs.map((specId) => ({ specId, specDir: path.join(specsRoot, specId) })),
|
|
527
|
+
...selectedPackages.map((pkg) => ({ specId: pkg.specId, specDir: pkg.dir, pkg })),
|
|
528
|
+
];
|
|
529
|
+
|
|
530
|
+
for (const { specId, specDir, pkg } of targets) {
|
|
531
|
+
const violations: SpecViolation[] = [...(pkg ? [] : (vendoredWarnings.get(specId) ?? []))];
|
|
532
|
+
const source: SpecValidateResult["specs"][number]["source"] = pkg
|
|
533
|
+
? { kind: "package", package: pkg.package, version: pkg.version }
|
|
534
|
+
: { kind: "vendored" };
|
|
489
535
|
|
|
490
536
|
// Load forge-spec.yaml
|
|
491
537
|
const forgeSpecPath = path.join(specDir, "forge-spec.yaml");
|
|
@@ -495,6 +541,7 @@ export async function runSpecValidate(
|
|
|
495
541
|
id: specId,
|
|
496
542
|
status: "unknown",
|
|
497
543
|
violations: [{ rule: "SPEC-02", message: "forge-spec.yaml not found" }],
|
|
544
|
+
source,
|
|
498
545
|
});
|
|
499
546
|
continue;
|
|
500
547
|
}
|
|
@@ -502,12 +549,12 @@ export async function runSpecValidate(
|
|
|
502
549
|
// SPEC-02: Schema
|
|
503
550
|
const spec = checkSchema(rawSpec, violations);
|
|
504
551
|
if (!spec) {
|
|
505
|
-
results.push({ id: specId, status: "unknown", violations });
|
|
552
|
+
results.push({ id: specId, status: "unknown", violations, source });
|
|
506
553
|
continue;
|
|
507
554
|
}
|
|
508
555
|
|
|
509
|
-
// SPEC-01: Integrity
|
|
510
|
-
await checkIntegrity(specDir, violations);
|
|
556
|
+
// SPEC-01: Integrity (an installed package adds package.json, never hash-covered)
|
|
557
|
+
await checkIntegrity(specDir, violations, pkg ? ["package.json", "node_modules"] : []);
|
|
511
558
|
|
|
512
559
|
// SPEC-03: Cycles
|
|
513
560
|
checkCycles(spec, violations);
|
|
@@ -524,10 +571,13 @@ export async function runSpecValidate(
|
|
|
524
571
|
// SPEC-07: materializedAs
|
|
525
572
|
await checkMaterializedAs(spec, rfcDir, localConsumer, violations);
|
|
526
573
|
|
|
527
|
-
// SPEC-08..11: Amendments (RFC-0397); SPEC-14: fail-closed load (RFC-1363)
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
574
|
+
// SPEC-08..11: Amendments (RFC-0397); SPEC-14: fail-closed load (RFC-1363).
|
|
575
|
+
// RFC-1539: package-sourced specs carry no amendments/ — feedback travels as outbox entries.
|
|
576
|
+
if (!pkg) {
|
|
577
|
+
const { amendments, errors: amendmentLoadErrors } = await loadAmendments(specDir);
|
|
578
|
+
violations.push(...amendmentLoadErrors);
|
|
579
|
+
checkAmendments(spec, amendments, violations);
|
|
580
|
+
}
|
|
531
581
|
|
|
532
582
|
// SPEC-12/13: consumers hygiene + identity warning (RFC-1240)
|
|
533
583
|
checkConsumers(spec, localConsumer, violations);
|
|
@@ -536,6 +586,7 @@ export async function runSpecValidate(
|
|
|
536
586
|
id: spec.id,
|
|
537
587
|
status: spec.status,
|
|
538
588
|
violations,
|
|
589
|
+
source,
|
|
539
590
|
});
|
|
540
591
|
}
|
|
541
592
|
|
package/os/spec/spec.module.ts
CHANGED
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-1234: spec.live.validate description lists V-LS-09 drift rule.</item>
|
|
10
9
|
<item>RFC-1240: --consumer flag on spec.validate/spec.status/spec.materialize; SPEC-12/13 rules in spec.validate description.</item>
|
|
11
10
|
<item>Handoff xrepo-personal-agent-to-forge-spec-validate-sweep: spec.validate description documents sweep-mode manifest-dir scoping.</item>
|
|
12
11
|
<item>RFC-1363: fail-closed amendment loader SPEC-14 + target repairs AMD-008..011</item>
|
|
13
12
|
<item>RFC-1461: declare rules[] severity via CommandRuleDecl workspace-wide (RFC-1461)</item>
|
|
14
|
-
<
|
|
13
|
+
<item>RFC-1539: amend dna-55 and dna-115 for published spec packages
|
|
14
|
+
|
|
15
|
+
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>
|
|
16
|
+
<history>RFC-0394, RFC-0396, RFC-0711, RFC-1173, RFC-1230, RFC-1231, RFC-1234</history>
|
|
15
17
|
</CHANGE_SUMMARY>
|
|
16
18
|
*/
|
|
17
19
|
|
|
@@ -36,7 +38,7 @@ const { runSpecValidate } = await import("./spec-validate.ts");
|
|
|
36
38
|
name: "spec.validate",
|
|
37
39
|
mutatesState: false,
|
|
38
40
|
contract: "spec",
|
|
39
|
-
rules: [{ id: "SPEC-01", severity: "error" }, { id: "SPEC-02", severity: "error" }, { id: "SPEC-03", severity: "error" }, { id: "SPEC-04", severity: "error" }, { id: "SPEC-05", severity: "error" }, { id: "SPEC-06", severity: "error" }, { id: "SPEC-07", severity: "error" }, { id: "SPEC-08", severity: "error" }, { id: "SPEC-09", severity: "error" }, { id: "SPEC-10", severity: "error" }, { id: "SPEC-11", severity: "error" }, { id: "SPEC-12", severity: "error" }, { id: "SPEC-13", severity: "error" }, { id: "SPEC-14", severity: "error" }],
|
|
41
|
+
rules: [{ id: "SPEC-01", severity: "error" }, { id: "SPEC-02", severity: "error" }, { id: "SPEC-03", severity: "error" }, { id: "SPEC-04", severity: "error" }, { id: "SPEC-05", severity: "error" }, { id: "SPEC-06", severity: "error" }, { id: "SPEC-07", severity: "error" }, { id: "SPEC-08", severity: "error" }, { id: "SPEC-09", severity: "error" }, { id: "SPEC-10", severity: "error" }, { id: "SPEC-11", severity: "error" }, { id: "SPEC-12", severity: "error" }, { id: "SPEC-13", severity: "error" }, { id: "SPEC-14", severity: "error" }, { id: "SPEC-15", severity: "warning" }, { id: "SPEC-16", severity: "error" }, { id: "SPEC-17", severity: "error" }, { id: "SPEC-18", severity: "error" }],
|
|
40
42
|
description:
|
|
41
43
|
"Validate vendored spec packages under docs/specs/. " +
|
|
42
44
|
"Checks integrity (SHA-256), schema, dependency graph (acyclic), " +
|
|
@@ -46,7 +48,12 @@ const { runSpecValidate } = await import("./spec-validate.ts");
|
|
|
46
48
|
"errors — the run fails closed instead of skipping them (RFC-1363). " +
|
|
47
49
|
"Sweep mode skips directories without forge-spec.yaml (authored/live dirs " +
|
|
48
50
|
"are not packages); --spec=<id> validates one spec and reports SPEC-02 " +
|
|
49
|
-
"when the named dir lacks a manifest."
|
|
51
|
+
"when the named dir lacks a manifest. " +
|
|
52
|
+
"RFC-1539: published spec packages declared in forge.yaml specPackages[] are " +
|
|
53
|
+
"validated from the installed package as <id>-v<version> under the same rules " +
|
|
54
|
+
"(amendment rules skipped); SPEC-15 vendored copy of a declared spec (warning), " +
|
|
55
|
+
"SPEC-16 declared package not installed, SPEC-17 not an exact-pinned root " +
|
|
56
|
+
"dependency, SPEC-18 duplicate specPackages id.",
|
|
50
57
|
scope: "workspace",
|
|
51
58
|
flags: {
|
|
52
59
|
spec: {
|
|
@@ -66,7 +73,8 @@ const { runSpecValidate } = await import("./spec-validate.ts");
|
|
|
66
73
|
coverage: "operator" as const,
|
|
67
74
|
mutatesState: false,
|
|
68
75
|
description:
|
|
69
|
-
"Show roadmap progress for vendored specs
|
|
76
|
+
"Show roadmap progress for vendored specs and installed spec packages " +
|
|
77
|
+
"(specPackages[], RFC-1539 — each entry reports source.kind). " +
|
|
70
78
|
"Without --spec, summarizes all specs; with it, full per-node table + computed front.",
|
|
71
79
|
scope: "workspace",
|
|
72
80
|
flags: {
|
|
@@ -14,6 +14,7 @@ error-severity diagnostic exists.</purpose>
|
|
|
14
14
|
<item>RFC-1508: implement RFC-1508 — system profile, system map schemas and system.map.validate</item>
|
|
15
15
|
<item>RFC-1508: align rfc-1508 schemas with the normative contract after review r1</item>
|
|
16
16
|
<item>RFC-1511: scenarios, version sets and system.versionset.record</item>
|
|
17
|
+
<item>RFC-1541: version-set@2 contracts with validator and pin-drift scenario checks</item>
|
|
17
18
|
</CHANGE_SUMMARY>
|
|
18
19
|
*/
|
|
19
20
|
|
|
@@ -63,7 +64,7 @@ export async function runSystemMapValidate(
|
|
|
63
64
|
diagnostics.push(...(await validateSystemMap(map, io)));
|
|
64
65
|
const scenarios = await loadScenarios(root, io);
|
|
65
66
|
diagnostics.push(...scenarios.diagnostics);
|
|
66
|
-
diagnostics.push(...validateScenarios(map, scenarios.scenarios));
|
|
67
|
+
diagnostics.push(...validateScenarios(map, scenarios.scenarios, root));
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -99,7 +100,8 @@ export async function runSystemMapValidate(
|
|
|
99
100
|
? [{ action: "Fix the error-severity system-map diagnostics above", kind: "required" }]
|
|
100
101
|
: [
|
|
101
102
|
{
|
|
102
|
-
action:
|
|
103
|
+
action:
|
|
104
|
+
"Declare products, offered contracts and edges under system/ as the system grows",
|
|
103
105
|
kind: "optional",
|
|
104
106
|
},
|
|
105
107
|
],
|
|
@@ -17,6 +17,7 @@ because a product cannot know the system's name.</purpose>
|
|
|
17
17
|
<item>RFC-1510: implement RFC-1510 — product outbox for dependency-contract requests</item>
|
|
18
18
|
<item>RFC-1510: close RFC-1510 review r1 findings — folder crash guard, ls-tree allowlist, OUTBOX-02 on develop</item>
|
|
19
19
|
<item>RFC-1510: close RFC-1510 review r2 — declare OUTBOX-02 in scan rules, flat-scope test, readdir TOCTOU guard</item>
|
|
20
|
+
<item>RFC-1541: version-set@2 contracts with validator and pin-drift scenario checks</item>
|
|
20
21
|
</CHANGE_SUMMARY>
|
|
21
22
|
*/
|
|
22
23
|
|
|
@@ -41,9 +42,21 @@ import { assertSystemRepository, edgeVerdict, loadSystemMap } from "../repo.ts";
|
|
|
41
42
|
import { listTasks } from "../task-store.ts";
|
|
42
43
|
import { createTask, writeTaskWithBrief } from "./system-task-create.ts";
|
|
43
44
|
|
|
45
|
+
/** RFC-1541: a contract pin a consumer should bump, from the newest version set's W01 warnings. */
|
|
46
|
+
export interface PinBumpProposal {
|
|
47
|
+
kind: "pin-bump";
|
|
48
|
+
versionSet: string;
|
|
49
|
+
product: string;
|
|
50
|
+
package: string;
|
|
51
|
+
from: string;
|
|
52
|
+
to: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
44
55
|
export interface SystemOutboxScanResult {
|
|
45
56
|
command: "system.outbox.scan";
|
|
46
57
|
proposals: OutboxProposal[];
|
|
58
|
+
/** RFC-1541: proposals only — never materialized as tasks by --create. */
|
|
59
|
+
pinBumps: PinBumpProposal[];
|
|
47
60
|
created: string[];
|
|
48
61
|
diagnostics: Diagnostic[];
|
|
49
62
|
}
|
|
@@ -57,6 +70,44 @@ function diag(
|
|
|
57
70
|
return fixHint ? { ruleId, severity, message, fixHint } : { ruleId, severity, message };
|
|
58
71
|
}
|
|
59
72
|
|
|
73
|
+
/** RFC-1541: W01 pin-drift warnings of the highest-numbered version set (@2 only). */
|
|
74
|
+
async function readPinBumps(root: string, io: WorkspaceIO): Promise<PinBumpProposal[]> {
|
|
75
|
+
const dir = path.join(root, "system", "version-sets");
|
|
76
|
+
let names: string[] = [];
|
|
77
|
+
try {
|
|
78
|
+
names = (await io.readdir(dir))
|
|
79
|
+
.filter((e) => !e.isDirectory && /^VS-\d{4}\.yaml$/.test(e.name))
|
|
80
|
+
.map((e) => e.name)
|
|
81
|
+
.sort();
|
|
82
|
+
} catch {
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
const newest = names.at(-1);
|
|
86
|
+
if (!newest) return [];
|
|
87
|
+
type VersionSetDoc = { schema?: unknown; id?: unknown; warnings?: unknown };
|
|
88
|
+
let doc: VersionSetDoc | null;
|
|
89
|
+
try {
|
|
90
|
+
doc = YAML.parse(await io.readFile(path.join(dir, newest))) as VersionSetDoc | null;
|
|
91
|
+
} catch {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
if (doc?.schema !== "forge/version-set@2" || !Array.isArray(doc.warnings)) return [];
|
|
95
|
+
const out: PinBumpProposal[] = [];
|
|
96
|
+
for (const w of doc.warnings as Array<Record<string, unknown>>) {
|
|
97
|
+
if (w.code !== "SYSTEM-VS-W01") continue;
|
|
98
|
+
if (typeof w.product !== "string" || typeof w.package !== "string") continue;
|
|
99
|
+
out.push({
|
|
100
|
+
kind: "pin-bump",
|
|
101
|
+
versionSet: String(doc.id),
|
|
102
|
+
product: w.product,
|
|
103
|
+
package: w.package,
|
|
104
|
+
from: String(w.from ?? "unknown"),
|
|
105
|
+
to: String(w.to ?? "unknown"),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
|
|
60
111
|
/** Word-boundary match for a kebab system id inside a product-side file. */
|
|
61
112
|
function systemIdNeedleFor(id: string): RegExp {
|
|
62
113
|
const escaped = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -64,11 +115,7 @@ function systemIdNeedleFor(id: string): RegExp {
|
|
|
64
115
|
}
|
|
65
116
|
|
|
66
117
|
/** Committed file contents on the product's develop, or null when unreadable. */
|
|
67
|
-
async function gitShow(
|
|
68
|
-
io: WorkspaceIO,
|
|
69
|
-
repo: string,
|
|
70
|
-
spec: string,
|
|
71
|
-
): Promise<string | null> {
|
|
118
|
+
async function gitShow(io: WorkspaceIO, repo: string, spec: string): Promise<string | null> {
|
|
72
119
|
const res = await io.exec("git", ["show", spec], { cwd: repo });
|
|
73
120
|
return res.exitCode === 0 ? res.stdout : null;
|
|
74
121
|
}
|
|
@@ -108,10 +155,7 @@ export async function runSystemOutboxScan(
|
|
|
108
155
|
}
|
|
109
156
|
|
|
110
157
|
for (const product of map.products.products) {
|
|
111
|
-
const folder = Object.prototype.hasOwnProperty.call(
|
|
112
|
-
map.local?.folders ?? {},
|
|
113
|
-
product.id,
|
|
114
|
-
)
|
|
158
|
+
const folder = Object.prototype.hasOwnProperty.call(map.local?.folders ?? {}, product.id)
|
|
115
159
|
? map.local!.folders[product.id]
|
|
116
160
|
: undefined;
|
|
117
161
|
if (folder === undefined) {
|
|
@@ -147,11 +191,9 @@ export async function runSystemOutboxScan(
|
|
|
147
191
|
|
|
148
192
|
let tree: Awaited<ReturnType<WorkspaceIO["exec"]>>;
|
|
149
193
|
try {
|
|
150
|
-
tree = await io.exec(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{ cwd: productRoot },
|
|
154
|
-
);
|
|
194
|
+
tree = await io.exec("git", ["ls-tree", "--name-only", "develop", `${OUTBOX_DIR}/`], {
|
|
195
|
+
cwd: productRoot,
|
|
196
|
+
});
|
|
155
197
|
} catch {
|
|
156
198
|
diagnostics.push(
|
|
157
199
|
diag(
|
|
@@ -189,7 +231,10 @@ export async function runSystemOutboxScan(
|
|
|
189
231
|
);
|
|
190
232
|
}
|
|
191
233
|
|
|
192
|
-
for (const rel of tree.stdout
|
|
234
|
+
for (const rel of tree.stdout
|
|
235
|
+
.split("\n")
|
|
236
|
+
.map((l) => l.trim())
|
|
237
|
+
.filter((l) => l.endsWith(".yaml"))) {
|
|
193
238
|
const raw = await gitShow(io, productRoot, `develop:${rel}`);
|
|
194
239
|
if (raw === null) continue;
|
|
195
240
|
if (systemIdNeedle.test(raw)) {
|
|
@@ -227,10 +272,7 @@ export async function runSystemOutboxScan(
|
|
|
227
272
|
),
|
|
228
273
|
);
|
|
229
274
|
}
|
|
230
|
-
if (
|
|
231
|
-
parsed !== null &&
|
|
232
|
-
path.posix.basename(rel, ".yaml") !== parsed.id
|
|
233
|
-
) {
|
|
275
|
+
if (parsed !== null && path.posix.basename(rel, ".yaml") !== parsed.id) {
|
|
234
276
|
diagnostics.push(
|
|
235
277
|
diag(
|
|
236
278
|
"OUTBOX-02",
|
|
@@ -300,11 +342,13 @@ export async function runSystemOutboxScan(
|
|
|
300
342
|
}
|
|
301
343
|
}
|
|
302
344
|
|
|
345
|
+
const pinBumps = await readPinBumps(root, io);
|
|
346
|
+
|
|
303
347
|
const errors = diagnostics.filter((d) => d.severity === "error").length;
|
|
304
348
|
return {
|
|
305
|
-
data: { command: "system.outbox.scan", proposals, created, diagnostics },
|
|
349
|
+
data: { command: "system.outbox.scan", proposals, pinBumps, created, diagnostics },
|
|
306
350
|
exitCode: errors > 0 ? 1 : 0,
|
|
307
|
-
summary: `system.outbox.scan: ${proposals.length} proposal(s), ${created.length} task(s) created, ${errors} error(s)`,
|
|
351
|
+
summary: `system.outbox.scan: ${proposals.length} proposal(s), ${pinBumps.length} pin-bump proposal(s), ${created.length} task(s) created, ${errors} error(s)`,
|
|
308
352
|
nextSteps:
|
|
309
353
|
proposals.length > 0
|
|
310
354
|
? [
|
|
@@ -132,7 +132,12 @@ export async function createTask(
|
|
|
132
132
|
},
|
|
133
133
|
],
|
|
134
134
|
};
|
|
135
|
-
|
|
135
|
+
// Reported file list uses forward slashes — consumers suffix-match the
|
|
136
|
+
// repo-relative tail (queue/briefs/T-….md) on every platform.
|
|
137
|
+
return {
|
|
138
|
+
task,
|
|
139
|
+
files: [taskFilePath(root, id), briefFilePath(root, id)].map((f) => f.replace(/\\/g, "/")),
|
|
140
|
+
};
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
/** Write a task created by createTask plus its brief scaffold. */
|