@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
|
@@ -6,7 +6,25 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-
|
|
9
|
+
<item>RFC-1517: add preflight-extract-gates — FLOW-PUB-01 changelog check at ref plus shared PKG-HEALTH-10 fixture-path scan for RFC-1517</item>
|
|
10
|
+
<item>RFC-1517: make pkg-health-10 shipped-set faithful and scan the publish ref</item>
|
|
11
|
+
<item>RFC-1518: docs-drift gate PKG-HEALTH-11/12 in forge.package.health
|
|
12
|
+
|
|
13
|
+
Live-inventory docs gate: PKG-HEALTH-11 flags registered commands absent
|
|
14
|
+
from the package DOCS_SURFACE, PKG-HEALTH-12 flags dead x.y doc tokens.
|
|
15
|
+
loadCommandInventory unions the runtime registry with the generated
|
|
16
|
+
command manifest (getLiveCommands precedent); namespace + TLD-tail
|
|
17
|
+
resolution keep property paths and domains silent. Same-line
|
|
18
|
+
pkg-health-11/12 markers journal intentional exceptions.
|
|
19
|
+
|
|
20
|
+
Audit diff to land green: canonical forge.* names in forge docs,
|
|
21
|
+
leitstand.access.* expansions, registered-surface listings for
|
|
22
|
+
projektarchiv-operations/werkstatt-journal/werkstatt-engine, and 100+
|
|
23
|
+
journaled suppressions for code paths, family prefixes, and the planned
|
|
24
|
+
werkstatt-knowledge CLI surface.</item>
|
|
25
|
+
<item>RFC-1518: attribution merge, private-package docs gate, suppression journal</item>
|
|
26
|
+
<item>RFC-1518: provider-aware module attribution, per-rule markers, tld-tail scoping</item>
|
|
27
|
+
<history>RFC-1311</history>
|
|
10
28
|
</CHANGE_SUMMARY>
|
|
11
29
|
*/
|
|
12
30
|
|
|
@@ -15,7 +33,11 @@ import { join } from "node:path";
|
|
|
15
33
|
import { writeFileSync, mkdirSync, rmSync } from "node:fs";
|
|
16
34
|
import { tmpdir } from "node:os";
|
|
17
35
|
import type { ForgeCommandInput, ForgeRuntimeContext } from "../../../src/types.ts";
|
|
18
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
deriveShippedFiles,
|
|
38
|
+
runPackageHealth,
|
|
39
|
+
scanFixturePathEscapes,
|
|
40
|
+
} from "./package-health.ts";
|
|
19
41
|
|
|
20
42
|
function makeContext(workspaceRoot: string): ForgeRuntimeContext {
|
|
21
43
|
return {
|
|
@@ -96,7 +118,8 @@ test("passes when all published packages are healthy", async () => {
|
|
|
96
118
|
expect(result.exitCode).toBe(0);
|
|
97
119
|
expect(result.data?.passed).toBe(true);
|
|
98
120
|
expect(result.data?.packagesChecked).toBe(1);
|
|
99
|
-
|
|
121
|
+
// The empty-inventory PKG-HEALTH-12 warning is expected — no manifest, no registry.
|
|
122
|
+
expect(result.data?.violations.filter((v) => v.severity === "error")).toHaveLength(0);
|
|
100
123
|
});
|
|
101
124
|
|
|
102
125
|
test("skips private packages", async () => {
|
|
@@ -495,7 +518,122 @@ test('"extractable": false suppresses extract-dependent checks', async () => {
|
|
|
495
518
|
detail: "",
|
|
496
519
|
}));
|
|
497
520
|
expect(result.exitCode).toBe(0);
|
|
498
|
-
expect(result.data?.violations).toHaveLength(0);
|
|
521
|
+
expect(result.data?.violations.filter((v) => v.severity === "error")).toHaveLength(0);
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
test("reports PKG-HEALTH-10 at file:line when a shipped file's ../ literal escapes the package root (AC-2)", async () => {
|
|
525
|
+
writePkgJson(tmpDir, {
|
|
526
|
+
name: "test-workspace",
|
|
527
|
+
private: true,
|
|
528
|
+
engines: { node: ">=24 <25" },
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
const pkgDir = join(tmpDir, "packages", "escaping");
|
|
532
|
+
mkdirSync(join(pkgDir, "src", "tests"), { recursive: true });
|
|
533
|
+
writePkgJson(pkgDir, {
|
|
534
|
+
name: "@test/escaping",
|
|
535
|
+
version: "1.0.0",
|
|
536
|
+
private: false,
|
|
537
|
+
type: "module",
|
|
538
|
+
engines: { node: ">=24 <25" },
|
|
539
|
+
scripts: {
|
|
540
|
+
build: "tsc",
|
|
541
|
+
lint: "eslint src",
|
|
542
|
+
typecheck: "tsc --noEmit",
|
|
543
|
+
test: "vitest run",
|
|
544
|
+
},
|
|
545
|
+
devDependencies: { eslint: "^9.0.0", typescript: "^5.0.0", vitest: "^4.0.0" },
|
|
546
|
+
});
|
|
547
|
+
writeFileSync(join(pkgDir, "extract.config.yaml"), "source: .\n");
|
|
548
|
+
writeFileSync(
|
|
549
|
+
join(pkgDir, "src", "tests", "fixture.test.ts"),
|
|
550
|
+
'const fixture = "../../../docs/rfcs/rfc-0000-template.md";\nexport { fixture };\n',
|
|
551
|
+
);
|
|
552
|
+
|
|
553
|
+
const result = await runPackageHealth(makeInput(), makeContext(tmpDir), () => ({
|
|
554
|
+
ok: true,
|
|
555
|
+
detail: "",
|
|
556
|
+
}));
|
|
557
|
+
const v10 = result.data?.violations.find((v) => v.ruleId === "PKG-HEALTH-10");
|
|
558
|
+
expect(v10).toBeDefined();
|
|
559
|
+
expect(v10?.severity).toBe("error");
|
|
560
|
+
expect(v10?.message).toContain("src/tests/fixture.test.ts:1");
|
|
561
|
+
expect(v10?.message).toContain("../../../docs/rfcs/rfc-0000-template.md");
|
|
562
|
+
expect(result.data?.passed).toBe(false);
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
test("a ../ literal resolving inside the package root is not flagged (AC-4)", async () => {
|
|
566
|
+
writePkgJson(tmpDir, {
|
|
567
|
+
name: "test-workspace",
|
|
568
|
+
private: true,
|
|
569
|
+
engines: { node: ">=24 <25" },
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
const pkgDir = join(tmpDir, "packages", "inside-root");
|
|
573
|
+
mkdirSync(join(pkgDir, "src", "deep"), { recursive: true });
|
|
574
|
+
writePkgJson(pkgDir, {
|
|
575
|
+
name: "@test/inside-root",
|
|
576
|
+
version: "1.0.0",
|
|
577
|
+
private: false,
|
|
578
|
+
type: "module",
|
|
579
|
+
engines: { node: ">=24 <25" },
|
|
580
|
+
scripts: {},
|
|
581
|
+
});
|
|
582
|
+
writeFileSync(join(pkgDir, "extract.config.yaml"), "source: .\n");
|
|
583
|
+
// sibling module import — resolves inside the package root, must not flag.
|
|
584
|
+
writeFileSync(join(pkgDir, "src", "deep", "mod.ts"), 'export { x } from "../mod.ts";\n');
|
|
585
|
+
writeFileSync(join(pkgDir, "src", "mod.ts"), "export const x = 1;\n");
|
|
586
|
+
|
|
587
|
+
const result = await runPackageHealth(makeInput(), makeContext(tmpDir), () => ({
|
|
588
|
+
ok: true,
|
|
589
|
+
detail: "",
|
|
590
|
+
}));
|
|
591
|
+
expect(
|
|
592
|
+
result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-10"),
|
|
593
|
+
).toHaveLength(0);
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
test("scanFixturePathEscapes honors suppression, raw-mode, and per-extension modes", () => {
|
|
597
|
+
const pkgDir = join(tmpDir, "packages", "scan");
|
|
598
|
+
mkdirSync(join(pkgDir, "sub"), { recursive: true });
|
|
599
|
+
// suppression comment escapes a justified non-path use.
|
|
600
|
+
writeFileSync(
|
|
601
|
+
join(pkgDir, "suppressed.ts"),
|
|
602
|
+
'const s = "../../outside.md"; // pkg-health-10: prose example, not a path\n',
|
|
603
|
+
);
|
|
604
|
+
// non-doc non-ts files get the raw scan — unquoted ../ chains still flag.
|
|
605
|
+
writeFileSync(join(pkgDir, "notes.yaml"), "see: ../../../outside.md\n");
|
|
606
|
+
// a ../ inside a comment does not flag in ts files (literal-aware mode).
|
|
607
|
+
writeFileSync(join(pkgDir, "sub", "noted.ts"), "// resolves ../../outside.md\nexport {};\n"); // pkg-health-10: fixture string exercises the unsuppressed path
|
|
608
|
+
// doc files are exempt — prose links are never resolved.
|
|
609
|
+
writeFileSync(join(pkgDir, "README.md"), "see ../../../outside.md for details\n");
|
|
610
|
+
|
|
611
|
+
const escapes = scanFixturePathEscapes(pkgDir, [
|
|
612
|
+
"suppressed.ts",
|
|
613
|
+
"notes.yaml",
|
|
614
|
+
"README.md",
|
|
615
|
+
"sub/noted.ts",
|
|
616
|
+
]);
|
|
617
|
+
expect(escapes).toHaveLength(1);
|
|
618
|
+
expect(escapes[0]?.file).toBe("notes.yaml");
|
|
619
|
+
expect(escapes[0]?.line).toBe(1);
|
|
620
|
+
expect(escapes[0]?.literal).toContain("../");
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
test("deriveShippedFiles applies ignoreDirs, excludePathSegments, and excludeExtensions", () => {
|
|
624
|
+
const pkgDir = join(tmpDir, "packages", "derive");
|
|
625
|
+
mkdirSync(join(pkgDir, "src", "tests"), { recursive: true });
|
|
626
|
+
mkdirSync(join(pkgDir, "node_modules", "dep"), { recursive: true });
|
|
627
|
+
writeFileSync(join(pkgDir, "src", "index.ts"), "export {};\n");
|
|
628
|
+
writeFileSync(join(pkgDir, "src", "tests", "x.test.ts"), "export {};\n");
|
|
629
|
+
writeFileSync(join(pkgDir, "src", "cache.db"), "db\n");
|
|
630
|
+
writeFileSync(join(pkgDir, "src", "out.tsbuildinfo"), "{}\n");
|
|
631
|
+
writeFileSync(join(pkgDir, "node_modules", "dep", "index.js"), "\n");
|
|
632
|
+
|
|
633
|
+
const config =
|
|
634
|
+
"ignoreDirs:\n - .turbo\nexcludePathSegments:\n - src/tests\nexcludeExtensions:\n - .db\n";
|
|
635
|
+
const shipped = deriveShippedFiles(pkgDir, config);
|
|
636
|
+
expect(shipped).toEqual(["src/index.ts"]);
|
|
499
637
|
});
|
|
500
638
|
|
|
501
639
|
test("handles no packages/ directory gracefully", async () => {
|
|
@@ -509,3 +647,279 @@ test("handles no packages/ directory gracefully", async () => {
|
|
|
509
647
|
expect(result.data?.packagesChecked).toBe(0);
|
|
510
648
|
expect(result.data?.passed).toBe(true);
|
|
511
649
|
});
|
|
650
|
+
|
|
651
|
+
// ---------------------------------------------------------------------------
|
|
652
|
+
// RFC-1518: docs drift gate — PKG-HEALTH-11 coverage + PKG-HEALTH-12 dead refs
|
|
653
|
+
// ---------------------------------------------------------------------------
|
|
654
|
+
|
|
655
|
+
function makeRegistryContext(workspaceRoot: string, commands: { name: string; module: string }[]): ForgeRuntimeContext {
|
|
656
|
+
return {
|
|
657
|
+
...makeContext(workspaceRoot),
|
|
658
|
+
commandRegistry: {
|
|
659
|
+
listCommandNames: () => commands.map((c) => c.name),
|
|
660
|
+
listCommands: () => commands.map((c) => ({ name: c.name, module: c.module, provider: "workspace" as const, description: "", scope: "workspace" as const })),
|
|
661
|
+
getCommand: () => undefined,
|
|
662
|
+
},
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function seedDocsPkg(opts: { name?: string; docs?: Record<string, string>; readme?: string; agents?: string } = {}) {
|
|
667
|
+
const pkgDir = join(tmpDir, "packages", "lib");
|
|
668
|
+
mkdirSync(join(pkgDir, "docs", "reference"), { recursive: true });
|
|
669
|
+
writePkgJson(pkgDir, { name: opts.name ?? "@warpgogol/lib", version: "1.0.0", engines: { node: ">=20" } });
|
|
670
|
+
for (const [rel, content] of Object.entries(opts.docs ?? {})) {
|
|
671
|
+
const abs = join(pkgDir, "docs", rel);
|
|
672
|
+
mkdirSync(join(abs, ".."), { recursive: true });
|
|
673
|
+
writeFileSync(abs, content);
|
|
674
|
+
}
|
|
675
|
+
if (opts.readme !== undefined) writeFileSync(join(pkgDir, "README.md"), opts.readme);
|
|
676
|
+
if (opts.agents !== undefined) writeFileSync(join(pkgDir, "AGENTS.md"), opts.agents);
|
|
677
|
+
// kernel.config.ts attributing the "lib-mod" module to packages/lib
|
|
678
|
+
mkdirSync(join(tmpDir, "tools"), { recursive: true });
|
|
679
|
+
writeFileSync(
|
|
680
|
+
join(tmpDir, "tools", "kernel.config.ts"),
|
|
681
|
+
'export default { moduleLoaders: { "lib-mod": async () => (await import("@warpgogol/lib/kernel")).m } };\n',
|
|
682
|
+
);
|
|
683
|
+
return pkgDir;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
test("PKG-HEALTH-11: a registered command absent from the docs surface errors naming token + reference doc (AC-1)", async () => {
|
|
687
|
+
seedDocsPkg({ docs: { "reference/cli.md": "# CLI\n\n`lib.alpha` does a thing.\n" } });
|
|
688
|
+
const ctx = makeRegistryContext(tmpDir, [
|
|
689
|
+
{ name: "lib.alpha", module: "lib-mod" },
|
|
690
|
+
{ name: "lib.beta", module: "lib-mod" },
|
|
691
|
+
]);
|
|
692
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
693
|
+
const v11 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-11") ?? [];
|
|
694
|
+
expect(v11).toHaveLength(1);
|
|
695
|
+
expect(v11[0]?.message).toContain("lib.beta");
|
|
696
|
+
expect(v11[0]?.message).toContain("docs/reference/cli.md");
|
|
697
|
+
expect(v11[0]?.severity).toBe("error");
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
test("PKG-HEALTH-12: a doc token resolving to no registered command errors at doc:line; versions and config paths stay silent (AC-3)", async () => {
|
|
701
|
+
seedDocsPkg({
|
|
702
|
+
docs: {
|
|
703
|
+
"guide.md": "# Guide\n\nRun `lib.retired` first, then check `9.1.0` and `extract.config.yaml`.\n",
|
|
704
|
+
},
|
|
705
|
+
});
|
|
706
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
707
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
708
|
+
const v12 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-12") ?? [];
|
|
709
|
+
expect(v12).toHaveLength(1);
|
|
710
|
+
expect(v12[0]?.message).toContain("docs/guide.md:3");
|
|
711
|
+
expect(v12[0]?.message).toContain("lib.retired");
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
test("pkg-health-11/pkg-health-12 markers skip the line and journal the suppression (AC-4)", async () => {
|
|
715
|
+
seedDocsPkg({
|
|
716
|
+
docs: {
|
|
717
|
+
"reference/cli.md":
|
|
718
|
+
"# CLI\n\nlib.beta <!-- pkg-health-11: internal plumbing, not operator-facing -->\n\nUse `lib.retired`. <!-- pkg-health-12: historical narrative of the retired flow -->\n",
|
|
719
|
+
},
|
|
720
|
+
});
|
|
721
|
+
const ctx = makeRegistryContext(tmpDir, [
|
|
722
|
+
{ name: "lib.alpha", module: "lib-mod" },
|
|
723
|
+
{ name: "lib.beta", module: "lib-mod" },
|
|
724
|
+
]);
|
|
725
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
726
|
+
const docs = result.data?.violations.filter((v) => v.ruleId.startsWith("PKG-HEALTH-1")) ?? [];
|
|
727
|
+
// lib.alpha uncovered (PKG-HEALTH-11); lib.beta suppressed; lib.retired suppressed.
|
|
728
|
+
expect(docs).toHaveLength(1);
|
|
729
|
+
expect(docs[0]?.message).toContain("lib.alpha");
|
|
730
|
+
const sup = result.data?.suppressions ?? [];
|
|
731
|
+
expect(sup.some((s) => s.ruleId === "PKG-HEALTH-11" && s.token === "lib.beta")).toBe(true);
|
|
732
|
+
expect(sup.some((s) => s.ruleId === "PKG-HEALTH-12" && s.token === "lib.retired")).toBe(true);
|
|
733
|
+
expect(sup[0]?.reason.length).toBeGreaterThan(0);
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
test("excluded surfaces (CHANGELOG, generated, audit archive) are never scanned (AC-5)", async () => {
|
|
737
|
+
const pkgDir = seedDocsPkg({ docs: {} });
|
|
738
|
+
writeFileSync(join(pkgDir, "CHANGELOG.md"), "# Changes\n\n## [9.9.9]\n\n- mentions `lib.retired`\n");
|
|
739
|
+
mkdirSync(join(pkgDir, "docs", "audits", "archive"), { recursive: true });
|
|
740
|
+
writeFileSync(join(pkgDir, "docs", "audits", "archive", "old.md"), "`lib.retired` history\n");
|
|
741
|
+
writeFileSync(join(pkgDir, "docs", "status.generated.md"), "`lib.retired` generated\n");
|
|
742
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
743
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
744
|
+
const v12 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-12") ?? [];
|
|
745
|
+
expect(v12).toHaveLength(0);
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
// r1 review fixes: manifest/registry merge, private-package semantics,
|
|
749
|
+
// unquoted module-map keys, suppression journal shape.
|
|
750
|
+
|
|
751
|
+
test("registry entry without module preserves manifest module provenance (r1)", async () => {
|
|
752
|
+
seedDocsPkg({ docs: {} });
|
|
753
|
+
mkdirSync(join(tmpDir, "docs"), { recursive: true });
|
|
754
|
+
writeFileSync(
|
|
755
|
+
join(tmpDir, "docs", "command-manifest.generated.yaml"),
|
|
756
|
+
"commands:\n - name: lib.alpha\n module: lib-mod\n - name: lib.beta\n module: lib-mod\n",
|
|
757
|
+
);
|
|
758
|
+
// Standalone CLI registry shape: entries may omit module entirely.
|
|
759
|
+
const ctx: ForgeRuntimeContext = {
|
|
760
|
+
...makeContext(tmpDir),
|
|
761
|
+
commandRegistry: {
|
|
762
|
+
listCommandNames: () => ["lib.alpha"],
|
|
763
|
+
listCommands: () => [{ name: "lib.alpha", provider: "workspace" as const, description: "", scope: "workspace" as const }],
|
|
764
|
+
getCommand: () => undefined,
|
|
765
|
+
},
|
|
766
|
+
};
|
|
767
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
768
|
+
const v11 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-11") ?? [];
|
|
769
|
+
// Both manifest commands attribute to packages/lib; neither is documented.
|
|
770
|
+
expect(v11).toHaveLength(2);
|
|
771
|
+
expect(v11.map((v) => v.message).join()).toContain("lib.alpha");
|
|
772
|
+
expect(v11.map((v) => v.message).join()).toContain("lib.beta");
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
test("private package docs: PKG-HEALTH-12 still fires, PKG-HEALTH-11 stays silent (r1, D-003)", async () => {
|
|
776
|
+
const pkgDir = join(tmpDir, "packages", "priv");
|
|
777
|
+
mkdirSync(join(pkgDir, "docs"), { recursive: true });
|
|
778
|
+
writePkgJson(pkgDir, { name: "@warpgogol/priv", version: "1.0.0", private: true });
|
|
779
|
+
writeFileSync(join(pkgDir, "docs", "notes.md"), "run `lib.retired` first\n");
|
|
780
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
781
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
782
|
+
const v11 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-11" && v.packageName === "@warpgogol/priv") ?? [];
|
|
783
|
+
const v12 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-12" && v.packageName === "@warpgogol/priv") ?? [];
|
|
784
|
+
expect(v11).toHaveLength(0);
|
|
785
|
+
expect(v12).toHaveLength(1);
|
|
786
|
+
expect(v12[0]?.message).toContain("lib.retired");
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
test("unquoted module-map keys attribute modules to packages (r1)", async () => {
|
|
790
|
+
seedDocsPkg({ docs: {} });
|
|
791
|
+
// seedDocsPkg wrote kernel.config; module-map takes precedence for its keys.
|
|
792
|
+
const mmDir = join(tmpDir, "packages", "werkstatt-engine", "src", "kernel");
|
|
793
|
+
mkdirSync(mmDir, { recursive: true });
|
|
794
|
+
writeFileSync(
|
|
795
|
+
join(mmDir, "module-map.ts"),
|
|
796
|
+
'const ENGINE = "@warpgogol/lib";\nexport const MAP = { lib-mod: engine(ENGINE) };\n',
|
|
797
|
+
);
|
|
798
|
+
mkdirSync(join(tmpDir, "docs"), { recursive: true });
|
|
799
|
+
writeFileSync(
|
|
800
|
+
join(tmpDir, "docs", "command-manifest.generated.yaml"),
|
|
801
|
+
"commands:\n - name: lib.alpha\n module: lib-mod\n",
|
|
802
|
+
);
|
|
803
|
+
const result = await runPackageHealth(makeInput(), makeContext(tmpDir), () => ({ ok: true, detail: "" }));
|
|
804
|
+
const v11 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-11") ?? [];
|
|
805
|
+
expect(v11).toHaveLength(1);
|
|
806
|
+
expect(v11[0]?.packageName).toBe("@warpgogol/lib");
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
test("suppression journal carries file, line, token, package and clean reason (r1)", async () => {
|
|
810
|
+
seedDocsPkg({
|
|
811
|
+
docs: {
|
|
812
|
+
"reference/cli.md": "Use `lib.retired`. <!-- pkg-health-12: retired command family -->\n",
|
|
813
|
+
},
|
|
814
|
+
});
|
|
815
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
816
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
817
|
+
const sup = (result.data?.suppressions ?? []).find((s) => s.token === "lib.retired");
|
|
818
|
+
expect(sup).toBeDefined();
|
|
819
|
+
expect(sup?.file).toContain("docs/reference/cli.md");
|
|
820
|
+
expect(sup?.line).toBe(1);
|
|
821
|
+
expect(sup?.packageName).toBe("@warpgogol/lib");
|
|
822
|
+
expect(sup?.reason).toBe("retired command family");
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
// r2 review fixes: cross-bucket module collisions, cross-rule independence,
|
|
826
|
+
// D-002 filter pinning, unattributed-inventory warning, journal sort.
|
|
827
|
+
|
|
828
|
+
test("siteScope commands resolve via the SITE map; workspace commands via WORKSHOP (r2 collision)", async () => {
|
|
829
|
+
seedDocsPkg({ docs: {} });
|
|
830
|
+
// deploy exists in BOTH buckets — engine(lib) and sitePlugin(sitepkg).
|
|
831
|
+
const mmDir = join(tmpDir, "packages", "werkstatt-engine", "src", "kernel");
|
|
832
|
+
mkdirSync(mmDir, { recursive: true });
|
|
833
|
+
writeFileSync(
|
|
834
|
+
join(mmDir, "module-map.ts"),
|
|
835
|
+
'const ENGINE = "@warpgogol/lib";\nconst SITE = "@warpgogol/sitepkg";\nexport const M = { deploy: engine(ENGINE) };\nexport const S = { deploy: sitePlugin(SITE) };\n',
|
|
836
|
+
);
|
|
837
|
+
// A private site package so its 11-skip can be observed.
|
|
838
|
+
const siteDir = join(tmpDir, "packages", "sitepkg");
|
|
839
|
+
mkdirSync(siteDir, { recursive: true });
|
|
840
|
+
writePkgJson(siteDir, { name: "@warpgogol/sitepkg", version: "1.0.0", private: true });
|
|
841
|
+
mkdirSync(join(tmpDir, "docs"), { recursive: true });
|
|
842
|
+
writeFileSync(
|
|
843
|
+
join(tmpDir, "docs", "command-manifest.generated.yaml"),
|
|
844
|
+
"commands:\n - name: deploy.artifact.build\n module: deploy\n siteScope: false\n - name: client.export\n module: deploy\n siteScope: true\n",
|
|
845
|
+
);
|
|
846
|
+
const result = await runPackageHealth(makeInput(), makeContext(tmpDir), () => ({ ok: true, detail: "" }));
|
|
847
|
+
const v11 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-11") ?? [];
|
|
848
|
+
// Workshop deploy.artifact.build attributes to @warpgogol/lib and is uncovered.
|
|
849
|
+
expect(v11.some((v) => v.packageName === "@warpgogol/lib" && v.message.includes("deploy.artifact.build"))).toBe(true);
|
|
850
|
+
// Site-scope client.export attributes to the private sitepkg — never to lib.
|
|
851
|
+
expect(v11.some((v) => v.message.includes("client.export"))).toBe(false);
|
|
852
|
+
});
|
|
853
|
+
|
|
854
|
+
test("markers are per-rule: 11-marked dead token still fires 12; 12-marked command keeps coverage (r2)", async () => {
|
|
855
|
+
seedDocsPkg({
|
|
856
|
+
docs: {
|
|
857
|
+
"reference/cli.md":
|
|
858
|
+
"lib.dead <!-- pkg-health-11: family shorthand -->\n\nlib.alpha <!-- pkg-health-12: narrative -->\n",
|
|
859
|
+
},
|
|
860
|
+
});
|
|
861
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
862
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
863
|
+
const v11 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-11") ?? [];
|
|
864
|
+
const v12 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-12") ?? [];
|
|
865
|
+
// lib.alpha documented despite the 12 marker → no coverage error.
|
|
866
|
+
expect(v11.filter((v) => v.message.includes("lib.alpha"))).toHaveLength(0);
|
|
867
|
+
// lib.dead is a dead ref despite the 11 marker → fires 12.
|
|
868
|
+
expect(v12.some((v) => v.message.includes("lib.dead"))).toBe(true);
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
test("unregistered-namespace and TLD-tail property tokens stay silent (r2, D-002)", async () => {
|
|
872
|
+
seedDocsPkg({
|
|
873
|
+
docs: {
|
|
874
|
+
"guide.md": "set `zzz.foo` and `context.io` paths; `deploy.smoke.run` is retired.\n",
|
|
875
|
+
},
|
|
876
|
+
});
|
|
877
|
+
const ctx = makeRegistryContext(tmpDir, [
|
|
878
|
+
{ name: "lib.alpha", module: "lib-mod" },
|
|
879
|
+
{ name: "deploy.artifact.build", module: "lib-mod" },
|
|
880
|
+
{ name: "context.index.build", module: "lib-mod" },
|
|
881
|
+
]);
|
|
882
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
883
|
+
const v12 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-12") ?? [];
|
|
884
|
+
const msgs = v12.map((v) => v.message).join("\n");
|
|
885
|
+
expect(msgs).not.toContain("zzz.foo");
|
|
886
|
+
// context.io: 2-segment unregistered TLD tail under a live namespace → silent.
|
|
887
|
+
expect(msgs).not.toContain("context.io");
|
|
888
|
+
// deploy.smoke.run: 3-segment under live namespace → dead ref still caught.
|
|
889
|
+
expect(msgs).toContain("deploy.smoke.run");
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
test("zero attribution warns that PKG-HEALTH-11 is inert (r2)", async () => {
|
|
893
|
+
seedDocsPkg({ docs: {} });
|
|
894
|
+
// Commands exist but their modules map to nothing (no module-map, empty
|
|
895
|
+
// kernel.config attribution for these names).
|
|
896
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "ghost.cmd", module: "nowhere" }]);
|
|
897
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
898
|
+
const warn = result.data?.violations.find((v) => v.message.includes("resolved to no package"));
|
|
899
|
+
expect(warn).toBeDefined();
|
|
900
|
+
expect(warn?.severity).toBe("warning");
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
test("empty reason does not suppress (r2)", async () => {
|
|
904
|
+
seedDocsPkg({
|
|
905
|
+
docs: { "guide.md": "run `lib.retired` <!-- pkg-health-12: -->\n" },
|
|
906
|
+
});
|
|
907
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
908
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
909
|
+
const v12 = result.data?.violations.filter((v) => v.ruleId === "PKG-HEALTH-12") ?? [];
|
|
910
|
+
expect(v12.some((v) => v.message.includes("lib.retired"))).toBe(true);
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
test("suppression journal sorts by package, file, line (r2)", async () => {
|
|
914
|
+
seedDocsPkg({
|
|
915
|
+
docs: {
|
|
916
|
+
"b.md": "`lib.gone` <!-- pkg-health-12: removed -->\n",
|
|
917
|
+
"a.md": "`lib.dead` <!-- pkg-health-12: removed -->\n`lib.dead2` <!-- pkg-health-12: removed -->\n",
|
|
918
|
+
},
|
|
919
|
+
});
|
|
920
|
+
const ctx = makeRegistryContext(tmpDir, [{ name: "lib.alpha", module: "lib-mod" }]);
|
|
921
|
+
const result = await runPackageHealth(makeInput(), ctx, () => ({ ok: true, detail: "" }));
|
|
922
|
+
const files = (result.data?.suppressions ?? []).map((s) => s.file);
|
|
923
|
+
const sorted = [...files].sort();
|
|
924
|
+
expect(files).toEqual(sorted);
|
|
925
|
+
});
|