@warpgogol/forge 9.3.1 → 9.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +32 -0
- package/CHANGELOG.md +40 -0
- package/README.md +6 -4
- package/README.uk.md +10 -8
- package/bin/cli.ts +4 -4
- package/dist/bin/cli.js +4 -4
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
- package/dist/os/adr/handlers/list-create.js +23 -2
- package/dist/os/adr/handlers/list-create.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/adr/types.js +2 -2
- package/dist/os/adr/types.js.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +2 -0
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +7 -2
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +24 -14
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/conformance/conformance.module.d.ts.map +1 -1
- package/dist/os/conformance/conformance.module.js +21 -4
- package/dist/os/conformance/conformance.module.js.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.js +64 -8
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
- package/dist/os/core/archive-regen.d.ts +99 -0
- package/dist/os/core/archive-regen.d.ts.map +1 -0
- package/dist/os/core/archive-regen.js +220 -0
- package/dist/os/core/archive-regen.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +159 -18
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +8 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/package-health.d.ts +130 -0
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +548 -7
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +5 -2
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +3 -1
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dirty-classify.d.ts +51 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -0
- package/dist/os/flow/dirty-classify.js +83 -0
- package/dist/os/flow/dirty-classify.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +110 -19
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/gate-engine.d.ts +13 -0
- package/dist/os/flow/gate-engine.d.ts.map +1 -0
- package/dist/os/flow/gate-engine.js +32 -0
- package/dist/os/flow/gate-engine.js.map +1 -0
- package/dist/os/flow/git.d.ts +45 -4
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +95 -27
- package/dist/os/flow/git.js.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.js +12 -5
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +25 -3
- package/dist/os/flow/handlers/flow-check.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +75 -38
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +33 -5
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +13 -10
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-hold.js +13 -7
- package/dist/os/flow/handlers/flow-hold.js.map +1 -1
- package/dist/os/flow/handlers/flow-install.d.ts +2 -1
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-install.js +56 -13
- package/dist/os/flow/handlers/flow-install.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +54 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +614 -65
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts +14 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +117 -12
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
- package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-peers.js +99 -0
- package/dist/os/flow/handlers/flow-peers.js.map +1 -0
- package/dist/os/flow/handlers/flow-status.d.ts +13 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-status.js +35 -14
- package/dist/os/flow/handlers/flow-status.js.map +1 -1
- package/dist/os/flow/index.d.ts +3 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +7 -2
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/line-version.d.ts.map +1 -1
- package/dist/os/flow/line-version.js +2 -1
- package/dist/os/flow/line-version.js.map +1 -1
- package/dist/os/flow/locks.d.ts +37 -1
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +34 -14
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/ops-registry.d.ts +33 -0
- package/dist/os/flow/ops-registry.d.ts.map +1 -0
- package/dist/os/flow/ops-registry.js +177 -0
- package/dist/os/flow/ops-registry.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +157 -0
- package/dist/os/flow/preflight.d.ts.map +1 -0
- package/dist/os/flow/preflight.js +772 -0
- package/dist/os/flow/preflight.js.map +1 -0
- package/dist/os/flow/publish.d.ts +7 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +165 -3
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +26 -1
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +27 -6
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/scripts.d.ts +4 -0
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +8 -2
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/session-checkout.d.ts +33 -0
- package/dist/os/flow/session-checkout.d.ts.map +1 -0
- package/dist/os/flow/session-checkout.js +151 -0
- package/dist/os/flow/session-checkout.js.map +1 -0
- package/dist/os/flow/standalone-invoke.d.ts +11 -0
- package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
- package/dist/os/flow/standalone-invoke.js +75 -0
- package/dist/os/flow/standalone-invoke.js.map +1 -0
- package/dist/os/flow/worktree-path.d.ts.map +1 -1
- package/dist/os/flow/worktree-path.js +9 -3
- package/dist/os/flow/worktree-path.js.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.js +12 -4
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +4 -1
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +12 -8
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/importer-block.d.ts +19 -0
- package/dist/os/mission/importer-block.d.ts.map +1 -0
- package/dist/os/mission/importer-block.js +124 -0
- package/dist/os/mission/importer-block.js.map +1 -0
- package/dist/os/mission/lockfile.d.ts +17 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -1
- package/dist/os/mission/lockfile.js +38 -0
- package/dist/os/mission/lockfile.js.map +1 -1
- package/dist/os/mission/open-missions.d.ts +8 -0
- package/dist/os/mission/open-missions.d.ts.map +1 -0
- package/dist/os/mission/open-missions.js +42 -0
- package/dist/os/mission/open-missions.js.map +1 -0
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +11 -1
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts +14 -0
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +18 -10
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +11 -2
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts +23 -0
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +82 -1
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +16 -3
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +5 -4
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +107 -10
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +77 -5
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +64 -6
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/next-id.d.ts +38 -0
- package/dist/os/rfc/next-id.d.ts.map +1 -0
- package/dist/os/rfc/next-id.js +165 -0
- package/dist/os/rfc/next-id.js.map +1 -0
- package/dist/os/rfc/probe-batch.d.ts.map +1 -1
- package/dist/os/rfc/probe-batch.js +6 -1
- package/dist/os/rfc/probe-batch.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +36 -8
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +42 -6
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +6 -6
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +81 -28
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +47 -0
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +31 -7
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/spec/spec-schema.d.ts +8 -0
- package/dist/os/spec/spec-schema.d.ts.map +1 -1
- package/dist/os/spec/spec-schema.js +1 -0
- package/dist/os/spec/spec-schema.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts +8 -0
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +18 -6
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +62 -15
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +13 -5
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
- package/dist/os/system/handlers/system-map-validate.js +2 -1
- package/dist/os/system/handlers/system-map-validate.js.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.js +54 -6
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-collect.js +11 -5
- package/dist/os/system/handlers/system-task-collect.js.map +1 -1
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-create.js +6 -1
- package/dist/os/system/handlers/system-task-create.js.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.js +246 -6
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
- package/dist/os/system/repo.d.ts +1 -1
- package/dist/os/system/repo.d.ts.map +1 -1
- package/dist/os/system/repo.js +53 -3
- package/dist/os/system/repo.js.map +1 -1
- package/dist/os/system/scenario-schemas.d.ts +109 -3
- package/dist/os/system/scenario-schemas.d.ts.map +1 -1
- package/dist/os/system/scenario-schemas.js +66 -10
- package/dist/os/system/scenario-schemas.js.map +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +69 -17
- package/dist/os/system/system.module.js.map +1 -1
- package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
- package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
- package/dist/os/system/tests/contract-fixtures.js +109 -0
- package/dist/os/system/tests/contract-fixtures.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +54 -18
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +41 -9
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +6 -0
- package/dist/src/conformance/index.d.ts.map +1 -1
- package/dist/src/conformance/index.js +36 -1
- package/dist/src/conformance/index.js.map +1 -1
- package/dist/src/formal/proof-runner.d.ts.map +1 -1
- package/dist/src/formal/proof-runner.js +10 -2
- package/dist/src/formal/proof-runner.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.js +4 -4
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +3 -1
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
- package/dist/src/onboarding/prettierignore.js +2 -0
- package/dist/src/onboarding/prettierignore.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +2 -2
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +14 -2
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +3 -1
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/skill-schema.d.ts +3 -0
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +9 -2
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/spec/resolve-spec-source.d.ts +45 -0
- package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
- package/dist/src/spec/resolve-spec-source.js +153 -0
- package/dist/src/spec/resolve-spec-source.js.map +1 -0
- package/dist/src/utils/command-inventory.d.ts +28 -0
- package/dist/src/utils/command-inventory.d.ts.map +1 -0
- package/dist/src/utils/command-inventory.js +84 -0
- package/dist/src/utils/command-inventory.js.map +1 -0
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +6 -1
- package/dist/src/utils/io.js.map +1 -1
- package/dist/src/utils/repo-path.d.ts +10 -0
- package/dist/src/utils/repo-path.d.ts.map +1 -0
- package/dist/src/utils/repo-path.js +52 -0
- package/dist/src/utils/repo-path.js.map +1 -0
- package/dist/src/utils/spawn.d.ts +23 -0
- package/dist/src/utils/spawn.d.ts.map +1 -0
- package/dist/src/utils/spawn.js +83 -0
- package/dist/src/utils/spawn.js.map +1 -0
- package/docs/branch-model.md +1 -1
- package/docs/guides/existing-project.md +1 -1
- package/docs/maintainers/publishing.md +1 -1
- package/docs/reference/cli.md +8 -2
- package/docs/reference/profiles.md +1 -1
- package/os/adr/handlers/list-create.ts +26 -2
- package/os/adr/types.ts +4 -2
- package/os/compass/handlers/compass-audit-handler.ts +6 -1
- package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
- package/os/compass/handlers/git-revision.ts +8 -2
- package/os/compass/handlers/summary-record.ts +25 -14
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
- package/os/conformance/conformance.module.ts +21 -4
- package/os/conformance/handlers/conformance-validate.ts +108 -16
- package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
- package/os/core/archive-regen.ts +279 -0
- package/os/core/core.module.ts +176 -29
- package/os/core/docs-archive.test.ts +413 -3
- package/os/core/handlers/assets-helpers.ts +8 -3
- package/os/core/handlers/forge-autonomy-validate.ts +3 -1
- package/os/core/handlers/package-health.test.ts +418 -4
- package/os/core/handlers/package-health.ts +629 -7
- package/os/core/handlers/release-prepare.ts +5 -2
- package/os/flow/digest.ts +3 -1
- package/os/flow/dirty-classify.ts +120 -0
- package/os/flow/flow.module.ts +119 -24
- package/os/flow/gate-engine.ts +45 -0
- package/os/flow/git.ts +117 -29
- package/os/flow/handlers/flow-backmerge.ts +14 -4
- package/os/flow/handlers/flow-check.ts +27 -2
- package/os/flow/handlers/flow-cut.ts +124 -56
- package/os/flow/handlers/flow-discard.ts +33 -5
- package/os/flow/handlers/flow-fix.ts +22 -10
- package/os/flow/handlers/flow-hold.ts +20 -7
- package/os/flow/handlers/flow-install.ts +59 -12
- package/os/flow/handlers/flow-integrate.ts +933 -180
- package/os/flow/handlers/flow-open.ts +135 -11
- package/os/flow/handlers/flow-peers.ts +142 -0
- package/os/flow/handlers/flow-status.ts +45 -13
- package/os/flow/index.ts +8 -2
- package/os/flow/line-version.ts +2 -1
- package/os/flow/locks.ts +56 -14
- package/os/flow/ops-registry.ts +194 -0
- package/os/flow/preflight.ts +974 -0
- package/os/flow/publish.ts +200 -5
- package/os/flow/registry.ts +43 -7
- package/os/flow/scripts.ts +13 -2
- package/os/flow/session-checkout.ts +186 -0
- package/os/flow/standalone-invoke.ts +85 -0
- package/os/flow/tests/dirty-classify.test.ts +251 -0
- package/os/flow/tests/fixtures/branch-names.yaml +40 -40
- package/os/flow/tests/flow-cut.test.ts +21 -0
- package/os/flow/tests/flow-discard.test.ts +32 -0
- package/os/flow/tests/flow-guard-parity.test.ts +10 -2
- package/os/flow/tests/flow-install.test.ts +7 -3
- package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +565 -0
- package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
- package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
- package/os/flow/tests/flow-integrate.test.ts +698 -17
- package/os/flow/tests/flow-open.pending.test.ts +277 -0
- package/os/flow/tests/flow-open.test.ts +52 -9
- package/os/flow/tests/flow-push-publish.test.ts +124 -0
- package/os/flow/tests/flow-status.test.ts +31 -1
- package/os/flow/tests/locks.test.ts +39 -3
- package/os/flow/tests/ops-registry.test.ts +136 -0
- package/os/flow/tests/scripts.test.ts +5 -2
- package/os/flow/tests/state-roots.test.ts +8 -5
- package/os/flow/worktree-path.ts +9 -3
- package/os/formal/handlers/proof-check.test.ts +6 -3
- package/os/instructions/budget.test.ts +31 -0
- package/os/instructions/handlers/budget-validate.ts +13 -4
- package/os/instructions/instructions.module.ts +4 -1
- package/os/mission/handlers/archive.ts +22 -14
- package/os/mission/importer-block.ts +119 -0
- package/os/mission/lockfile.ts +41 -0
- package/os/mission/open-missions.ts +50 -0
- package/os/queue/decision-ledger.test.ts +18 -0
- package/os/queue/manifest.ts +17 -1
- package/os/rfc/acceptance.ts +30 -10
- package/os/rfc/decision-log.ts +13 -2
- package/os/rfc/frontmatter-io.ts +89 -1
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
- package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
- package/os/rfc/handlers/implement-stamp.ts +16 -3
- package/os/rfc/handlers/index-graph.ts +5 -4
- package/os/rfc/handlers/lifecycle.test.ts +136 -0
- package/os/rfc/handlers/list-create.test.ts +126 -0
- package/os/rfc/handlers/list-create.ts +130 -10
- package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
- package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
- package/os/rfc/handlers/validate-rules.ts +103 -7
- package/os/rfc/handlers/validate.ts +68 -4
- package/os/rfc/next-id.ts +232 -0
- package/os/rfc/probe-batch.ts +6 -1
- package/os/rfc/rfc.module.ts +41 -8
- package/os/rfc/types.ts +31 -6
- package/os/rfc/verification-emit-freshness.test.ts +5 -1
- package/os/rfc/verification-emit.test.ts +5 -1
- package/os/rfc/verification-evidence.ts +99 -33
- package/os/rfc/verification-origin.ts +59 -0
- package/os/rfc/verification-refresh.test.ts +5 -1
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
- package/os/session/handlers/save.ts +35 -7
- package/os/session/tests/session-save.test.ts +154 -0
- package/os/spec/spec-schema.ts +3 -0
- package/os/spec/spec-status.ts +22 -6
- package/os/spec/spec-validate.package-source.test.ts +187 -0
- package/os/spec/spec-validate.ts +65 -14
- package/os/spec/spec.module.ts +13 -5
- package/os/system/handlers/system-map-validate.ts +4 -2
- package/os/system/handlers/system-outbox-scan.ts +65 -21
- package/os/system/handlers/system-task-collect.ts +11 -5
- package/os/system/handlers/system-task-create.ts +6 -1
- package/os/system/handlers/system-versionset-record.ts +301 -16
- package/os/system/repo.ts +59 -18
- package/os/system/scenario-schemas.ts +91 -12
- package/os/system/system.module.ts +70 -17
- package/os/system/tests/contract-fixtures.ts +139 -0
- package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
- package/os/system/tests/scenario-validator-check.test.ts +96 -0
- package/os/system/tests/system-task-collect.test.ts +16 -0
- package/os/system/tests/system-task-dispatch.test.ts +4 -1
- package/os/system/tests/system-versionset.test.ts +7 -3
- package/os/system/tests/version-set-v2.test.ts +78 -0
- package/package.json +9 -1
- package/skills/fo/fo-doctor/SKILL.md +151 -0
- package/skills/fo/fo-handoff/SKILL.md +22 -0
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
- package/skills/fo/fo-idea-implement/SKILL.md +5 -2
- package/skills/fo/fo-idea-plan/SKILL.md +5 -5
- package/skills/fo/fo-session-retro/SKILL.md +45 -13
- package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
- package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
- package/skills/meta/skill-create/SKILL.md +2 -1
- package/src/bin-entry.test.ts +3 -1
- package/src/config/forge-config.ts +57 -13
- package/src/conformance/index.ts +46 -1
- package/src/formal/proof-runner.ts +10 -2
- package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
- package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
- package/src/onboarding/agents-generate.ts +4 -4
- package/src/onboarding/nested-agents-generate.ts +3 -1
- package/src/onboarding/prettierignore.ts +2 -0
- package/src/onboarding/scaffold-project.ts +2 -2
- package/src/onboarding/upgrade.ts +13 -2
- package/src/onboarding/workspace-discovery.ts +3 -1
- package/src/pipeline-status.test.ts +1 -1
- package/src/skill-schema.ts +9 -2
- package/src/spec/resolve-spec-source.ts +184 -0
- package/src/tests/acceptance-probe-kinds.test.ts +3 -1
- package/src/tests/agents-generate-domain.test.ts +3 -2
- package/src/tests/agents-generate.test.ts +2 -1
- package/src/tests/create-flow.test.ts +3 -1
- package/src/tests/create.test.ts +12 -2
- package/src/tests/editable-generated-region.test.ts +2 -2
- package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
- package/src/tests/implement-stamp.test.ts +5 -2
- package/src/tests/prettierignore-manage.test.ts +11 -0
- package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
- package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
- package/src/tests/scaffold-project.test.ts +3 -1
- package/src/tests/upgrade.test.ts +79 -3
- package/src/tests/workspace-discovery.test.ts +4 -3
- package/src/utils/command-inventory.ts +105 -0
- package/src/utils/io.ts +6 -1
- package/src/utils/repo-path.ts +49 -0
- package/src/utils/spawn.ts +88 -0
- package/src/tests/rfc-evidence-sync.test.ts +0 -369
- package/src/tests/skill-agents-sync.test.ts +0 -192
|
@@ -6,16 +6,448 @@
|
|
|
6
6
|
<item>Do not modify files — read-only validation.</item>
|
|
7
7
|
</non-goals>
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
|
+
<KEY_DECISIONS>
|
|
10
|
+
<item>parseHealthScanConfig + isShippedEntry mirror repo-extract's copy filter through the SAME decision inputs it consumes — real YAML parse (comment-bearing lists survive), isKeyMaterial default excludePathSegments (.input/signing-key, .input/batches) when the key is absent, isDbFile default .db excludeExtensions, copyFiltered's BASE_IGNORE_DIRS/IGNORE_FILES for non-standalone exports, and statSync symlink-following like cp's filter — a hand-maintained list or partial parser drifts from what the extract actually ships (F-0064's whole premise).</item>
|
|
11
|
+
<item>scanFixturePathEscapes judges each candidate via one shared literal core (literalEscapesInLine: TS-family quoted mode, raw `../` chain mode elsewhere, same-line pkg-health-10: suppression) while doc files (prose links are never resolved) and binary/generated files (UTF-8 noise, .map sources) are exempt wholesale; pkgHealth10Suppressions in extract.config.yaml covers files that cannot carry an in-source comment such as JSON (RFC-1517 r1).</item>
|
|
12
|
+
<item>loadCommandInventory unions context.commandRegistry.listCommands() with docs/command-manifest.generated.yaml — the getLiveCommands merge precedent from os/rfc/handlers/lifecycle.ts — because `werkstatt run` injects no commandRegistry and lazy-loaded modules are invisible to it; a registry-only read would silently disable the docs gate on the primary dispatch path (RFC-1518 r1, deviation D-001).</item>
|
|
13
|
+
<item>scanDocsSurface resolves dead-reference candidates through two mechanical disambiguators: first-segment namespace membership (property paths like context.site and config keys like bindings.commands are never command refs) and registered-or-TLD-tail resolution (registered forge.dev/context.index.build count for coverage while unregistered warpgogol.com/context.io are domains, not commands) — without them the gate produced ~230 false positives on the real workspace (RFC-1518 r1, deviation D-002).</item>
|
|
14
|
+
<item>The docs gate runs before the private/extractable skips so PKG-HEALTH-12 dead references judge every package's docs (dead refs are package-local), while PKG-HEALTH-11 coverage stays scoped to published packages — private packages (werkstatt-site's ~500-command surface) document commands in site-facing docs outside DOCS_SURFACE, and the manifest merge preserves manifest module provenance when registry entries omit module (RFC-1518 r1, deviation D-003).</item>
|
|
15
|
+
<item>Module attribution is provider-aware: deriveModulePackageMap returns separate workshop/site maps because module names collide across buckets (deploy is engine() AND sitePlugin()), and each command resolves through the map matching its manifest siteScope — a flat last-write-wins map silently misattributed the engine deploy.* family to the private site package (RFC-1518 r2, deviation D-004).</item>
|
|
16
|
+
</KEY_DECISIONS>
|
|
9
17
|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
<item>RFC-1518: docs-drift gate PKG-HEALTH-11/12 in forge.package.health
|
|
19
|
+
|
|
20
|
+
Live-inventory docs gate: PKG-HEALTH-11 flags registered commands absent
|
|
21
|
+
from the package DOCS_SURFACE, PKG-HEALTH-12 flags dead x.y doc tokens.
|
|
22
|
+
loadCommandInventory unions the runtime registry with the generated
|
|
23
|
+
command manifest (getLiveCommands precedent); namespace + TLD-tail
|
|
24
|
+
resolution keep property paths and domains silent. Same-line
|
|
25
|
+
pkg-health-11/12 markers journal intentional exceptions.
|
|
26
|
+
|
|
27
|
+
Audit diff to land green: canonical forge.* names in forge docs,
|
|
28
|
+
leitstand.access.* expansions, registered-surface listings for
|
|
29
|
+
projektarchiv-operations/werkstatt-journal/werkstatt-engine, and 100+
|
|
30
|
+
journaled suppressions for code paths, family prefixes, and the planned
|
|
31
|
+
werkstatt-knowledge CLI surface.</item>
|
|
32
|
+
<item>RFC-1518: attribution merge, private-package docs gate, suppression journal</item>
|
|
33
|
+
<item>RFC-1518: key decision for private-package docs-gate scope</item>
|
|
34
|
+
<item>RFC-1518: provider-aware module attribution, per-rule markers, tld-tail scoping</item>
|
|
35
|
+
<item>RFC-1518: key decision for provider-aware attribution</item>
|
|
36
|
+
<history>PKG-HEALTH-05, RFC-1097, RFC-1254, RFC-1255, RFC-1517</history>
|
|
15
37
|
</CHANGE_SUMMARY>
|
|
16
38
|
*/
|
|
17
39
|
import * as fs from "../../../src/utils/sync-fs.js";
|
|
18
40
|
import path from "node:path";
|
|
41
|
+
import { parse as parseYaml } from "yaml";
|
|
42
|
+
const DEFAULT_KEY_SEGMENTS = [".input/signing-key", ".input/batches"];
|
|
43
|
+
const BASE_IGNORE_DIRS = new Set(["node_modules", ".turbo", "dist", ".env", ".DS_Store", "Thumbs.db"]);
|
|
44
|
+
const IGNORE_FILES = new Set([
|
|
45
|
+
".env",
|
|
46
|
+
".env.local",
|
|
47
|
+
".env.production",
|
|
48
|
+
".env.production.local",
|
|
49
|
+
"pnpm-lock.yaml",
|
|
50
|
+
"package-lock.json",
|
|
51
|
+
"yarn.lock",
|
|
52
|
+
"changelog.config.yaml",
|
|
53
|
+
]);
|
|
54
|
+
/** Parse the scan-relevant keys of one extract.config.yaml (real YAML — comments and flow style included). */
|
|
55
|
+
export function parseHealthScanConfig(configRaw) {
|
|
56
|
+
let parsed = {};
|
|
57
|
+
if (configRaw !== null) {
|
|
58
|
+
try {
|
|
59
|
+
const doc = parseYaml(configRaw);
|
|
60
|
+
if (doc !== null && typeof doc === "object")
|
|
61
|
+
parsed = doc;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// An unparseable config fails repo-extract itself — scan with defaults.
|
|
65
|
+
parsed = {};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const strList = (key) => {
|
|
69
|
+
const v = parsed[key];
|
|
70
|
+
return Array.isArray(v) ? v.filter((e) => typeof e === "string") : undefined;
|
|
71
|
+
};
|
|
72
|
+
const projectDir = typeof parsed["projectDir"] === "string" ? parsed["projectDir"] : "";
|
|
73
|
+
const standalone = parsed["standalone"] === true || projectDir.startsWith("packages/");
|
|
74
|
+
return {
|
|
75
|
+
ignoreDirs: new Set([
|
|
76
|
+
...(standalone ? ["node_modules", ".turbo"] : [...BASE_IGNORE_DIRS]),
|
|
77
|
+
...(strList("ignoreDirs") ?? []),
|
|
78
|
+
]),
|
|
79
|
+
excludeSegments: strList("excludePathSegments") ?? DEFAULT_KEY_SEGMENTS,
|
|
80
|
+
excludeExtensions: strList("excludeExtensions") ?? [".db"],
|
|
81
|
+
suppressions: new Set(strList("pkgHealth10Suppressions") ?? []),
|
|
82
|
+
monorepoMode: !standalone,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// String-literal-aware mode for TS-family sources; other extensions get the
|
|
86
|
+
// raw `../` chain scan (bounded by root-escape resolution, escaped by the
|
|
87
|
+
// same-line `pkg-health-10:` suppression comment).
|
|
88
|
+
const TS_FAMILY_RE = /\.(?:ts|mts|tsx|cts)$/;
|
|
89
|
+
// Doc files carry `../` only as prose links — never resolved, always noise.
|
|
90
|
+
const DOC_FILE_RE = /\.(?:md|markdown|mdx|txt|adoc|rst)$/i;
|
|
91
|
+
// Binary/generated bytes produce UTF-8 noise (and .map sources arrays) —
|
|
92
|
+
// skipped like git grep -I's binary exclusion.
|
|
93
|
+
const BINARY_FILE_RE = /\.(?:png|jpe?g|gif|webp|ico|icns|woff2?|ttf|otf|eot|zip|gz|tgz|bz2|xz|7z|wasm|pdf|mp[34]|webm|mov|map|db|sqlite)$/i;
|
|
94
|
+
const QUOTED_PARENT_RE = /["'`]([^"'`\n]*(?:\.\.\/)+[^"'`\n]*)["'`]/g;
|
|
95
|
+
const RAW_PARENT_RE = /(?:\.\.\/)+[^\s"'`)\],;:}]*/g;
|
|
96
|
+
const SUPPRESS_RE = /pkg-health-10:/;
|
|
97
|
+
/** File extensions the fixture scan judges (docs and binaries are excluded). */
|
|
98
|
+
export function fixtureScanSkipped(file) {
|
|
99
|
+
return DOC_FILE_RE.test(file) || BINARY_FILE_RE.test(file);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The single `../` literal matcher shared by the working-tree scan and the
|
|
103
|
+
* publish at-ref scan — apply the per-extension mode to one source line and
|
|
104
|
+
* report every literal resolving outside `rootAbs`. Same-line
|
|
105
|
+
* `pkg-health-10:` suppression only (JSON and fixture templates cannot carry
|
|
106
|
+
* comments — those go through the config suppressions list instead).
|
|
107
|
+
*/
|
|
108
|
+
export function literalEscapesInLine(file, text, lineNo, fileDirAbs, rootAbs) {
|
|
109
|
+
if (SUPPRESS_RE.test(text))
|
|
110
|
+
return [];
|
|
111
|
+
const re = TS_FAMILY_RE.test(file) ? QUOTED_PARENT_RE : RAW_PARENT_RE;
|
|
112
|
+
const out = [];
|
|
113
|
+
for (const m of text.matchAll(re)) {
|
|
114
|
+
const literal = m[1] ?? m[0];
|
|
115
|
+
if (!literal.includes("../"))
|
|
116
|
+
continue;
|
|
117
|
+
const resolvedTo = path.resolve(fileDirAbs, literal);
|
|
118
|
+
if (resolvedTo !== rootAbs && !resolvedTo.startsWith(rootAbs + path.sep)) {
|
|
119
|
+
out.push({ file, line: lineNo, literal, resolvedTo });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Scan shipped files for `../` path literals that resolve outside
|
|
126
|
+
* `packageRoot` — the fixture-path defect class that passed monorepo suites
|
|
127
|
+
* and ENOENT'd only inside the standalone extract (F-0064). `shippedFiles`
|
|
128
|
+
* are package-root-relative paths on disk; `suppressions` (from
|
|
129
|
+
* `pkgHealth10Suppressions` in extract.config.yaml) skips files that cannot
|
|
130
|
+
* carry an in-source comment. Shared by PKG-HEALTH-10 and the publish
|
|
131
|
+
* `preflight-extract-gates` step so both report the same escapes.
|
|
132
|
+
*/
|
|
133
|
+
export function scanFixturePathEscapes(packageRoot, shippedFiles, suppressions) {
|
|
134
|
+
const root = path.resolve(packageRoot);
|
|
135
|
+
const escapes = [];
|
|
136
|
+
for (const file of shippedFiles) {
|
|
137
|
+
if (suppressions?.has(file) || fixtureScanSkipped(file))
|
|
138
|
+
continue;
|
|
139
|
+
const abs = path.join(root, file);
|
|
140
|
+
let source;
|
|
141
|
+
try {
|
|
142
|
+
source = fs.readFileSync(abs, "utf8");
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const lines = source.split("\n");
|
|
148
|
+
for (let i = 0; i < lines.length; i++) {
|
|
149
|
+
escapes.push(...literalEscapesInLine(file, lines[i], i + 1, path.dirname(abs), root));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return escapes.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line);
|
|
153
|
+
}
|
|
154
|
+
// RFC-1518 CHECKS 11/12: the package's declared docs surface diffed against
|
|
155
|
+
// the live command inventory — PKG-HEALTH-11 covers registered-but-undocumented
|
|
156
|
+
// commands, PKG-HEALTH-12 covers doc tokens resolving to no registered command
|
|
157
|
+
// (the REMEDIATION-04 dead-token class applied to authored reference docs).
|
|
158
|
+
export const DOCS_SURFACE = ["docs/**/*.md", "README.md", "AGENTS.md"];
|
|
159
|
+
export const DOCS_SURFACE_EXCLUDES = [
|
|
160
|
+
"docs/audits/archive/**",
|
|
161
|
+
"**/CHANGELOG.md",
|
|
162
|
+
"**/*.generated.md",
|
|
163
|
+
];
|
|
164
|
+
const DOCS_SURFACE_EXCLUDE_RES = [
|
|
165
|
+
/(^|\/)docs\/audits\/archive\//,
|
|
166
|
+
/(^|\/)CHANGELOG\.md$/,
|
|
167
|
+
/\.generated\.md$/,
|
|
168
|
+
];
|
|
169
|
+
// A command token is x.y-shaped with every segment starting with a letter —
|
|
170
|
+
// numeric segments (versions like 9.1.0) and uppercase names (AGENTS.md)
|
|
171
|
+
// never qualify. Tokens ending in a file extension or common TLD are config
|
|
172
|
+
// paths or domains, not command mentions (known non-command dotted paths).
|
|
173
|
+
const DOC_TOKEN_RE = /\b([a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+)\b/g;
|
|
174
|
+
// File-extension tails — applied unconditionally (a command never ends in one).
|
|
175
|
+
const DOC_REF_EXT_RE = /\.(?:ts|mts|cts|js|mjs|cjs|jsx|tsx|json|ya?ml|toml|md|mdx|markdown|astro|css|scss|less|html|xml|svg|png|jpe?g|gif|webp|ico|icns|woff2?|ttf|otf|eot|zip|gz|tgz|bz2|xz|7z|wasm|pdf|mp[34]|webm|mov|map|db|sqlite3?|lock|sh|bash|zsh|fish|py|rb|go|rs|java|kt|cs|php|pl|lua|sql|csv|tsv|txt|log|env|ini|cfg|conf|d.ts|editorconfig|gitignore|npmrc|dockerfile|jsonl|hex|pem)$/i;
|
|
176
|
+
// TLD-shaped tails (domains, not commands) — fallback heuristic only when no
|
|
177
|
+
// live inventory is available; registered namespaces can end in one
|
|
178
|
+
// (forge.dev, forge.build would otherwise be filtered out).
|
|
179
|
+
const DOC_TLD_TAIL_RE = /\.(?:com|org|net|io|dev|ai|app|de|uk|eu|co|me|cloud|site|xyz|build|systems|watch|pro|info|gg|wtf|zone|land|run)$/i;
|
|
180
|
+
const DOC_SUPPRESS_11_RE = /pkg-health-11(?:\s*\|\s*pkg-health-12)?:\s*([^\n]*?)\s*(?:-->\s*)?$/;
|
|
181
|
+
const DOC_SUPPRESS_12_RE = /(?:pkg-health-11\s*\|\s*)?pkg-health-12:\s*([^\n]*?)\s*(?:-->\s*)?$/;
|
|
182
|
+
/** Collect the package's DOCS_SURFACE files — docs trees, README, AGENTS — minus the fixed excludes. */
|
|
183
|
+
export function collectDocsSurfaceFiles(pkgDir) {
|
|
184
|
+
const files = [];
|
|
185
|
+
const docsDir = path.join(pkgDir, "docs");
|
|
186
|
+
const walk = (dir) => {
|
|
187
|
+
let entries;
|
|
188
|
+
try {
|
|
189
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
for (const e of entries) {
|
|
195
|
+
const abs = path.join(dir, e.name);
|
|
196
|
+
if (e.isDirectory())
|
|
197
|
+
walk(abs);
|
|
198
|
+
else if (e.isFile() && e.name.endsWith(".md"))
|
|
199
|
+
files.push(abs);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
if (fs.existsSync(docsDir))
|
|
203
|
+
walk(docsDir);
|
|
204
|
+
for (const top of ["README.md", "AGENTS.md"]) {
|
|
205
|
+
const abs = path.join(pkgDir, top);
|
|
206
|
+
if (fs.existsSync(abs))
|
|
207
|
+
files.push(abs);
|
|
208
|
+
}
|
|
209
|
+
return files
|
|
210
|
+
.filter((f) => {
|
|
211
|
+
const rel = path.relative(pkgDir, f).split(path.sep).join("/");
|
|
212
|
+
return !DOCS_SURFACE_EXCLUDE_RES.some((re) => re.test(rel));
|
|
213
|
+
})
|
|
214
|
+
.sort();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Scan one package's docs surface: build the documented-token set, the
|
|
218
|
+
* pkg-health-11 exemption set, and the dead-reference candidates (tokens on
|
|
219
|
+
* unsuppressed lines). pkg-health-12 markers exempt their whole line.
|
|
220
|
+
*/
|
|
221
|
+
export function scanDocsSurface(pkgDir, files, commandNamespaces, registeredCommands) {
|
|
222
|
+
const documented = new Set();
|
|
223
|
+
const suppressed11 = new Map();
|
|
224
|
+
const refs = new Map();
|
|
225
|
+
const suppressions = [];
|
|
226
|
+
for (const abs of files) {
|
|
227
|
+
const rel = path.relative(pkgDir, abs).split(path.sep).join("/");
|
|
228
|
+
let source;
|
|
229
|
+
try {
|
|
230
|
+
source = fs.readFileSync(abs, "utf8");
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
const lines = source.split("\n");
|
|
236
|
+
for (let i = 0; i < lines.length; i++) {
|
|
237
|
+
const line = lines[i];
|
|
238
|
+
const tokens = [...line.matchAll(DOC_TOKEN_RE)]
|
|
239
|
+
.map((m) => m[1])
|
|
240
|
+
.filter((t) => !DOC_REF_EXT_RE.test(t))
|
|
241
|
+
.filter((t) => {
|
|
242
|
+
if (!commandNamespaces)
|
|
243
|
+
return !DOC_TLD_TAIL_RE.test(t);
|
|
244
|
+
// A token whose first segment is no registered command namespace is
|
|
245
|
+
// a property path (import.meta.url), config key (bindings.commands),
|
|
246
|
+
// or prose — never a command reference.
|
|
247
|
+
return commandNamespaces.has(t.split(".", 1)[0]);
|
|
248
|
+
})
|
|
249
|
+
// Registered commands always count (forge.dev, context.index.build).
|
|
250
|
+
// Unregistered tokens ending in a TLD tail are domains (warpgogol.com)
|
|
251
|
+
// or TLD-shaped property paths (context.io) — never command refs.
|
|
252
|
+
// Registered commands always count (forge.dev, context.index.build).
|
|
253
|
+
// Unregistered TWO-segment tokens ending in a TLD tail are domains
|
|
254
|
+
// (warpgogol.com) or TLD-shaped property paths (context.io); a 3+
|
|
255
|
+
// segment token under a registered namespace (deploy.smoke.run after
|
|
256
|
+
// removal) stays a dead-reference candidate — never TLD-exempt.
|
|
257
|
+
.filter((t) => !registeredCommands || registeredCommands.has(t) || t.split(".").length > 2 || !DOC_TLD_TAIL_RE.test(t));
|
|
258
|
+
const s11 = line.match(DOC_SUPPRESS_11_RE);
|
|
259
|
+
const s12 = line.match(DOC_SUPPRESS_12_RE);
|
|
260
|
+
// A marker with an empty reason does not suppress — an exemption needs
|
|
261
|
+
// a justification. Both markers are evaluated: a line may carry an 11
|
|
262
|
+
// and a 12 marker (or the combined pkg-health-11|pkg-health-12 form).
|
|
263
|
+
const reason = (m) => (m?.[1] ?? "").replace(/-->\s*$/, "").trim();
|
|
264
|
+
const m11 = s11 ? reason(s11) || null : null;
|
|
265
|
+
const m12 = s12 ? reason(s12) || null : null;
|
|
266
|
+
for (const token of tokens) {
|
|
267
|
+
if (m11) {
|
|
268
|
+
const entry = { ruleId: "PKG-HEALTH-11", file: rel, line: i + 1, token, reason: m11 };
|
|
269
|
+
suppressed11.set(token, entry);
|
|
270
|
+
suppressions.push(entry);
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
documented.add(token);
|
|
274
|
+
}
|
|
275
|
+
if (m12) {
|
|
276
|
+
suppressions.push({ ruleId: "PKG-HEALTH-12", file: rel, line: i + 1, token, reason: m12 });
|
|
277
|
+
documented.add(token);
|
|
278
|
+
}
|
|
279
|
+
else if (!refs.has(token)) {
|
|
280
|
+
refs.set(token, { file: rel, line: i + 1 });
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return { documented, suppressed11, refs, suppressions };
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Map kernel module names → owning package dir — the same module enumeration
|
|
289
|
+
* the workspace registry (and command.manifest.generate) was built from:
|
|
290
|
+
* tools/kernel.config.ts inline loaders plus the WORKSHOP_MODULE_MAP buckets
|
|
291
|
+
* in werkstatt-engine's module-map.ts. Never a hand-maintained list.
|
|
292
|
+
* Returns separate workshop/site maps — module names can collide across
|
|
293
|
+
* buckets (deploy is both engine() and sitePlugin()) and commands attribute
|
|
294
|
+
* through the map matching their siteScope.
|
|
295
|
+
*/
|
|
296
|
+
export function deriveModulePackageMap(workspaceRoot) {
|
|
297
|
+
const out = new Map();
|
|
298
|
+
const site = new Map();
|
|
299
|
+
const mmPath = path.join(workspaceRoot, "packages", "werkstatt-engine", "src", "kernel", "module-map.ts");
|
|
300
|
+
try {
|
|
301
|
+
const mm = fs.readFileSync(mmPath, "utf8");
|
|
302
|
+
const bucketToConst = { engine: "ENGINE", sitePlugin: "SITE", forge: "FORGE" };
|
|
303
|
+
const constToSpec = {};
|
|
304
|
+
for (const m of mm.matchAll(/const (\w+) = "(@warpgogol\/[^"]+)"/g))
|
|
305
|
+
constToSpec[m[1]] = m[2];
|
|
306
|
+
for (const m of mm.matchAll(/["']?([\w-]+)["']?:\s*(engine|sitePlugin|forge)\(/g)) {
|
|
307
|
+
const spec = constToSpec[bucketToConst[m[2]]];
|
|
308
|
+
// Module names can collide across buckets (deploy: engine + sitePlugin) —
|
|
309
|
+
// keep the maps separate so siteScope commands resolve via SITE only.
|
|
310
|
+
if (spec)
|
|
311
|
+
(m[2] === "sitePlugin" ? site : out).set(m[1], `packages/${spec.split("/")[1]}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
catch {
|
|
315
|
+
// module-map absent — inline loaders still map
|
|
316
|
+
}
|
|
317
|
+
const kcPath = path.join(workspaceRoot, "tools", "kernel.config.ts");
|
|
318
|
+
try {
|
|
319
|
+
const kc = fs.readFileSync(kcPath, "utf8");
|
|
320
|
+
for (const m of kc.matchAll(/["']?(\w[\w-]*)["']?:\s*async[^=]*=>[^;]*?import\("(@warpgogol\/[^"]+)"/g)) {
|
|
321
|
+
out.set(m[1], `packages/${m[2].split("/")[1]}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
catch {
|
|
325
|
+
// no kernel config — inventory attribution is empty
|
|
326
|
+
}
|
|
327
|
+
return { workshop: out, site };
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* The live command inventory: context.commandRegistry (the same enumeration
|
|
331
|
+
* command.manifest.generate consumes) UNION docs/command-manifest.generated.yaml
|
|
332
|
+
* — the getLiveCommands merge pattern from os/rfc/handlers/lifecycle.ts.
|
|
333
|
+
* Registry entries win on collision; the manifest covers commands whose modules
|
|
334
|
+
* are not loaded in the current dispatch (werkstatt run injects no registry;
|
|
335
|
+
* site-scope modules live outside the forge registry).
|
|
336
|
+
*/
|
|
337
|
+
export function loadCommandInventory(workspaceRoot, commandRegistry) {
|
|
338
|
+
const byName = new Map();
|
|
339
|
+
const manifestPath = path.join(workspaceRoot, "docs", "command-manifest.generated.yaml");
|
|
340
|
+
try {
|
|
341
|
+
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
342
|
+
const parsed = parseYaml(raw);
|
|
343
|
+
for (const c of parsed?.commands ?? []) {
|
|
344
|
+
if (typeof c.name === "string" && c.name.length > 0) {
|
|
345
|
+
byName.set(c.name, {
|
|
346
|
+
name: c.name,
|
|
347
|
+
module: typeof c.module === "string" ? c.module : undefined,
|
|
348
|
+
siteScope: typeof c.siteScope === "boolean"
|
|
349
|
+
? c.siteScope
|
|
350
|
+
: Array.isArray(c.providers) && c.providers.includes("site-module")
|
|
351
|
+
? true
|
|
352
|
+
: undefined,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
// manifest absent or unparsable — registry-only inventory
|
|
359
|
+
}
|
|
360
|
+
for (const c of commandRegistry?.listCommands() ?? []) {
|
|
361
|
+
// Merge, don't overwrite: ForgeCliRegistry entries carry no `module`, so a
|
|
362
|
+
// bare set() would erase the manifest's provenance under the standalone CLI.
|
|
363
|
+
const prev = byName.get(c.name);
|
|
364
|
+
byName.set(c.name, {
|
|
365
|
+
name: c.name,
|
|
366
|
+
module: c.module ?? prev?.module,
|
|
367
|
+
siteScope: c.siteScope ?? prev?.siteScope,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return [...byName.values()];
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Whether repo-extract's copy filter would ship one entry — shared by the
|
|
374
|
+
* working-tree walk (PKG-HEALTH-10) and the at-ref enumeration (publish
|
|
375
|
+
* preflight) so both judge the same set. `rel` is package-root-relative.
|
|
376
|
+
*/
|
|
377
|
+
export function isShippedEntry(rel, name, isDir, cfg) {
|
|
378
|
+
if (cfg.ignoreDirs.has(name))
|
|
379
|
+
return false;
|
|
380
|
+
if (isDir)
|
|
381
|
+
return !cfg.excludeSegments.some((seg) => rel.includes(seg));
|
|
382
|
+
if (name.endsWith(".tsbuildinfo"))
|
|
383
|
+
return false;
|
|
384
|
+
if (cfg.monorepoMode && IGNORE_FILES.has(name))
|
|
385
|
+
return false;
|
|
386
|
+
if (cfg.excludeSegments.some((seg) => rel.includes(seg)))
|
|
387
|
+
return false;
|
|
388
|
+
if (cfg.excludeExtensions.some((ext) => name.endsWith(ext)))
|
|
389
|
+
return false;
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Derive the file set repo-extract will ship for a package — a walk of
|
|
394
|
+
* `projectRoot` honoring the same config keys the copy filters consume (see
|
|
395
|
+
* parseHealthScanConfig). Symlinks are followed through statSync like
|
|
396
|
+
* repo-extract's `cp` filter; a realpath-set bounds link cycles. Never a
|
|
397
|
+
* hand-maintained file list.
|
|
398
|
+
*/
|
|
399
|
+
export function deriveShippedFiles(projectRoot, extractConfigRaw) {
|
|
400
|
+
const cfg = parseHealthScanConfig(extractConfigRaw);
|
|
401
|
+
const root = path.resolve(projectRoot);
|
|
402
|
+
const shipped = [];
|
|
403
|
+
const visited = new Set();
|
|
404
|
+
const collect = (dir) => {
|
|
405
|
+
let entries;
|
|
406
|
+
try {
|
|
407
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
408
|
+
}
|
|
409
|
+
catch {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
for (const e of entries) {
|
|
413
|
+
const abs = path.join(dir, e.name);
|
|
414
|
+
const rel = path.relative(root, abs).split(path.sep).join("/");
|
|
415
|
+
// Dirent.isFile()/isDirectory() are false for symlinks — repo-extract's
|
|
416
|
+
// cp stats through links, so the scan must as well.
|
|
417
|
+
let stats = null;
|
|
418
|
+
if (e.isSymbolicLink()) {
|
|
419
|
+
try {
|
|
420
|
+
stats = fs.statSync(abs);
|
|
421
|
+
}
|
|
422
|
+
catch {
|
|
423
|
+
stats = null;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const isDir = stats ? stats.isDirectory() : e.isDirectory();
|
|
427
|
+
const isFile = stats ? stats.isFile() : e.isFile();
|
|
428
|
+
if (!isShippedEntry(rel, e.name, isDir, cfg))
|
|
429
|
+
continue;
|
|
430
|
+
if (isDir) {
|
|
431
|
+
let real = abs;
|
|
432
|
+
try {
|
|
433
|
+
real = fs.realpathSync(abs);
|
|
434
|
+
}
|
|
435
|
+
catch {
|
|
436
|
+
// keep the syntactic path
|
|
437
|
+
}
|
|
438
|
+
if (visited.has(real))
|
|
439
|
+
continue;
|
|
440
|
+
visited.add(real);
|
|
441
|
+
collect(abs);
|
|
442
|
+
}
|
|
443
|
+
else if (isFile) {
|
|
444
|
+
shipped.push(rel);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
collect(root);
|
|
449
|
+
return shipped.sort();
|
|
450
|
+
}
|
|
19
451
|
function defaultLintRunner(projectDir, hasLintScript) {
|
|
20
452
|
const args = hasLintScript
|
|
21
453
|
? ["--dir", projectDir, "run", "lint"]
|
|
@@ -204,8 +636,29 @@ export async function runPackageHealth(_input, context, lintRunner = defaultLint
|
|
|
204
636
|
const rootNodeRange = rootEngines?.["node"];
|
|
205
637
|
const violations = [];
|
|
206
638
|
const lintSurface = {};
|
|
639
|
+
const suppressions = [];
|
|
207
640
|
let packagesChecked = 0;
|
|
208
|
-
|
|
641
|
+
// RFC-1518 CHECKS 11/12 inputs — the live command inventory (registry
|
|
642
|
+
// union generated manifest, the getLiveCommands merge), attributed to
|
|
643
|
+
// owning packages through the kernel module enumeration.
|
|
644
|
+
const commandInfos = loadCommandInventory(workspaceRoot, context.commandRegistry);
|
|
645
|
+
const allCommands = new Set(commandInfos.map((c) => c.name));
|
|
646
|
+
const allNamespaces = new Set(commandInfos.map((c) => c.name.split(".", 1)[0]));
|
|
647
|
+
const moduleToPkg = deriveModulePackageMap(workspaceRoot);
|
|
648
|
+
const pkgCommands = new Map();
|
|
649
|
+
let attributed = 0;
|
|
650
|
+
for (const c of commandInfos) {
|
|
651
|
+
// Provider-aware attribution: a module name can exist in both the workshop
|
|
652
|
+
// and site buckets (deploy does), so siteScope commands resolve via the
|
|
653
|
+
// site map only — a last-write-wins flat map silently misattributes.
|
|
654
|
+
const map = c.siteScope === true ? moduleToPkg.site : moduleToPkg.workshop;
|
|
655
|
+
const pkg = c.module !== undefined ? map.get(c.module) : undefined;
|
|
656
|
+
if (pkg === undefined)
|
|
657
|
+
continue;
|
|
658
|
+
attributed++;
|
|
659
|
+
(pkgCommands.get(pkg) ?? pkgCommands.set(pkg, []).get(pkg)).push(c.name);
|
|
660
|
+
}
|
|
661
|
+
const entries = fs.readdirSync(packagesDir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
209
662
|
for (const entry of entries) {
|
|
210
663
|
if (!entry.isDirectory())
|
|
211
664
|
continue;
|
|
@@ -217,10 +670,52 @@ export async function runPackageHealth(_input, context, lintRunner = defaultLint
|
|
|
217
670
|
if (!pkg)
|
|
218
671
|
continue;
|
|
219
672
|
const isPrivate = pkg["private"] === true;
|
|
673
|
+
const packageName = String(pkg["name"] ?? entry.name);
|
|
674
|
+
// RFC-1518 CHECKS 11/12: the package's declared docs surface diffed
|
|
675
|
+
// against the live command inventory (F-0073). Coverage counts a token
|
|
676
|
+
// documented anywhere on the surface; dead refs flag at doc:line. Runs
|
|
677
|
+
// for EVERY package with a package.json — docs drift is orthogonal to
|
|
678
|
+
// publishability, so private/extractable:false packages are scanned too.
|
|
679
|
+
if (commandInfos.length > 0) {
|
|
680
|
+
const rel = path.relative(workspaceRoot, pkgDir).split(path.sep).join("/");
|
|
681
|
+
const surfaceFiles = collectDocsSurfaceFiles(pkgDir);
|
|
682
|
+
const scan = scanDocsSurface(pkgDir, surfaceFiles, allNamespaces, allCommands);
|
|
683
|
+
suppressions.push(...scan.suppressions.map((s) => ({ ...s, packageName })));
|
|
684
|
+
const expectedDoc = fs.existsSync(path.join(pkgDir, "docs", "reference", "cli.md"))
|
|
685
|
+
? "docs/reference/cli.md"
|
|
686
|
+
: "README.md";
|
|
687
|
+
// Coverage applies to published packages — the command's stated contract.
|
|
688
|
+
// Private packages (site plugin, lifecycle core) document their command
|
|
689
|
+
// surfaces in site-facing docs outside this audit; their dead refs still
|
|
690
|
+
// flag via PKG-HEALTH-12 (deviation D-003).
|
|
691
|
+
for (const cmd of isPrivate ? [] : (pkgCommands.get(rel) ?? [])) {
|
|
692
|
+
if (!scan.documented.has(cmd) && !scan.suppressed11.has(cmd)) {
|
|
693
|
+
violations.push({
|
|
694
|
+
ruleId: "PKG-HEALTH-11",
|
|
695
|
+
packageName,
|
|
696
|
+
severity: "error",
|
|
697
|
+
message: `registered command "${cmd}" appears in no docs-surface file — document it in ${expectedDoc}`,
|
|
698
|
+
file: pkgDir,
|
|
699
|
+
fixHint: `Add a "${cmd}" reference to ${expectedDoc}, or journal a same-line "<!-- pkg-health-11: <reason> -->" exemption.`,
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
for (const [token, at] of [...scan.refs.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
704
|
+
if (!allCommands.has(token)) {
|
|
705
|
+
violations.push({
|
|
706
|
+
ruleId: "PKG-HEALTH-12",
|
|
707
|
+
packageName,
|
|
708
|
+
severity: "error",
|
|
709
|
+
message: `${at.file}:${at.line} references "${token}" — no such registered command`,
|
|
710
|
+
file: path.join(pkgDir, at.file),
|
|
711
|
+
fixHint: `Fix the reference to a registered command, or journal a same-line "<!-- pkg-health-12: <reason> -->" exemption.`,
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
220
716
|
if (isPrivate)
|
|
221
717
|
continue;
|
|
222
718
|
packagesChecked++;
|
|
223
|
-
const packageName = String(pkg["name"] ?? entry.name);
|
|
224
719
|
// CHECK 1: engines.node exists and matches root
|
|
225
720
|
const pkgEngines = pkg["engines"];
|
|
226
721
|
const pkgNodeRange = pkgEngines?.["node"];
|
|
@@ -401,8 +896,50 @@ export async function runPackageHealth(_input, context, lintRunner = defaultLint
|
|
|
401
896
|
});
|
|
402
897
|
}
|
|
403
898
|
}
|
|
899
|
+
// RFC-1517 CHECK 10: a `../` literal in a shipped file that resolves
|
|
900
|
+
// outside the package root passes the monorepo suite and ENOENTs only
|
|
901
|
+
// inside the standalone extract (F-0064). Same scan the publish
|
|
902
|
+
// preflight runs — the defect surfaces here on routine health runs.
|
|
903
|
+
const healthProjectDir = projectDirMatch
|
|
904
|
+
? path.resolve(workspaceRoot, projectDirMatch[1])
|
|
905
|
+
: pkgDir;
|
|
906
|
+
const healthScanCfg = parseHealthScanConfig(extractConfigRaw);
|
|
907
|
+
for (const esc of scanFixturePathEscapes(healthProjectDir, deriveShippedFiles(healthProjectDir, extractConfigRaw), healthScanCfg.suppressions)) {
|
|
908
|
+
violations.push({
|
|
909
|
+
ruleId: "PKG-HEALTH-10",
|
|
910
|
+
packageName,
|
|
911
|
+
severity: "error",
|
|
912
|
+
message: `${esc.file}:${esc.line} path literal "${esc.literal}" resolves outside the package root (${esc.resolvedTo}) — the standalone extract will ENOENT.`,
|
|
913
|
+
file: path.join(healthProjectDir, esc.file),
|
|
914
|
+
fixHint: 'Rebind the reference to a path inside the package root, mark a justified non-path use with a same-line "// pkg-health-10: <reason>" comment, or list the file in pkgHealth10Suppressions in extract.config.yaml.',
|
|
915
|
+
});
|
|
916
|
+
}
|
|
404
917
|
}
|
|
405
918
|
}
|
|
919
|
+
suppressions.sort((a, b) => (a.packageName ?? "").localeCompare(b.packageName ?? "") || a.file.localeCompare(b.file) || a.line - b.line);
|
|
920
|
+
if (packagesChecked > 0 && commandInfos.length === 0) {
|
|
921
|
+
violations.push({
|
|
922
|
+
ruleId: "PKG-HEALTH-12",
|
|
923
|
+
packageName: "(workspace)",
|
|
924
|
+
severity: "warning",
|
|
925
|
+
message: "no command inventory available — docs-drift gate skipped (context.commandRegistry unset and docs/command-manifest.generated.yaml absent or unparsable)",
|
|
926
|
+
file: workspaceRoot,
|
|
927
|
+
fixHint: "Run `werkstatt run command.manifest.generate`, or dispatch through a host that injects commandRegistry.",
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
else if (packagesChecked > 0 && commandInfos.length > 0 && attributed === 0) {
|
|
931
|
+
// Inventory exists but no command resolved to a package — module→package
|
|
932
|
+
// attribution is unavailable (e.g. a consumer workshop without the
|
|
933
|
+
// werkstatt-engine module-map) and PKG-HEALTH-11 would silently inert.
|
|
934
|
+
violations.push({
|
|
935
|
+
ruleId: "PKG-HEALTH-12",
|
|
936
|
+
packageName: "(workspace)",
|
|
937
|
+
severity: "warning",
|
|
938
|
+
message: `${commandInfos.length} inventoried command(s) resolved to no package — module attribution unavailable, PKG-HEALTH-11 coverage skipped`,
|
|
939
|
+
file: workspaceRoot,
|
|
940
|
+
fixHint: "Check that packages/werkstatt-engine/src/kernel/module-map.ts or tools/kernel.config.ts declares the command modules.",
|
|
941
|
+
});
|
|
942
|
+
}
|
|
406
943
|
const errors = violations.filter((v) => v.severity === "error");
|
|
407
944
|
const warnings = violations.filter((v) => v.severity === "warning");
|
|
408
945
|
const passed = errors.length === 0;
|
|
@@ -432,6 +969,9 @@ export async function runPackageHealth(_input, context, lintRunner = defaultLint
|
|
|
432
969
|
parts.push(`${warnings.length} warning${warnings.length === 1 ? "" : "s"}`);
|
|
433
970
|
logger.error(`forge.package.health: ${parts.join(", ")} across ${packagesChecked} package(s).`);
|
|
434
971
|
}
|
|
972
|
+
if (suppressions.length > 0) {
|
|
973
|
+
logger.info(`forge.package.health: ${suppressions.length} docs-gate suppression(s) journaled (see data.suppressions for file:line + reason).`);
|
|
974
|
+
}
|
|
435
975
|
}
|
|
436
976
|
}
|
|
437
977
|
return {
|
|
@@ -441,6 +981,7 @@ export async function runPackageHealth(_input, context, lintRunner = defaultLint
|
|
|
441
981
|
violations,
|
|
442
982
|
passed,
|
|
443
983
|
lintSurface,
|
|
984
|
+
suppressions,
|
|
444
985
|
},
|
|
445
986
|
exitCode: passed ? 0 : 1,
|
|
446
987
|
summary: passed
|