@warpgogol/forge 9.3.1 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +32 -0
- package/CHANGELOG.md +25 -0
- package/README.md +2 -2
- package/bin/cli.ts +4 -4
- package/dist/bin/cli.js +4 -4
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
- package/dist/os/adr/handlers/list-create.js +23 -2
- package/dist/os/adr/handlers/list-create.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/adr/types.js +2 -2
- package/dist/os/adr/types.js.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.js +3 -1
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +6 -12
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +2 -0
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +7 -2
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +24 -14
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/conformance/conformance.module.d.ts.map +1 -1
- package/dist/os/conformance/conformance.module.js +21 -4
- package/dist/os/conformance/conformance.module.js.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -1
- package/dist/os/conformance/handlers/conformance-validate.js +64 -8
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -1
- package/dist/os/core/archive-regen.d.ts +99 -0
- package/dist/os/core/archive-regen.d.ts.map +1 -0
- package/dist/os/core/archive-regen.js +220 -0
- package/dist/os/core/archive-regen.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +159 -18
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +8 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +3 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/package-health.d.ts +130 -0
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +548 -7
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +5 -2
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +3 -1
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dirty-classify.d.ts +48 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -0
- package/dist/os/flow/dirty-classify.js +81 -0
- package/dist/os/flow/dirty-classify.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +85 -19
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/gate-engine.d.ts +13 -0
- package/dist/os/flow/gate-engine.d.ts.map +1 -0
- package/dist/os/flow/gate-engine.js +32 -0
- package/dist/os/flow/gate-engine.js.map +1 -0
- package/dist/os/flow/git.d.ts +45 -4
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +95 -27
- package/dist/os/flow/git.js.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.js +12 -5
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +25 -3
- package/dist/os/flow/handlers/flow-check.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts +4 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +54 -31
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +33 -5
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +13 -10
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-hold.js +13 -7
- package/dist/os/flow/handlers/flow-hold.js.map +1 -1
- package/dist/os/flow/handlers/flow-install.d.ts +2 -1
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-install.js +56 -13
- package/dist/os/flow/handlers/flow-install.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +48 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +536 -65
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts +14 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +117 -12
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/handlers/flow-status.d.ts +13 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-status.js +35 -14
- package/dist/os/flow/handlers/flow-status.js.map +1 -1
- package/dist/os/flow/index.d.ts +1 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +3 -1
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/line-version.d.ts.map +1 -1
- package/dist/os/flow/line-version.js +2 -1
- package/dist/os/flow/line-version.js.map +1 -1
- package/dist/os/flow/locks.d.ts +37 -1
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +34 -14
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/preflight.d.ts +114 -0
- package/dist/os/flow/preflight.d.ts.map +1 -0
- package/dist/os/flow/preflight.js +620 -0
- package/dist/os/flow/preflight.js.map +1 -0
- package/dist/os/flow/publish.d.ts +7 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +165 -3
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +26 -1
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +27 -6
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/scripts.d.ts +4 -0
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +8 -2
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/session-checkout.d.ts +33 -0
- package/dist/os/flow/session-checkout.d.ts.map +1 -0
- package/dist/os/flow/session-checkout.js +151 -0
- package/dist/os/flow/session-checkout.js.map +1 -0
- package/dist/os/flow/worktree-path.d.ts.map +1 -1
- package/dist/os/flow/worktree-path.js +9 -3
- package/dist/os/flow/worktree-path.js.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.d.ts +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -1
- package/dist/os/instructions/handlers/budget-validate.js +12 -4
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +4 -1
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/mission/open-missions.d.ts +8 -0
- package/dist/os/mission/open-missions.d.ts.map +1 -0
- package/dist/os/mission/open-missions.js +42 -0
- package/dist/os/mission/open-missions.js.map +1 -0
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +11 -1
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts +14 -0
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +18 -10
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +11 -2
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts +23 -0
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +82 -1
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +24 -2
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +16 -3
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +5 -4
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +83 -8
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +48 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +131 -2
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +21 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +77 -5
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +64 -6
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/next-id.d.ts +38 -0
- package/dist/os/rfc/next-id.d.ts.map +1 -0
- package/dist/os/rfc/next-id.js +165 -0
- package/dist/os/rfc/next-id.js.map +1 -0
- package/dist/os/rfc/probe-batch.d.ts.map +1 -1
- package/dist/os/rfc/probe-batch.js +6 -1
- package/dist/os/rfc/probe-batch.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +36 -8
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +35 -6
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +6 -6
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +81 -28
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +47 -0
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +31 -7
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/spec/spec-schema.d.ts +8 -0
- package/dist/os/spec/spec-schema.d.ts.map +1 -1
- package/dist/os/spec/spec-schema.js +1 -0
- package/dist/os/spec/spec-schema.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts +8 -0
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +18 -6
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +62 -15
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +13 -5
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -1
- package/dist/os/system/handlers/system-map-validate.js +2 -1
- package/dist/os/system/handlers/system-map-validate.js.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.d.ts +11 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.js +54 -6
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-create.js +6 -1
- package/dist/os/system/handlers/system-task-create.js.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.d.ts +14 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.js +246 -6
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -1
- package/dist/os/system/repo.d.ts +1 -1
- package/dist/os/system/repo.d.ts.map +1 -1
- package/dist/os/system/repo.js +53 -3
- package/dist/os/system/repo.js.map +1 -1
- package/dist/os/system/scenario-schemas.d.ts +109 -3
- package/dist/os/system/scenario-schemas.d.ts.map +1 -1
- package/dist/os/system/scenario-schemas.js +66 -10
- package/dist/os/system/scenario-schemas.js.map +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +69 -17
- package/dist/os/system/system.module.js.map +1 -1
- package/dist/os/system/tests/contract-fixtures.d.ts +17 -0
- package/dist/os/system/tests/contract-fixtures.d.ts.map +1 -0
- package/dist/os/system/tests/contract-fixtures.js +109 -0
- package/dist/os/system/tests/contract-fixtures.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +54 -18
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +41 -9
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +6 -0
- package/dist/src/conformance/index.d.ts.map +1 -1
- package/dist/src/conformance/index.js +36 -1
- package/dist/src/conformance/index.js.map +1 -1
- package/dist/src/formal/proof-runner.d.ts.map +1 -1
- package/dist/src/formal/proof-runner.js +10 -2
- package/dist/src/formal/proof-runner.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +3 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.js +4 -4
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +3 -1
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +2 -2
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +14 -2
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +3 -1
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/skill-schema.d.ts +3 -0
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +9 -2
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/spec/resolve-spec-source.d.ts +45 -0
- package/dist/src/spec/resolve-spec-source.d.ts.map +1 -0
- package/dist/src/spec/resolve-spec-source.js +153 -0
- package/dist/src/spec/resolve-spec-source.js.map +1 -0
- package/dist/src/utils/command-inventory.d.ts +28 -0
- package/dist/src/utils/command-inventory.d.ts.map +1 -0
- package/dist/src/utils/command-inventory.js +84 -0
- package/dist/src/utils/command-inventory.js.map +1 -0
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +6 -1
- package/dist/src/utils/io.js.map +1 -1
- package/dist/src/utils/repo-path.d.ts +10 -0
- package/dist/src/utils/repo-path.d.ts.map +1 -0
- package/dist/src/utils/repo-path.js +52 -0
- package/dist/src/utils/repo-path.js.map +1 -0
- package/dist/src/utils/spawn.d.ts +23 -0
- package/dist/src/utils/spawn.d.ts.map +1 -0
- package/dist/src/utils/spawn.js +83 -0
- package/dist/src/utils/spawn.js.map +1 -0
- package/docs/branch-model.md +1 -1
- package/docs/guides/existing-project.md +1 -1
- package/docs/maintainers/publishing.md +1 -1
- package/docs/reference/cli.md +8 -2
- package/docs/reference/profiles.md +1 -1
- package/os/adr/handlers/list-create.ts +26 -2
- package/os/adr/types.ts +4 -2
- package/os/compass/handlers/compass-audit-handler.ts +6 -1
- package/os/compass/handlers/compass-header-scaffold-handler.ts +12 -11
- package/os/compass/handlers/git-revision.ts +8 -2
- package/os/compass/handlers/summary-record.ts +25 -14
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +3 -2
- package/os/conformance/conformance.module.ts +21 -4
- package/os/conformance/handlers/conformance-validate.ts +108 -16
- package/os/conformance/handlers/tests/conformance-package-consumer.test.ts +200 -0
- package/os/core/archive-regen.ts +279 -0
- package/os/core/core.module.ts +176 -29
- package/os/core/docs-archive.test.ts +413 -3
- package/os/core/handlers/assets-helpers.ts +8 -3
- package/os/core/handlers/forge-autonomy-validate.ts +3 -1
- package/os/core/handlers/package-health.test.ts +418 -4
- package/os/core/handlers/package-health.ts +629 -7
- package/os/core/handlers/release-prepare.ts +5 -2
- package/os/flow/digest.ts +3 -1
- package/os/flow/dirty-classify.ts +112 -0
- package/os/flow/flow.module.ts +92 -24
- package/os/flow/gate-engine.ts +45 -0
- package/os/flow/git.ts +117 -29
- package/os/flow/handlers/flow-backmerge.ts +14 -4
- package/os/flow/handlers/flow-check.ts +27 -2
- package/os/flow/handlers/flow-cut.ts +97 -46
- package/os/flow/handlers/flow-discard.ts +33 -5
- package/os/flow/handlers/flow-fix.ts +22 -10
- package/os/flow/handlers/flow-hold.ts +20 -7
- package/os/flow/handlers/flow-install.ts +59 -12
- package/os/flow/handlers/flow-integrate.ts +808 -182
- package/os/flow/handlers/flow-open.ts +135 -11
- package/os/flow/handlers/flow-status.ts +45 -13
- package/os/flow/index.ts +3 -1
- package/os/flow/line-version.ts +2 -1
- package/os/flow/locks.ts +56 -14
- package/os/flow/preflight.ts +763 -0
- package/os/flow/publish.ts +200 -5
- package/os/flow/registry.ts +43 -7
- package/os/flow/scripts.ts +13 -2
- package/os/flow/session-checkout.ts +186 -0
- package/os/flow/tests/dirty-classify.test.ts +116 -0
- package/os/flow/tests/fixtures/branch-names.yaml +40 -40
- package/os/flow/tests/flow-discard.test.ts +32 -0
- package/os/flow/tests/flow-guard-parity.test.ts +10 -2
- package/os/flow/tests/flow-install.test.ts +7 -3
- package/os/flow/tests/flow-integrate.gate-report.test.ts +144 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +561 -0
- package/os/flow/tests/flow-integrate.reattach.test.ts +197 -0
- package/os/flow/tests/flow-integrate.remediation.test.ts +254 -0
- package/os/flow/tests/flow-integrate.test.ts +348 -17
- package/os/flow/tests/flow-open.pending.test.ts +277 -0
- package/os/flow/tests/flow-open.test.ts +52 -9
- package/os/flow/tests/flow-push-publish.test.ts +124 -0
- package/os/flow/tests/flow-status.test.ts +31 -1
- package/os/flow/tests/locks.test.ts +39 -3
- package/os/flow/tests/scripts.test.ts +5 -2
- package/os/flow/tests/state-roots.test.ts +8 -5
- package/os/flow/worktree-path.ts +9 -3
- package/os/formal/handlers/proof-check.test.ts +6 -3
- package/os/instructions/budget.test.ts +31 -0
- package/os/instructions/handlers/budget-validate.ts +13 -4
- package/os/instructions/instructions.module.ts +4 -1
- package/os/mission/open-missions.ts +50 -0
- package/os/queue/decision-ledger.test.ts +18 -0
- package/os/queue/manifest.ts +17 -1
- package/os/rfc/acceptance.ts +30 -10
- package/os/rfc/decision-log.ts +13 -2
- package/os/rfc/frontmatter-io.ts +89 -1
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +83 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +22 -2
- package/os/rfc/handlers/implement-stamp-stale.test.ts +5 -1
- package/os/rfc/handlers/implement-stamp.ts +16 -3
- package/os/rfc/handlers/index-graph.ts +5 -4
- package/os/rfc/handlers/lifecycle.test.ts +136 -0
- package/os/rfc/handlers/list-create.test.ts +82 -0
- package/os/rfc/handlers/list-create.ts +101 -8
- package/os/rfc/handlers/rfc-evidence-sync.test.ts +504 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +192 -2
- package/os/rfc/handlers/tests/index-graph.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +73 -0
- package/os/rfc/handlers/validate-rules.ts +103 -7
- package/os/rfc/handlers/validate.ts +68 -4
- package/os/rfc/next-id.ts +232 -0
- package/os/rfc/probe-batch.ts +6 -1
- package/os/rfc/rfc.module.ts +41 -8
- package/os/rfc/types.ts +28 -6
- package/os/rfc/verification-emit-freshness.test.ts +5 -1
- package/os/rfc/verification-emit.test.ts +5 -1
- package/os/rfc/verification-evidence.ts +99 -33
- package/os/rfc/verification-origin.ts +59 -0
- package/os/rfc/verification-refresh.test.ts +5 -1
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +5 -1
- package/os/session/handlers/save.ts +35 -7
- package/os/session/tests/session-save.test.ts +154 -0
- package/os/spec/spec-schema.ts +3 -0
- package/os/spec/spec-status.ts +22 -6
- package/os/spec/spec-validate.package-source.test.ts +187 -0
- package/os/spec/spec-validate.ts +65 -14
- package/os/spec/spec.module.ts +13 -5
- package/os/system/handlers/system-map-validate.ts +4 -2
- package/os/system/handlers/system-outbox-scan.ts +65 -21
- package/os/system/handlers/system-task-create.ts +6 -1
- package/os/system/handlers/system-versionset-record.ts +301 -16
- package/os/system/repo.ts +59 -18
- package/os/system/scenario-schemas.ts +91 -12
- package/os/system/system.module.ts +70 -17
- package/os/system/tests/contract-fixtures.ts +139 -0
- package/os/system/tests/scenario-pin-drift-check.test.ts +114 -0
- package/os/system/tests/scenario-validator-check.test.ts +96 -0
- package/os/system/tests/system-task-dispatch.test.ts +4 -1
- package/os/system/tests/system-versionset.test.ts +7 -3
- package/os/system/tests/version-set-v2.test.ts +78 -0
- package/package.json +9 -1
- package/skills/fo/fo-doctor/SKILL.md +151 -0
- package/skills/fo/fo-handoff/SKILL.md +22 -0
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +2 -1
- package/skills/fo/fo-idea-implement/SKILL.md +5 -2
- package/skills/fo/fo-idea-plan/SKILL.md +5 -5
- package/skills/fo/fo-session-retro/SKILL.md +37 -11
- package/skills/fo/fo-spec-ingest/SKILL.md +8 -0
- package/skills/fo/fo-system-dispatch/SKILL.md +1 -0
- package/skills/meta/skill-create/SKILL.md +2 -1
- package/src/bin-entry.test.ts +3 -1
- package/src/config/forge-config.ts +57 -13
- package/src/conformance/index.ts +46 -1
- package/src/formal/proof-runner.ts +10 -2
- package/src/migration-adapters/node-typescript-pnpm/index.ts +3 -1
- package/src/migration-adapters/phaser-pnpm/index.ts +3 -1
- package/src/onboarding/agents-generate.ts +4 -4
- package/src/onboarding/nested-agents-generate.ts +3 -1
- package/src/onboarding/scaffold-project.ts +2 -2
- package/src/onboarding/upgrade.ts +13 -2
- package/src/onboarding/workspace-discovery.ts +3 -1
- package/src/pipeline-status.test.ts +1 -1
- package/src/skill-schema.ts +9 -2
- package/src/spec/resolve-spec-source.ts +184 -0
- package/src/tests/acceptance-probe-kinds.test.ts +3 -1
- package/src/tests/agents-generate-domain.test.ts +3 -2
- package/src/tests/agents-generate.test.ts +2 -1
- package/src/tests/create-flow.test.ts +3 -1
- package/src/tests/create.test.ts +12 -2
- package/src/tests/editable-generated-region.test.ts +2 -2
- package/src/tests/fixtures/agents-generate-business-before.txt +2 -0
- package/src/tests/implement-stamp.test.ts +5 -2
- package/src/tests/rfc-implement-stamp-governance.test.ts +6 -2
- package/src/tests/rfc-verification-verdict-ingest.test.ts +5 -1
- package/src/tests/scaffold-project.test.ts +3 -1
- package/src/tests/upgrade.test.ts +79 -3
- package/src/tests/workspace-discovery.test.ts +4 -3
- package/src/utils/command-inventory.ts +105 -0
- package/src/utils/io.ts +6 -1
- package/src/utils/repo-path.ts +49 -0
- package/src/utils/spawn.ts +88 -0
- package/src/tests/rfc-evidence-sync.test.ts +0 -369
- package/src/tests/skill-agents-sync.test.ts +0 -192
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Live command inventory — union of the runtime commandRegistry and
|
|
4
|
+
docs/command-manifest.generated.yaml (the getLiveCommands precedent from
|
|
5
|
+
os/rfc/handlers/lifecycle.ts, widened to full reads/writes/flags entries for
|
|
6
|
+
RFC-1528's owner-discovery and resolvability consumers). Required because
|
|
7
|
+
werkstatt run injects no commandRegistry and lazy-loaded modules are invisible
|
|
8
|
+
to it — a registry-only read silently disables any consumer on the primary
|
|
9
|
+
dispatch path (RFC-1518 r1, deviation D-001).</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>No kernel or engine imports — portable src-layer helper.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<CHANGE_SUMMARY>
|
|
15
|
+
<item>RFC-1528: initial — loadManifestCommandEntries + loadLiveCommandInventory (review F-1 fix).</item>
|
|
16
|
+
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
17
|
+
</CHANGE_SUMMARY>
|
|
18
|
+
*/
|
|
19
|
+
import { readFileSync } from "node:fs";
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
import { parse as parseYaml } from "yaml";
|
|
22
|
+
const MANIFEST_RELATIVE_PATH = join("docs", "command-manifest.generated.yaml");
|
|
23
|
+
/**
|
|
24
|
+
* Parse the generated command manifest into registered-command-shaped
|
|
25
|
+
* entries. Absent or unparsable manifest → empty list (registry still wins).
|
|
26
|
+
*/
|
|
27
|
+
export function loadManifestCommandEntries(workspaceRoot) {
|
|
28
|
+
try {
|
|
29
|
+
const raw = readFileSync(join(workspaceRoot, MANIFEST_RELATIVE_PATH), "utf8");
|
|
30
|
+
const parsed = parseYaml(raw);
|
|
31
|
+
const entries = [];
|
|
32
|
+
for (const c of parsed?.commands ?? []) {
|
|
33
|
+
if (typeof c?.name !== "string" || c.name.length === 0)
|
|
34
|
+
continue;
|
|
35
|
+
entries.push({
|
|
36
|
+
name: c.name,
|
|
37
|
+
provider: "workspace",
|
|
38
|
+
description: "",
|
|
39
|
+
scope: "workspace",
|
|
40
|
+
...(c.module !== undefined ? { module: c.module } : {}),
|
|
41
|
+
...(c.reads !== undefined ? { reads: c.reads } : {}),
|
|
42
|
+
...(c.writes !== undefined ? { writes: c.writes } : {}),
|
|
43
|
+
...(c.generates !== undefined
|
|
44
|
+
? {
|
|
45
|
+
generates: c.generates.map((g) => ({
|
|
46
|
+
path: g.path,
|
|
47
|
+
phase: (g.phase ?? "on-demand"),
|
|
48
|
+
})),
|
|
49
|
+
}
|
|
50
|
+
: {}),
|
|
51
|
+
flags: (c.flags ?? {}),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return entries;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Union runtime registry with the generated manifest — the D-001 merge.
|
|
62
|
+
* Registry entries win on collision; manifest entries cover commands whose
|
|
63
|
+
* modules are not loaded in the current dispatch.
|
|
64
|
+
*/
|
|
65
|
+
export function loadLiveCommandInventory(workspaceRoot, commandRegistry) {
|
|
66
|
+
const byName = new Map();
|
|
67
|
+
for (const entry of loadManifestCommandEntries(workspaceRoot)) {
|
|
68
|
+
byName.set(entry.name, entry);
|
|
69
|
+
}
|
|
70
|
+
for (const entry of commandRegistry?.listCommands() ?? []) {
|
|
71
|
+
const prev = byName.get(entry.name);
|
|
72
|
+
byName.set(entry.name, {
|
|
73
|
+
...prev,
|
|
74
|
+
...entry,
|
|
75
|
+
module: entry.module ?? prev?.module,
|
|
76
|
+
reads: entry.reads ?? prev?.reads,
|
|
77
|
+
writes: entry.writes ?? prev?.writes,
|
|
78
|
+
generates: entry.generates ?? prev?.generates,
|
|
79
|
+
flags: entry.flags ?? prev?.flags,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return [...byName.values()];
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=command-inventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-inventory.js","sourceRoot":"","sources":["../../../src/utils/command-inventory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAmB1C,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,EAAE,iCAAiC,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,aAAqB;IAC9D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,sBAAsB,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9E,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAiD,CAAC;QAC9E,MAAM,OAAO,GAAiC,EAAE,CAAC;QACjD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC;YACvC,IAAI,OAAO,CAAC,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,C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K,MAAM,KAAK,IAAI,0BAA0B,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1D,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE;YACrB,GAAG,IAAI;YACP,GAAG,KAAK;YACR,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,EAAE,MAAM;YACpC,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK;YACjC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,EAAE,MAAM;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,SAAS;YAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK;SAClC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/utils/io.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/utils/io.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,aAAa,CAAC;AAuCxE;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,WA+DvB,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,EAAE,CAAC,EAAE,WAAW,GAAG,WAAW,CAEvD"}
|
package/dist/src/utils/io.js
CHANGED
|
@@ -22,11 +22,16 @@ import { readFile as fsReadFile, mkdir as fsMkdir, rm as fsRm, readdir as fsRead
|
|
|
22
22
|
import { spawn } from "node:child_process";
|
|
23
23
|
import { dirname } from "node:path";
|
|
24
24
|
import { writeFileAtomic } from "./fs-atomic.js";
|
|
25
|
+
import { resolveSpawnPlan } from "./spawn.js";
|
|
25
26
|
async function execImpl(command, args, opts) {
|
|
26
27
|
return new Promise((resolve, reject) => {
|
|
27
|
-
|
|
28
|
+
// Bare names (pnpm/npm/sh) need PATHEXT resolution on Windows — .cmd
|
|
29
|
+
// shims route through cmd.exe; unresolved names keep ENOENT semantics.
|
|
30
|
+
const plan = resolveSpawnPlan(command, args);
|
|
31
|
+
const child = spawn(plan.command, plan.args, {
|
|
28
32
|
cwd: opts?.cwd,
|
|
29
33
|
env: opts?.env ? { ...process.env, ...opts.env } : undefined,
|
|
34
|
+
windowsVerbatimArguments: plan.verbatim,
|
|
30
35
|
});
|
|
31
36
|
let stdout = "";
|
|
32
37
|
let stderr = "";
|
package/dist/src/utils/io.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/utils/io.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;EAmBE;AAEF,OAAO,EACL,QAAQ,IAAI,UAAU,EACtB,KAAK,IAAI,OAAO,EAChB,EAAE,IAAI,IAAI,EACV,OAAO,IAAI,SAAS,EACpB,IAAI,IAAI,MAAM,EACd,MAAM,IAAI,QAAQ,EAClB,UAAU,IAAI,YAAY,EAC1B,QAAQ,IAAI,UAAU,EACtB,OAAO,IAAI,SAAS,EACpB,QAAQ,IAAI,UAAU,EACtB,IAAI,IAAI,MAAM,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,O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AC;IAC3B,CAAC;IACD,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,+EAA+E;AAC/E,MAAM,UAAU,SAAS,CAAC,EAAgB;IACxC,OAAO,EAAE,IAAI,SAAS,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical directory form for cross-source path comparisons. On Windows a
|
|
3
|
+
* tempdir may arrive as an 8.3 alias (`...\RUNNER~1\...`) while git reports
|
|
4
|
+
* the long form from `--show-toplevel` — string math between the two frames
|
|
5
|
+
* silently produces `..` escapes instead of matches. The native realpath
|
|
6
|
+
* resolves aliases and on-disk casing; the `\\?\` extended-length prefix it
|
|
7
|
+
* returns there is stripped so plain path.relative math still applies.
|
|
8
|
+
*/
|
|
9
|
+
export declare function canonicalRepoDir(dir: string): string;
|
|
10
|
+
//# sourceMappingURL=repo-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-path.d.ts","sourceRoot":"","sources":["../../../src/utils/repo-path.ts"],"names":[],"mappings":"AA0BA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAcpD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Canonical directory spelling for cross-frame path comparison. Git answers
|
|
5
|
+
path queries (`worktree list`, `rev-parse`) in its own resolved frame —
|
|
6
|
+
forward slashes and the on-disk long name — while Node-side callers often
|
|
7
|
+
carry the user's raw path, which on Windows may be an 8.3 alias or differ
|
|
8
|
+
in casing. String math between the two frames silently produces `..`
|
|
9
|
+
escapes instead of matches; canonicalRepoDir normalizes a directory to the
|
|
10
|
+
native real path so comparisons mean what they look like.
|
|
11
|
+
</purpose>
|
|
12
|
+
<non-goals>
|
|
13
|
+
<item>Not a symlink policy — callers that must NOT resolve symlinks keep plain path.resolve.</item>
|
|
14
|
+
</non-goals>
|
|
15
|
+
</MODULE_CONTRACT>
|
|
16
|
+
<KEY_DECISIONS>
|
|
17
|
+
<item>realpathSync.native resolves 8.3 aliases and on-disk casing; on failure the input passes through so degrade paths stay inspectable.</item>
|
|
18
|
+
<item>The `\\?\` extended-length prefix native realpath returns on Windows is stripped — plain path.relative/join math still applies to the result.</item>
|
|
19
|
+
</KEY_DECISIONS>
|
|
20
|
+
<CHANGE_SUMMARY>
|
|
21
|
+
<item>T-0007: promoted from os/compass git-revision so os/flow worktree/registry helpers share one canonicalization.</item>
|
|
22
|
+
</CHANGE_SUMMARY>
|
|
23
|
+
*/
|
|
24
|
+
import { realpathSync } from "./sync-fs.js";
|
|
25
|
+
/**
|
|
26
|
+
* Canonical directory form for cross-source path comparisons. On Windows a
|
|
27
|
+
* tempdir may arrive as an 8.3 alias (`...\RUNNER~1\...`) while git reports
|
|
28
|
+
* the long form from `--show-toplevel` — string math between the two frames
|
|
29
|
+
* silently produces `..` escapes instead of matches. The native realpath
|
|
30
|
+
* resolves aliases and on-disk casing; the `\\?\` extended-length prefix it
|
|
31
|
+
* returns there is stripped so plain path.relative math still applies.
|
|
32
|
+
*/
|
|
33
|
+
export function canonicalRepoDir(dir) {
|
|
34
|
+
let real;
|
|
35
|
+
try {
|
|
36
|
+
real = realpathSync.native(dir);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
try {
|
|
40
|
+
real = realpathSync(dir);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return dir;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (real.startsWith("\\\\?\\UNC\\"))
|
|
47
|
+
return `\\\\${real.slice(8)}`;
|
|
48
|
+
if (real.startsWith("\\\\?\\"))
|
|
49
|
+
return real.slice(4);
|
|
50
|
+
return real;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=repo-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-path.js","sourceRoot":"","sources":["../../../src/utils/repo-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;EAsBE;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a bare command name through Windows PATH × PATHEXT (the search
|
|
3
|
+
* cmd.exe performs and CreateProcess does not). Returns the command
|
|
4
|
+
* unchanged when it already names a path (contains a separator or an
|
|
5
|
+
* extension) or when the platform is not Windows. Returns `null` when a
|
|
6
|
+
* bare name resolves to nothing — the caller keeps the original argv so
|
|
7
|
+
* the spawn still reports ENOENT.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveSpawnable(command: string): string | null;
|
|
10
|
+
export interface SpawnPlan {
|
|
11
|
+
command: string;
|
|
12
|
+
args: string[];
|
|
13
|
+
/** Pass through to spawn's windowsVerbatimArguments — args are pre-quoted. */
|
|
14
|
+
verbatim: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build the spawn pair for `command` + `args`. A bare name resolved to a
|
|
18
|
+
* .cmd/.bat shim is re-routed through `cmd.exe /d /s /c` with the args
|
|
19
|
+
* pre-quoted (windowsVerbatimArguments must be set on the spawn so Node
|
|
20
|
+
* does not re-mangle the quoting). Everything else spawns directly.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveSpawnPlan(command: string, args: string[]): SpawnPlan;
|
|
23
|
+
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/utils/spawn.ts"],"names":[],"mappings":"AA+BA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAa/D;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,8EAA8E;IAC9E,QAAQ,EAAE,OAAO,CAAC;CACnB;AAWD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAW3E"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Portable command resolution for spawn seams. Node's spawn cannot exec a
|
|
5
|
+
bare package-manager name on Windows — pnpm/npm/yarn/bun ship as `*.cmd`
|
|
6
|
+
PATHEXT shims, and CreateProcess never consults PATHEXT the way cmd.exe
|
|
7
|
+
does. resolveSpawnable scans PATH × PATHEXT to find the real executable;
|
|
8
|
+
resolveSpawnPlan wraps a resolved .cmd/.bat in `cmd.exe /d /s /c` because
|
|
9
|
+
Node refuses to spawn batch files without a shell since the CVE-2024-27980
|
|
10
|
+
hardening. Unresolvable names return the original argv untouched so a
|
|
11
|
+
missing tool still surfaces as spawn ENOENT — callers that map ENOENT to
|
|
12
|
+
"unavailable" keep their contract.
|
|
13
|
+
</purpose>
|
|
14
|
+
<non-goals>
|
|
15
|
+
<item>Does not resolve scripts inside node_modules/.bin — those are POSIX sh shims, callers exec them via `sh` explicitly.</item>
|
|
16
|
+
</non-goals>
|
|
17
|
+
</MODULE_CONTRACT>
|
|
18
|
+
<KEY_DECISIONS>
|
|
19
|
+
<item>Resolution is upfront, not retry-on-ENOENT — a retry via cmd would turn a genuinely missing binary into exit 9009 and silently change "unavailable" verdicts into refusals.</item>
|
|
20
|
+
<item>Paths and extension-bearing names pass through unresolved — CreateProcess handles them directly on every platform.</item>
|
|
21
|
+
</KEY_DECISIONS>
|
|
22
|
+
<CHANGE_SUMMARY>
|
|
23
|
+
<item>T-0007: Windows forge-tests remediation — one PATH+PATHEXT resolver shared by the ambient exec adapter, the proof runner, and the probe batcher.</item>
|
|
24
|
+
</CHANGE_SUMMARY>
|
|
25
|
+
*/
|
|
26
|
+
import { existsSync } from "./sync-fs.js";
|
|
27
|
+
import { delimiter, join } from "node:path";
|
|
28
|
+
const IS_WIN = process.platform === "win32";
|
|
29
|
+
/**
|
|
30
|
+
* Resolve a bare command name through Windows PATH × PATHEXT (the search
|
|
31
|
+
* cmd.exe performs and CreateProcess does not). Returns the command
|
|
32
|
+
* unchanged when it already names a path (contains a separator or an
|
|
33
|
+
* extension) or when the platform is not Windows. Returns `null` when a
|
|
34
|
+
* bare name resolves to nothing — the caller keeps the original argv so
|
|
35
|
+
* the spawn still reports ENOENT.
|
|
36
|
+
*/
|
|
37
|
+
export function resolveSpawnable(command) {
|
|
38
|
+
if (!IS_WIN)
|
|
39
|
+
return command;
|
|
40
|
+
if (/[/\\]/.test(command) || /\.[a-zA-Z0-9]+$/.test(command))
|
|
41
|
+
return command;
|
|
42
|
+
const pathext = (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";");
|
|
43
|
+
for (const rawDir of (process.env.PATH ?? "").split(delimiter)) {
|
|
44
|
+
const dir = rawDir.replace(/^"|"$/g, "");
|
|
45
|
+
if (!dir)
|
|
46
|
+
continue;
|
|
47
|
+
for (const ext of pathext) {
|
|
48
|
+
const candidate = join(dir, `${command}${ext}`);
|
|
49
|
+
if (existsSync(candidate))
|
|
50
|
+
return candidate;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
/** cmd.exe-safe quoting: only needed when whitespace or shell metachars appear. */
|
|
56
|
+
function quoteCmdArg(arg) {
|
|
57
|
+
if (!/[\s"&|<>^()%!]/.test(arg))
|
|
58
|
+
return arg;
|
|
59
|
+
// Trailing backslashes doubled so they cannot escape the closing quote;
|
|
60
|
+
// inner quotes are backslash-escaped (MSVCRT convention the .cmd inherits).
|
|
61
|
+
const inner = arg.replace(/(\\)+$/, "$1$1").replace(/"/g, '\\"');
|
|
62
|
+
return `"${inner}"`;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Build the spawn pair for `command` + `args`. A bare name resolved to a
|
|
66
|
+
* .cmd/.bat shim is re-routed through `cmd.exe /d /s /c` with the args
|
|
67
|
+
* pre-quoted (windowsVerbatimArguments must be set on the spawn so Node
|
|
68
|
+
* does not re-mangle the quoting). Everything else spawns directly.
|
|
69
|
+
*/
|
|
70
|
+
export function resolveSpawnPlan(command, args) {
|
|
71
|
+
const resolved = resolveSpawnable(command);
|
|
72
|
+
if (resolved === null)
|
|
73
|
+
return { command, args, verbatim: false };
|
|
74
|
+
if (IS_WIN && /\.(cmd|bat)$/i.test(resolved)) {
|
|
75
|
+
return {
|
|
76
|
+
command: process.env.COMSPEC ?? "cmd.exe",
|
|
77
|
+
args: ["/d", "/s", "/c", quoteCmdArg(resolved), ...args.map(quoteCmdArg)],
|
|
78
|
+
verbatim: true,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return { command: resolved, args, verbatim: false };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=spawn.js.map
|
|
@@ -0,0 +1 @@
|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G,CAAC;QAAE,OAAO,GAAG,CAAC;IAC5C,wEAAwE;IACxE,4EAA4E;IAC5E,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACjE,OAAO,IAAI,KAAK,GAAG,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,IAAc;IAC9D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjE,IAAI,MAAM,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7C,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,SAAS;YACzC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACzE,QAAQ,EAAE,IAAI;SACf,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACtD,CAAC"}
|
package/docs/branch-model.md
CHANGED
|
@@ -91,7 +91,7 @@ managed exclusively by flow commands — never edit them by hand.
|
|
|
91
91
|
|
|
92
92
|
- `forge create` (RFC-1500) scaffolds, commits, and runs `flow.install`
|
|
93
93
|
automatically; `--no-flow` opts out.
|
|
94
|
-
- `pnpm exec forge upgrade` reports `flow.state` (`adopted`, `not-adopted`,
|
|
94
|
+
- `pnpm exec forge upgrade` reports `flow.state` (`adopted`, `not-adopted`, <!-- pkg-health-12: flow state name, not a command -->
|
|
95
95
|
`exempt`, `guard-drift`) without changing the repository.
|
|
96
96
|
- `pnpm exec forge flow.install --dry-run` previews adoption for a
|
|
97
97
|
repository created earlier; `pnpm exec forge flow.install` performs it
|
|
@@ -33,6 +33,6 @@ Transplanting an existing codebase into Forge is an interactive, AI-guided proce
|
|
|
33
33
|
- Your existing files are moved into the Forge project structure
|
|
34
34
|
- Hidden files (`.env`, `.gitignore`) are preserved
|
|
35
35
|
- Git history is optionally transferred
|
|
36
|
-
- The matching stack profile is detected from marker files (`phaser.config.*`, `project.godot`, etc.)
|
|
36
|
+
- The matching stack profile is detected from marker files (`phaser.config.*`, `project.godot`, etc.) <!-- pkg-health-12: code/config path, not a command -->
|
|
37
37
|
- `AGENTS.md` is generated from `forge.yaml`
|
|
38
38
|
- Skills are deployed to `.agents/skills/`
|
|
@@ -20,7 +20,7 @@ werkstatt run flow.push --digest <digestId> # the only outbound step
|
|
|
20
20
|
`flow.cut` + `flow.push` (RFC-1490/1491/1499) is the **only** supported export path — the retired `scripts/publish-forge.mjs`/`bump-forge.mjs` were removed by the fixed-branch switch-over. The pipeline:
|
|
21
21
|
|
|
22
22
|
1. `flow.cut --lines forge` bumps `packages/forge/package.json` + `forge.yaml` `syncedVersion` via verified JSON-equal replacements (FLOW-CUT-11), lands `chore(release): forge@X.Y.Z` into `develop` under the integration lock + gate, fast-forwards `main`, and writes the `forge/release-tag@1` annotated tag. A `major` level requires `ALLOW_MAJOR_BUMP=1` (FLOW-CUT-05). Reruns resume from the tip's `chore(release):` subject — no version is ever skipped.
|
|
23
|
-
2. `flow.push --digest <id>` pushes `develop` + `main` + new tags atomically, then extracts the package **at the tag** via `repo-extract` into `../packages/forge` — only committed tag content is exported.
|
|
23
|
+
2. `flow.push --digest <id>` pushes `develop` + `main` + new tags atomically, then extracts the package **at the tag** via `repo-extract` into `../packages/forge` — only committed tag content is exported. Before any extract runs, the `preflight-extract-gates` step (RFC-1517) refuses two source-derivable defect classes in milliseconds: a `CHANGELOG.md` at the ref without the `[<version>]` section being published (`FLOW-PUB-01` — write the section before publishing per the packages/AGENTS.md publish-order rule) and a shipped file's `../` path literal resolving outside the package root (`PKG-HEALTH-10`, reported at file:line — the same durable rule `forge.package.health` runs on routine checks). Both refusals leave `repo-extract` unspawned; the post-extract changelog gate below stays as defense in depth. Escapes for justified non-path literals: a same-line `// pkg-health-10: <reason>` comment (source files), or a `pkgHealth10Suppressions:` path list in `extract.config.yaml` for files that cannot carry comments (JSON) or whose literal sits inside a fixture string. Doc files (`.md`) and binaries are exempt — prose links are never resolved, and `tsconfig.json`/`package.json` literals rewritten or tolerated by repo-extract belong on the config list.
|
|
24
24
|
3. `hooks/extract-verify.sh` verifies the extract with `scripts/verify-extract.mjs` — the same script surface standalone CI runs (install, lint, typecheck, build:check, test, build) plus a changelog gate that requires a `[<version>]` section in `CHANGELOG.md`.
|
|
25
25
|
4. On a non-fast-forward rejection the push reconciles once with `merge -s ours` (the local tree stays the authoritative export) — never force-push. Retries are journal-scoped: rerun `flow.push` with the same digest and exactly the pushed-but-unpublished tags are published.
|
|
26
26
|
5. CI on GitHub picks up the push and publishes to npm automatically.
|
package/docs/reference/cli.md
CHANGED
|
@@ -142,13 +142,13 @@ forge pinned.init
|
|
|
142
142
|
## Package health
|
|
143
143
|
|
|
144
144
|
```sh
|
|
145
|
-
forge
|
|
145
|
+
werkstatt run forge.package.health
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
## Autonomy
|
|
149
149
|
|
|
150
150
|
```sh
|
|
151
|
-
forge
|
|
151
|
+
werkstatt run forge.autonomy.validate
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
## Authority delegations (RFC-1336)
|
|
@@ -268,3 +268,9 @@ forge note.link.validate
|
|
|
268
268
|
forge note.frontmatter.validate
|
|
269
269
|
forge note.orphan.detect
|
|
270
270
|
```
|
|
271
|
+
|
|
272
|
+
## Registered command surface
|
|
273
|
+
|
|
274
|
+
Canonical registry names (see `docs/command-manifest.generated.yaml` for the full inventory) not covered in the usage sections above:
|
|
275
|
+
|
|
276
|
+
`audit.archive`, `file.size.lint`, `flow.publication.retire`, `flow.status`, `flow.version`, `forge.assets.check`, `forge.assets.list`, `forge.build`, `forge.conformance.run`, `forge.conformance.validate`, `forge.create`, `forge.determinism.check`, `forge.dev`, `forge.doctor`, `forge.port.scaffold`, `forge.port.validate`, `forge.profile.validate`, `forge.public-surface.validate`, `forge.release.prepare`, `forge.release.publish`, `forge.scaffold`, `forge.skill.knowledge.compact`, `forge.skill.list`, `forge.skill.validate`, `forge.validate`, `memory.compact`, `mission.archive`, `outbox.validate`, `plan.archive`, `spec.live.rebuild`, `system.map.validate`, `system.outbox.scan`, `system.task.collect`, `system.task.create`, `system.task.dispatch`, `system.task.move`, `system.task.status`, `system.versionset.record`.
|
|
@@ -30,7 +30,7 @@ pnpm exec forge profile.validate
|
|
|
30
30
|
When bringing an existing project through the `/forge-bootstrap` transplant mode, Forge detects the matching profile by checking for marker files:
|
|
31
31
|
|
|
32
32
|
- `phaser.config.*` → `phaser-game`
|
|
33
|
-
- `project.godot` → `godot-game`
|
|
33
|
+
- `project.godot` → `godot-game` <!-- pkg-health-12: code/config path, not a command -->
|
|
34
34
|
- `tsconfig.json` + `pnpm-workspace.yaml` → `typescript`
|
|
35
35
|
|
|
36
36
|
## Project-agnostic
|
|
@@ -11,10 +11,13 @@
|
|
|
11
11
|
<item>RFC-1097: sweep — packages/forge + services clean
|
|
12
12
|
|
|
13
13
|
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
14
|
+
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
14
15
|
</CHANGE_SUMMARY>
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
import { ambientIo as fs } from "../../../src/utils/io.ts";
|
|
18
|
+
import { ambientIo as fs, resolveIo } from "../../../src/utils/io.ts";
|
|
19
|
+
import { allocateNextAdrId, appendReservation } from "../../rfc/next-id.ts";
|
|
20
|
+
import { currentBranch } from "../../flow/git.ts";
|
|
18
21
|
import { existsSync } from "../../../src/utils/sync-fs.ts";
|
|
19
22
|
import path from "node:path";
|
|
20
23
|
import { fileURLToPath } from "node:url";
|
|
@@ -144,7 +147,13 @@ export async function runAdrCreate(
|
|
|
144
147
|
if (num > maxId) maxId = num;
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
|
-
|
|
150
|
+
// RFC-1536 (Q-2): ADR ids share the RFC reservation surface and discipline.
|
|
151
|
+
const io = resolveIo(context.io);
|
|
152
|
+
const allocation = await allocateNextAdrId(io, workspaceRoot, maxId);
|
|
153
|
+
for (const warning of allocation.warnings) {
|
|
154
|
+
if (outputFormat === "pretty") logger.warn(`adr.create: ${warning}`);
|
|
155
|
+
}
|
|
156
|
+
const nextNum = allocation.id;
|
|
148
157
|
const paddedNum = String(nextNum).padStart(4, "0");
|
|
149
158
|
const nextSlug = `adr-${paddedNum}`;
|
|
150
159
|
const nextId = `ADR-${paddedNum}`;
|
|
@@ -196,6 +205,20 @@ export async function runAdrCreate(
|
|
|
196
205
|
}
|
|
197
206
|
|
|
198
207
|
const targetPath = path.join(adrDirPath, fileName);
|
|
208
|
+
// RFC-1536: reserve before the file write (see rfc.create for the rationale).
|
|
209
|
+
const landed = new Set<number>(files.map((f) => {
|
|
210
|
+
const m = path.basename(f).match(/^adr-(\d{4})/);
|
|
211
|
+
return m ? parseInt(m[1]!, 10) : 0;
|
|
212
|
+
}));
|
|
213
|
+
const reserved = await appendReservation(
|
|
214
|
+
io,
|
|
215
|
+
workspaceRoot,
|
|
216
|
+
{ kind: "adr", id: nextNum, session: await currentBranch(workspaceRoot, io) },
|
|
217
|
+
landed,
|
|
218
|
+
);
|
|
219
|
+
for (const warning of reserved.warnings) {
|
|
220
|
+
if (outputFormat === "pretty") logger.warn(`adr.create: ${warning}`);
|
|
221
|
+
}
|
|
199
222
|
await fs.writeFile(targetPath, content);
|
|
200
223
|
|
|
201
224
|
const relativeFile = path.join(ADR_DIR, fileName);
|
|
@@ -212,6 +235,7 @@ export async function runAdrCreate(
|
|
|
212
235
|
status: "ok",
|
|
213
236
|
file: relativeFile,
|
|
214
237
|
id: nextId,
|
|
238
|
+
idSource: allocation.source,
|
|
215
239
|
},
|
|
216
240
|
summary: `Created ${nextId}: ${title}`,
|
|
217
241
|
};
|
package/os/adr/types.ts
CHANGED
|
@@ -11,7 +11,6 @@ statuses, scopes, frontmatter shape, validation results, and list output.
|
|
|
11
11
|
</non-goals>
|
|
12
12
|
</MODULE_CONTRACT>
|
|
13
13
|
<CHANGE_SUMMARY>
|
|
14
|
-
<item>RFC-0521: migrated from packages/os/site-kernel/src/adr/ to packages/forge/os/adr/.</item>
|
|
15
14
|
<item>RFC-0727: add AdrImplementStamp types for atomic ADR status transition.</item>
|
|
16
15
|
<item>RFC-0996: add AV-17 acceptance criteria completeness check for implemented post-cutoff ADRs.</item>
|
|
17
16
|
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
@@ -20,7 +19,8 @@ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten
|
|
|
20
19
|
<item>RFC-1097: sweep — packages/forge + services clean
|
|
21
20
|
|
|
22
21
|
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
23
|
-
<
|
|
22
|
+
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
23
|
+
<history>RFC-0366, RFC-0367, RFC-0521</history>
|
|
24
24
|
</CHANGE_SUMMARY>
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -93,6 +93,8 @@ export interface AdrCreateResult {
|
|
|
93
93
|
status: "ok";
|
|
94
94
|
file: string;
|
|
95
95
|
id: string;
|
|
96
|
+
/** RFC-1536 (Q-2): which allocation surface yielded the winning maximum. */
|
|
97
|
+
idSource?: "primary" | "develop" | "reservation" | "worktree";
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
export const ADR_DIR = "docs/adrs";
|
|
@@ -320,7 +320,12 @@ export async function runCompassAuditRecord(
|
|
|
320
320
|
return { exitCode: 1, data: { path: rawFilePath, action: "recorded" } };
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
// Ledger entries key on the repo-relative logical path — forward slashes
|
|
324
|
+
// so a path recorded on one platform matches baseline filters everywhere.
|
|
325
|
+
const filePath = relative(context.workspaceRoot, resolve(process.cwd(), rawFilePath)).replace(
|
|
326
|
+
/\\/g,
|
|
327
|
+
"/",
|
|
328
|
+
);
|
|
324
329
|
|
|
325
330
|
// RFC-1143: warn when recording an audit for a ledger-ineligible path — the
|
|
326
331
|
// entry will be swept by the next baseline run (RFC-1139). Operator intent
|
|
@@ -19,7 +19,6 @@ dirty-target refusal before any write, and reports census/apply manifests.</purp
|
|
|
19
19
|
|
|
20
20
|
import { ambientIo } from "../../../src/utils/io.ts";
|
|
21
21
|
import { writeFileIfChanged } from "../../../src/utils/fs-idempotent.ts";
|
|
22
|
-
import { realpathSync } from "../../../src/utils/sync-fs.ts";
|
|
23
22
|
import { relative, resolve } from "node:path";
|
|
24
23
|
import {
|
|
25
24
|
createCompassInventoryEntries,
|
|
@@ -38,7 +37,13 @@ import {
|
|
|
38
37
|
type ScaffoldFileInput,
|
|
39
38
|
type ScaffoldFileResult,
|
|
40
39
|
} from "./compass-header-scaffold.ts";
|
|
41
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
canonicalRepoDir,
|
|
42
|
+
DIRTY_LIST_CAP,
|
|
43
|
+
isDirtyPath,
|
|
44
|
+
listDirtyPaths,
|
|
45
|
+
repoTopLevel,
|
|
46
|
+
} from "./git-revision.ts";
|
|
42
47
|
import { resolveCompassScanRoot } from "./resolve-scan-root.ts";
|
|
43
48
|
import { resolveCompassPolicy } from "../policy.ts";
|
|
44
49
|
import type {
|
|
@@ -250,16 +255,12 @@ export async function runCompassHeaderScaffold(
|
|
|
250
255
|
// Porcelain paths are repo-top-relative while reports carry
|
|
251
256
|
// workspace-relative paths — rebase through the actual top-level so a
|
|
252
257
|
// scoped scan (--package/--packages inside one repo, or a nested
|
|
253
|
-
// --workpiece repo) still sees its dirty targets.
|
|
254
|
-
// git reports canonical paths while workspaceRoot may be
|
|
258
|
+
// --workpiece repo) still sees its dirty targets. Canonicalize BOTH
|
|
259
|
+
// sides: git reports canonical paths while workspaceRoot may be
|
|
260
|
+
// symlinked — or an 8.3 alias under Windows (tmp RUNNER~1 dirs).
|
|
255
261
|
const topLevel = repoTopLevel(baseRoot);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
wsRoot = realpathSync(wsRoot);
|
|
259
|
-
} catch {
|
|
260
|
-
// keep the workspace root as given
|
|
261
|
-
}
|
|
262
|
-
const gitBase = topLevel ?? baseRoot;
|
|
262
|
+
const wsRoot = canonicalRepoDir(context.workspaceRoot);
|
|
263
|
+
const gitBase = canonicalRepoDir(topLevel ?? baseRoot);
|
|
263
264
|
const dirty = rawDirty.map((d) => {
|
|
264
265
|
const rebased = relative(wsRoot, resolve(gitBase, d)).replace(/\\/g, "/");
|
|
265
266
|
return d.endsWith("/") && !rebased.endsWith("/") ? `${rebased}/` : rebased;
|
|
@@ -20,6 +20,7 @@ plus getFileRevisionFromHistory and the porcelain dirty-path helpers
|
|
|
20
20
|
|
|
21
21
|
import { execFile, execFileSync } from "../../../src/utils/sync-fs.ts";
|
|
22
22
|
import { ambientIo } from "../../../src/utils/io.ts";
|
|
23
|
+
import { canonicalRepoDir } from "../../../src/utils/repo-path.ts";
|
|
23
24
|
import { promisify } from "node:util";
|
|
24
25
|
import { createHash } from "node:crypto";
|
|
25
26
|
|
|
@@ -34,6 +35,10 @@ const DEFAULT_GIT_TIMEOUT_MS = 15_000;
|
|
|
34
35
|
|
|
35
36
|
export const DIRTY_LIST_CAP = 20;
|
|
36
37
|
|
|
38
|
+
// Re-exported for the compass handlers that canonicalize through this
|
|
39
|
+
// module's git seam; the implementation lives in src/utils/repo-path.ts.
|
|
40
|
+
export { canonicalRepoDir };
|
|
41
|
+
|
|
37
42
|
/** The repository top-level containing `repoRoot` — null when not a git repo. */
|
|
38
43
|
export function repoTopLevel(repoRoot: string): string | null {
|
|
39
44
|
try {
|
|
@@ -61,8 +66,9 @@ export function listDirtyPaths(repoRoot: string): string[] | null {
|
|
|
61
66
|
.filter((line) => line.length >= 3)
|
|
62
67
|
.map((line) => {
|
|
63
68
|
// Porcelain is `XY <path>` — slice the raw line so leading-space
|
|
64
|
-
// status pairs (e.g. " M") keep their offsets.
|
|
65
|
-
|
|
69
|
+
// status pairs (e.g. " M") keep their offsets. A stray \r survives
|
|
70
|
+
// the split when git output is CRLF-terminated — never part of a path.
|
|
71
|
+
let path = line.slice(3).replace(/\r$/, "");
|
|
66
72
|
// Rename entries read `old -> new`; the live path is the target.
|
|
67
73
|
const arrow = path.indexOf(" -> ");
|
|
68
74
|
if (arrow >= 0) path = path.slice(arrow + 4);
|