@warpgogol/forge 9.3.0 → 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 +33 -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 +13 -3
- 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 +23 -7
- 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 +18 -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/profiles/forge-shell.yaml +1 -2
- package/profiles/knowledge.yaml +1 -1
- package/profiles/system.yaml +2 -2
- package/profiles/typescript.yaml +0 -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/profile-flow-hooks.test.ts +15 -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
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>docs.archive owner-regeneration (RFC-1528) — collect the generated artifacts
|
|
4
|
+
invalidated by archive moves and re-invoke their owner commands through
|
|
5
|
+
context.invoke. Owner selection is registry-driven: a command owns a generated
|
|
6
|
+
artifact when it declares it via generates[].path, or via a writes[] entry that
|
|
7
|
+
resolves to a generated file (marker, .generated. infix, or command:/generatedAt:
|
|
8
|
+
header convention — index.yaml/ecosystem.generated.yaml carry no GENERATED_MARKER
|
|
9
|
+
line). Manifest-generation logic itself is never duplicated here.</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>No generation logic — owners are invoked by name through the kernel port.</item>
|
|
12
|
+
<item>Standalone forge CLI has no invoke port — degrade with a note, never block.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-1528: docs.archive regenerates invalidated generated artifacts
|
|
17
|
+
|
|
18
|
+
After moves, invoke owner commands whose reads[] match a moved path via context.invoke (manifest generator last); report regenerated paths; degrade with a note without a kernel host.</item>
|
|
19
|
+
<item>RFC-1528: extract dry-run regen gate for AC-6 evidence
|
|
20
|
+
|
|
21
|
+
shouldRunArchiveRegen makes the report-only contract a tested unit instead of an inline closure check.</item>
|
|
22
|
+
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
23
|
+
<item>F-0126: tighten owner predicate — generates[] or all-generated writes[]; required flags must be REGEN_FLAGS-covered; excluded[] diagnostics</item>
|
|
24
|
+
<item>RFC-1528: exclude non-generator commands from docs.archive owner regen (F-0126)</item>
|
|
25
|
+
<item>RFC-1535: stageMovedPairs — self-staging helper for move pairs (F-0038)</item>
|
|
26
|
+
<history>RFC-1528</history>
|
|
27
|
+
</CHANGE_SUMMARY>
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
31
|
+
import path from "node:path";
|
|
32
|
+
import picomatch from "picomatch";
|
|
33
|
+
import { hasGeneratedMarker } from "../../src/utils/generated-marker.ts";
|
|
34
|
+
import { loadLiveCommandInventory } from "../../src/utils/command-inventory.ts";
|
|
35
|
+
import type {
|
|
36
|
+
ExecResult,
|
|
37
|
+
ForgeFlagValue,
|
|
38
|
+
ForgeRegisteredCommandInfo,
|
|
39
|
+
ForgeRuntimeContext,
|
|
40
|
+
} from "../../src/types.ts";
|
|
41
|
+
|
|
42
|
+
/** Per-owner flag overrides — generator commands that persist only under a flag. */
|
|
43
|
+
export const REGEN_FLAGS: Record<string, Record<string, ForgeFlagValue>> = {
|
|
44
|
+
"rfc.index.generate": { write: true },
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Ordering contract: ecosystem.manifest.generate hashes the other generated
|
|
49
|
+
* artifacts, so it always runs last among the invalidated owners.
|
|
50
|
+
*/
|
|
51
|
+
const MANIFEST_GENERATOR = "ecosystem.manifest.generate";
|
|
52
|
+
|
|
53
|
+
/** The invoking command can never be its own regen owner. */
|
|
54
|
+
const SELF_COMMAND = "docs.archive";
|
|
55
|
+
|
|
56
|
+
export interface ArchiveRegenCandidate {
|
|
57
|
+
command: string;
|
|
58
|
+
flags: Record<string, ForgeFlagValue>;
|
|
59
|
+
artifactPaths: string[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ArchiveRegenOutcome {
|
|
63
|
+
/** Workspace-relative paths owner invokes reported as modified. */
|
|
64
|
+
regenerated: string[];
|
|
65
|
+
/** Owner commands invoked. */
|
|
66
|
+
invoked: string[];
|
|
67
|
+
/** Candidate owners skipped because context.invoke is absent. */
|
|
68
|
+
skipped: string[];
|
|
69
|
+
/** Per-owner failures — reported, never fatal to the archive run. */
|
|
70
|
+
failures: Array<{ command: string; error: string }>;
|
|
71
|
+
/** Reads-matched commands excluded from ownership (F-0126 diagnostics). */
|
|
72
|
+
excluded: Array<{ command: string; reason: RegenExcludeReason }>;
|
|
73
|
+
/** Why regen did not invoke, when it did not invoke at all. */
|
|
74
|
+
skipReason: "no-invoke" | "no-inventory" | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Generated-by-name: the `.generated.` infix convention (ecosystem.generated.yaml). */
|
|
78
|
+
export function isGeneratedPathName(relPath: string): boolean {
|
|
79
|
+
return path.basename(relPath).includes(".generated.");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Generated-by-content: GENERATED_MARKER/EDITABLE_GENERATED_MARKER, or the
|
|
84
|
+
* self-describing YAML header (`command:` + `generatedAt:`) emitted by the
|
|
85
|
+
* manifest family of generators (docs/rfcs/index.yaml carries no marker line).
|
|
86
|
+
*/
|
|
87
|
+
export function isGeneratedContent(content: string): boolean {
|
|
88
|
+
if (hasGeneratedMarker(content)) return true;
|
|
89
|
+
const head = content
|
|
90
|
+
.split("\n")
|
|
91
|
+
.filter((line) => line.trim().length > 0)
|
|
92
|
+
.slice(0, 10);
|
|
93
|
+
return (
|
|
94
|
+
head.some((line) => /^command:\s*\S/.test(line)) &&
|
|
95
|
+
head.some((line) => /^generatedAt:/.test(line))
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Workspace-backed probe for declared writes[] paths. */
|
|
100
|
+
export function generatedPathProbe(workspaceRoot: string): (relPath: string) => boolean {
|
|
101
|
+
return (relPath) => {
|
|
102
|
+
if (isGeneratedPathName(relPath)) return true;
|
|
103
|
+
if (relPath.includes("*")) return false;
|
|
104
|
+
const abs = path.join(workspaceRoot, relPath);
|
|
105
|
+
if (!existsSync(abs)) return false;
|
|
106
|
+
try {
|
|
107
|
+
return isGeneratedContent(readFileSync(abs, "utf8"));
|
|
108
|
+
} catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Why a reads-matched command was excluded from owner selection (F-0126). */
|
|
115
|
+
export type RegenExcludeReason = "mixed-writes" | "required-flags";
|
|
116
|
+
|
|
117
|
+
export interface ArchiveRegenSelection {
|
|
118
|
+
candidates: ArchiveRegenCandidate[];
|
|
119
|
+
/**
|
|
120
|
+
* Commands whose reads[] intersected a moved path but that cannot act as
|
|
121
|
+
* regen owners — diagnostics only, never invoked.
|
|
122
|
+
*/
|
|
123
|
+
excluded: Array<{ command: string; reason: RegenExcludeReason }>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Pure selection: owners whose declared generated artifacts are invalidated by
|
|
128
|
+
* the moved paths — i.e. the command reads at least one glob matching a moved
|
|
129
|
+
* from/to path. Order: registry order with ecosystem.manifest.generate last.
|
|
130
|
+
*
|
|
131
|
+
* F-0126 ownership contract: a mutator that emits generated side-artifacts
|
|
132
|
+
* among hand-authored writes (e.g. rfc.implement.stamp writing verification
|
|
133
|
+
* envelopes alongside docs/rfcs/**\/*.md) is not a regen owner — ownership
|
|
134
|
+
* requires an explicit generates[] declaration or a fully generated writes[]
|
|
135
|
+
* surface. Batch regen invokes owners bare, so any required flag not covered
|
|
136
|
+
* by REGEN_FLAGS excludes the command outright.
|
|
137
|
+
*/
|
|
138
|
+
export function collectInvalidatedGenerators(
|
|
139
|
+
movedPaths: string[],
|
|
140
|
+
commands: ForgeRegisteredCommandInfo[],
|
|
141
|
+
isGeneratedPath: (relPath: string) => boolean,
|
|
142
|
+
): ArchiveRegenSelection {
|
|
143
|
+
const candidates: ArchiveRegenCandidate[] = [];
|
|
144
|
+
const excluded: ArchiveRegenSelection["excluded"] = [];
|
|
145
|
+
for (const command of commands) {
|
|
146
|
+
if (command.name === SELF_COMMAND) continue;
|
|
147
|
+
const writes = command.writes ?? [];
|
|
148
|
+
const generatedWrites = writes.filter((w) => isGeneratedPath(w));
|
|
149
|
+
const declared = (command.generates ?? []).map((g) => g.path);
|
|
150
|
+
if (declared.length === 0 && generatedWrites.length === 0) continue;
|
|
151
|
+
const reads = command.reads ?? [];
|
|
152
|
+
const invalidated = movedPaths.some((moved) =>
|
|
153
|
+
reads.some((glob) => picomatch.isMatch(moved, glob)),
|
|
154
|
+
);
|
|
155
|
+
if (!invalidated) continue;
|
|
156
|
+
if (declared.length === 0 && generatedWrites.length !== writes.length) {
|
|
157
|
+
excluded.push({ command: command.name, reason: "mixed-writes" });
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const flags = REGEN_FLAGS[command.name] ?? {};
|
|
161
|
+
const uncoveredRequired = Object.entries(command.flags ?? {}).some(
|
|
162
|
+
([flagName, spec]) => spec?.required === true && !(flagName in flags),
|
|
163
|
+
);
|
|
164
|
+
if (uncoveredRequired) {
|
|
165
|
+
excluded.push({ command: command.name, reason: "required-flags" });
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
candidates.push({
|
|
169
|
+
command: command.name,
|
|
170
|
+
flags,
|
|
171
|
+
artifactPaths: [...declared, ...generatedWrites],
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
candidates: candidates.sort((a, b) => {
|
|
176
|
+
if (a.command === MANIFEST_GENERATOR) return 1;
|
|
177
|
+
if (b.command === MANIFEST_GENERATOR) return -1;
|
|
178
|
+
return 0;
|
|
179
|
+
}),
|
|
180
|
+
excluded,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* AC-6 gate: owner regeneration fires only on a real run that moved files —
|
|
186
|
+
* a `--dry-run` docs.archive is report-only and never invokes generators.
|
|
187
|
+
*/
|
|
188
|
+
export function shouldRunArchiveRegen(dryRun: boolean, totalMoved: number): boolean {
|
|
189
|
+
return !dryRun && totalMoved > 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Invoke seam: run each invalidated owner through context.invoke. Absent invoke
|
|
194
|
+
* (standalone forge CLI) → all candidates skipped with a note, never a crash.
|
|
195
|
+
*/
|
|
196
|
+
export async function runArchiveRegen(options: {
|
|
197
|
+
movedPaths: string[];
|
|
198
|
+
context: ForgeRuntimeContext;
|
|
199
|
+
isGeneratedPath?: (relPath: string) => boolean;
|
|
200
|
+
/** Test seam — overrides the live inventory union (registry + command manifest). */
|
|
201
|
+
commands?: ForgeRegisteredCommandInfo[];
|
|
202
|
+
}): Promise<ArchiveRegenOutcome> {
|
|
203
|
+
const { movedPaths, context } = options;
|
|
204
|
+
const commands =
|
|
205
|
+
options.commands ?? loadLiveCommandInventory(context.workspaceRoot, context.commandRegistry);
|
|
206
|
+
const probe = options.isGeneratedPath ?? generatedPathProbe(context.workspaceRoot);
|
|
207
|
+
const { candidates, excluded } = collectInvalidatedGenerators(movedPaths, commands, probe);
|
|
208
|
+
const outcome: ArchiveRegenOutcome = {
|
|
209
|
+
regenerated: [],
|
|
210
|
+
invoked: [],
|
|
211
|
+
skipped: [],
|
|
212
|
+
failures: [],
|
|
213
|
+
excluded,
|
|
214
|
+
skipReason: null,
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
if (!context.invoke || commands.length === 0) {
|
|
218
|
+
outcome.skipped = candidates.map((c) => c.command);
|
|
219
|
+
outcome.skipReason = !context.invoke ? "no-invoke" : "no-inventory";
|
|
220
|
+
return outcome;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
for (const candidate of candidates) {
|
|
224
|
+
try {
|
|
225
|
+
const result = await context.invoke(candidate.command, candidate.flags);
|
|
226
|
+
if (result.ok === false || (result.exitCode !== undefined && result.exitCode !== 0)) {
|
|
227
|
+
outcome.failures.push({
|
|
228
|
+
command: candidate.command,
|
|
229
|
+
error: result.summary ?? `exit code ${result.exitCode}`,
|
|
230
|
+
});
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
outcome.invoked.push(candidate.command);
|
|
234
|
+
// Prefer the child's reported writes; fall back to the invalidated
|
|
235
|
+
// declared paths so `regenerated` always names what refreshed (AC-7).
|
|
236
|
+
const reported =
|
|
237
|
+
result.filesModified && result.filesModified.length > 0
|
|
238
|
+
? result.filesModified
|
|
239
|
+
: candidate.artifactPaths.filter((p) => !p.includes("*"));
|
|
240
|
+
for (const modified of reported) {
|
|
241
|
+
if (!outcome.regenerated.includes(modified)) outcome.regenerated.push(modified);
|
|
242
|
+
}
|
|
243
|
+
} catch (error) {
|
|
244
|
+
outcome.failures.push({
|
|
245
|
+
command: candidate.command,
|
|
246
|
+
error: error instanceof Error ? error.message : String(error),
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return outcome;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* RFC-1535 (F-0038): self-staging — every moved pair lands BOTH sides in the
|
|
255
|
+
* index (destination add + source delete) so the next commit captures the
|
|
256
|
+
* move as one unit instead of a split add/delete across two commits.
|
|
257
|
+
* `git add -A` on the union of moved from/to paths covers both sides; a
|
|
258
|
+
* non-git or already-clean tree degrades to a warn-only outcome — the
|
|
259
|
+
* commit-side EC-31 check is the safety net for any half-staged survivor.
|
|
260
|
+
*/
|
|
261
|
+
export async function stageMovedPairs(options: {
|
|
262
|
+
movedPaths: string[];
|
|
263
|
+
workspaceRoot: string;
|
|
264
|
+
exec: (command: string, args: string[], opts?: { cwd?: string }) => Promise<ExecResult>;
|
|
265
|
+
}): Promise<{ staged: number; error?: string }> {
|
|
266
|
+
const { movedPaths, workspaceRoot, exec } = options;
|
|
267
|
+
if (movedPaths.length === 0) return { staged: 0 };
|
|
268
|
+
try {
|
|
269
|
+
const result = await exec("git", ["add", "-A", "--", ...movedPaths], {
|
|
270
|
+
cwd: workspaceRoot,
|
|
271
|
+
});
|
|
272
|
+
if (result.exitCode !== 0) {
|
|
273
|
+
return { staged: 0, error: result.stderr || `git add exit ${result.exitCode}` };
|
|
274
|
+
}
|
|
275
|
+
return { staged: movedPaths.length };
|
|
276
|
+
} catch (error) {
|
|
277
|
+
return { staged: 0, error: error instanceof Error ? error.message : String(error) };
|
|
278
|
+
}
|
|
279
|
+
}
|
package/os/core/core.module.ts
CHANGED
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<item>RFC-
|
|
13
|
-
<item>RFC-
|
|
14
|
-
<
|
|
9
|
+
<item>RFC-1528: extract dry-run regen gate for AC-6 evidence
|
|
10
|
+
|
|
11
|
+
shouldRunArchiveRegen makes the report-only contract a tested unit instead of an inline closure check.</item>
|
|
12
|
+
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
13
|
+
<item>RFC-1528: note moved[] under-count on archiver throw (review F-10)</item>
|
|
14
|
+
<item>RFC-1528: exclude non-generator commands from docs.archive owner regen (F-0126)</item>
|
|
15
|
+
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
16
|
+
<item>RFC-1535: docs.archive self-stages both sides of every move pair — no half-staged EC-31 pairs (F-0038)</item>
|
|
17
|
+
<history>ADR-0021, RFC-0374, RFC-0521, RFC-0539, RFC-0542, RFC-0543, RFC-0544, RFC-0546, RFC-0640, RFC-0662, RFC-0674, RFC-0678, RFC-0679, RFC-0680, RFC-0711, RFC-0733, RFC-0877, RFC-0940, RFC-1080, RFC-1088, RFC-1089, RFC-1097, RFC-1173, RFC-1230, RFC-1231, RFC-1235, RFC-1248, RFC-1251, RFC-1254, RFC-1255, RFC-1351, RFC-1354, RFC-1360, RFC-1366, RFC-1461, RFC-1500, RFC-1505, RFC-1508, RFC-1517, RFC-1518, RFC-1522, RFC-1528</history>
|
|
15
18
|
</CHANGE_SUMMARY>
|
|
16
19
|
*/
|
|
17
20
|
|
|
@@ -23,10 +26,7 @@ import type {
|
|
|
23
26
|
ForgeRuntimeContext,
|
|
24
27
|
} from "../../src/types.ts";
|
|
25
28
|
import path from "node:path";
|
|
26
|
-
import {
|
|
27
|
-
restoreTrackedLockfile,
|
|
28
|
-
execFileSyncAdapter,
|
|
29
|
-
} from "../mission/lockfile.ts";
|
|
29
|
+
import { restoreTrackedLockfile, execFileSyncAdapter } from "../mission/lockfile.ts";
|
|
30
30
|
import { writeFileIfChanged } from "../../src/utils/fs-idempotent.ts";
|
|
31
31
|
import {
|
|
32
32
|
FORGE_SKILLS,
|
|
@@ -35,6 +35,8 @@ import {
|
|
|
35
35
|
type PackSkillEntry,
|
|
36
36
|
} from "../../src/registry.ts";
|
|
37
37
|
import { loadForgeConfig } from "../../src/config/forge-config.ts";
|
|
38
|
+
import { resolveIo } from "../../src/utils/io.ts";
|
|
39
|
+
import { resolveOwningCheckout } from "../flow/session-checkout.ts";
|
|
38
40
|
|
|
39
41
|
export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
40
42
|
const { runScaffold } = await import("../../src/onboarding/scaffold.ts");
|
|
@@ -262,7 +264,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
262
264
|
coverage: "operator" as const,
|
|
263
265
|
mutatesState: true,
|
|
264
266
|
writes: ["packages/forge/skills/**", "packages/forge/os/**"],
|
|
265
|
-
|
|
267
|
+
generates: [],
|
|
266
268
|
description: "Generate a skeleton for a new forge skill or command.",
|
|
267
269
|
scope: "workspace",
|
|
268
270
|
acceptsAllFlag: false,
|
|
@@ -333,7 +335,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
333
335
|
coverageNote: "agent memory compaction",
|
|
334
336
|
mutatesState: true,
|
|
335
337
|
writes: [".agents/memory/MEMORY.md"],
|
|
336
|
-
|
|
338
|
+
generates: [],
|
|
337
339
|
description:
|
|
338
340
|
"Enforce the MEMORY.md character budget by removing oldest Environment notes bullets (RFC-1151).",
|
|
339
341
|
scope: "workspace",
|
|
@@ -377,7 +379,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
377
379
|
coverage: "operator" as const,
|
|
378
380
|
mutatesState: true,
|
|
379
381
|
writes: ["**"],
|
|
380
|
-
|
|
382
|
+
generates: [],
|
|
381
383
|
execOnReadOnly: true,
|
|
382
384
|
description:
|
|
383
385
|
"Create a working pnpm + Turborepo monorepo from a stack profile in an empty directory. Required flags: `--profile`, `--name`.",
|
|
@@ -403,7 +405,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
403
405
|
name: "forge.create",
|
|
404
406
|
mutatesState: true,
|
|
405
407
|
writes: ["**"],
|
|
406
|
-
|
|
408
|
+
generates: [],
|
|
407
409
|
execOnReadOnly: true,
|
|
408
410
|
description:
|
|
409
411
|
"Create a forge project in-place: scaffold + init + binding defaults. The target directory must be empty (only .git/ tolerated). Usage: forge create --in-place --profile <profile-id> [--name <name>] [--package-manager pnpm]",
|
|
@@ -453,7 +455,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
453
455
|
name: "forge.init",
|
|
454
456
|
mutatesState: true,
|
|
455
457
|
writes: ["forge.yaml", "PREFERENCES.md", ".agents/skills/**"],
|
|
456
|
-
|
|
458
|
+
generates: [],
|
|
457
459
|
description:
|
|
458
460
|
"Deploy forge into a project: create forge.yaml, PREFERENCES.md, copy skills, create docs dirs. Hidden recovery command — normally called by forge.create.",
|
|
459
461
|
scope: "workspace",
|
|
@@ -685,7 +687,15 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
685
687
|
execute: runReleasePrepare,
|
|
686
688
|
},
|
|
687
689
|
{
|
|
688
|
-
envInputs: [
|
|
690
|
+
envInputs: [
|
|
691
|
+
{ name: "R2_AXIOM_ACCESS_KEY_ID", required: false },
|
|
692
|
+
{ name: "R2_AXIOM_ACCOUNT_ID", required: false },
|
|
693
|
+
{ name: "R2_AXIOM_SECRET_ACCESS_KEY", required: false },
|
|
694
|
+
{ name: "S3_ACCESS_KEY_ID", required: false },
|
|
695
|
+
{ name: "S3_BUCKET", required: false },
|
|
696
|
+
{ name: "S3_ENDPOINT", required: false },
|
|
697
|
+
{ name: "S3_SECRET_ACCESS_KEY", required: false },
|
|
698
|
+
],
|
|
689
699
|
name: "forge.release.publish",
|
|
690
700
|
coverage: "operator" as const,
|
|
691
701
|
coverageNote: "forge release publish step",
|
|
@@ -828,8 +838,15 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
828
838
|
description:
|
|
829
839
|
"Validate all published packages (private: false) for standalone extraction readiness. " +
|
|
830
840
|
"Checks engines.node, embedded .github/workflows/ci.yml, extract.config.yaml, " +
|
|
831
|
-
"devDependencies completeness (no hoisted tool deps),
|
|
832
|
-
"(extractable packages run their own lint contract)
|
|
841
|
+
"devDependencies completeness (no hoisted tool deps), per-package lint-surface " +
|
|
842
|
+
"(extractable packages run their own lint contract), and PKG-HEALTH-10 " +
|
|
843
|
+
"fixture-path scan — shipped ../ literals must resolve inside the package " +
|
|
844
|
+
'root (same-line "// pkg-health-10:" or pkgHealth10Suppressions in ' +
|
|
845
|
+
"extract.config.yaml), and the RFC-1518 docs-drift gate: PKG-HEALTH-11 " +
|
|
846
|
+
"(registered command absent from the package DOCS_SURFACE) and " +
|
|
847
|
+
"PKG-HEALTH-12 (dead x.y doc tokens) — same-line " +
|
|
848
|
+
'"<!-- pkg-health-11|pkg-health-12: <reason> -->" markers journal ' +
|
|
849
|
+
"intentional exceptions. " +
|
|
833
850
|
"Exits non-zero on errors. Use --json for machine-readable output.",
|
|
834
851
|
scope: "workspace",
|
|
835
852
|
acceptsAllFlag: false,
|
|
@@ -871,7 +888,13 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
871
888
|
"Enforces SURFACE-01..05 rules: README length, Node version match, " +
|
|
872
889
|
"no .tgz in root, docs/ structure, required root files (RFC-1080).",
|
|
873
890
|
contract: "forge",
|
|
874
|
-
rules: [
|
|
891
|
+
rules: [
|
|
892
|
+
{ id: "SURFACE-01", severity: "error" },
|
|
893
|
+
{ id: "SURFACE-02", severity: "error" },
|
|
894
|
+
{ id: "SURFACE-03", severity: "error" },
|
|
895
|
+
{ id: "SURFACE-04", severity: "error" },
|
|
896
|
+
{ id: "SURFACE-05", severity: "error" },
|
|
897
|
+
],
|
|
875
898
|
scope: "workspace",
|
|
876
899
|
acceptsAllFlag: false,
|
|
877
900
|
reads: ["README.md", "package.json", "docs/**"],
|
|
@@ -913,6 +936,9 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
913
936
|
"audit.archive, session.archive, and mission.archive in sequence. " +
|
|
914
937
|
"Passes --dry-run and --status through to all sub-commands. Not atomic " +
|
|
915
938
|
"— if one sub-command fails, prior moves are not rolled back. " +
|
|
939
|
+
"After the moves, re-invokes the owner generator of every generated " +
|
|
940
|
+
"artifact invalidated by them (manifest last) through the kernel " +
|
|
941
|
+
"invoke port and reports the regenerated paths (RFC-1528). " +
|
|
916
942
|
"Re-running is safe (idempotent).",
|
|
917
943
|
scope: "workspace",
|
|
918
944
|
mutatesState: true,
|
|
@@ -931,6 +957,10 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
931
957
|
"missions/archive/**",
|
|
932
958
|
"docs/specs/live/*.md",
|
|
933
959
|
"pnpm-lock.yaml",
|
|
960
|
+
// RFC-1528: owner-regen writes the generated artifacts invalidated by
|
|
961
|
+
// the moves (via context.invoke — never duplicated generator logic).
|
|
962
|
+
"docs/ecosystem.generated.yaml",
|
|
963
|
+
"docs/rfcs/index.yaml",
|
|
934
964
|
],
|
|
935
965
|
generates: [],
|
|
936
966
|
reads: [
|
|
@@ -955,6 +985,31 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
955
985
|
},
|
|
956
986
|
execute: async (input, context) => {
|
|
957
987
|
const { logger, outputFormat } = context;
|
|
988
|
+
|
|
989
|
+
// RFC-1536: route the moves to the owning checkout — a docs.archive
|
|
990
|
+
// run from the primary cwd moves files inside the registered
|
|
991
|
+
// session worktree (or refuses when none is attributable).
|
|
992
|
+
const io = resolveIo(context.io);
|
|
993
|
+
const owning = await resolveOwningCheckout(io, context.workspaceRoot);
|
|
994
|
+
if (!owning.ok) {
|
|
995
|
+
throw new Error(
|
|
996
|
+
`SESSION-WRITE-01: ${owning.reason} — candidates: ${owning.candidates.join(", ")}. ` +
|
|
997
|
+
`Fix: open a session worktree with 'pnpm exec forge flow.open --kind session --slug <slug>' and archive there.`,
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
for (const warning of owning.warnings) {
|
|
1001
|
+
logger.warn(`docs.archive: ${warning}`);
|
|
1002
|
+
}
|
|
1003
|
+
const routedContext =
|
|
1004
|
+
owning.checkout.kind === "worktree" && owning.checkout.worktreePath
|
|
1005
|
+
? { ...context, workspaceRoot: owning.checkout.worktreePath }
|
|
1006
|
+
: context;
|
|
1007
|
+
if (routedContext !== context && outputFormat === "pretty") {
|
|
1008
|
+
logger.info(
|
|
1009
|
+
`docs.archive: routed into worktree ${routedContext.workspaceRoot} (branch ${owning.checkout.sessionBranch})`,
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
958
1013
|
const dryRun = context.dryRun || input.flags["dry-run"] === true;
|
|
959
1014
|
const results: Record<string, unknown> = {};
|
|
960
1015
|
let totalMoved = 0;
|
|
@@ -983,7 +1038,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
983
1038
|
|
|
984
1039
|
for (const { name: cmdName, fn } of subCommands) {
|
|
985
1040
|
try {
|
|
986
|
-
const result = await fn(input,
|
|
1041
|
+
const result = await fn(input, routedContext);
|
|
987
1042
|
const data = (result as { data?: { moved?: unknown[]; skipped?: unknown[] } })?.data;
|
|
988
1043
|
if (data) {
|
|
989
1044
|
totalMoved += Array.isArray(data.moved) ? data.moved.length : 0;
|
|
@@ -1009,7 +1064,7 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
1009
1064
|
formatLiveMergeFailure,
|
|
1010
1065
|
buildLiveMergeBlock,
|
|
1011
1066
|
} = await import("../spec/live-spec-shared.ts");
|
|
1012
|
-
const rfcDirPath = path.join(
|
|
1067
|
+
const rfcDirPath = path.join(routedContext.workspaceRoot, RFC_DIR);
|
|
1013
1068
|
const rfcArchiveData = results["rfc.archive"] as
|
|
1014
1069
|
| {
|
|
1015
1070
|
moved?: Array<{
|
|
@@ -1114,15 +1169,11 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
1114
1169
|
// lockfile; gating on them alone means an rfc/adr/plan-only archive run
|
|
1115
1170
|
// never touches a locally edited pnpm-lock.yaml. Restore HEAD bytes
|
|
1116
1171
|
// instead of staging — mission churn is never committed.
|
|
1117
|
-
const missionData = results["mission.archive"] as
|
|
1118
|
-
|
|
1119
|
-
| undefined;
|
|
1120
|
-
const missionMoved = Array.isArray(missionData?.moved)
|
|
1121
|
-
? missionData.moved.length
|
|
1122
|
-
: 0;
|
|
1172
|
+
const missionData = results["mission.archive"] as { moved?: unknown[] } | undefined;
|
|
1173
|
+
const missionMoved = Array.isArray(missionData?.moved) ? missionData.moved.length : 0;
|
|
1123
1174
|
if (!dryRun && missionMoved > 0) {
|
|
1124
1175
|
try {
|
|
1125
|
-
const restored = await restoreTrackedLockfile(
|
|
1176
|
+
const restored = await restoreTrackedLockfile(routedContext.workspaceRoot, {
|
|
1126
1177
|
...execFileSyncAdapter(),
|
|
1127
1178
|
writeFile: async (target, content) => {
|
|
1128
1179
|
await writeFileIfChanged(target, content);
|
|
@@ -1140,6 +1191,96 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
1140
1191
|
}
|
|
1141
1192
|
}
|
|
1142
1193
|
|
|
1194
|
+
// ── RFC-1528: owner-regen — every generated artifact whose owner
|
|
1195
|
+
// reads a moved path is re-invoked through context.invoke (AC-1/6/7).
|
|
1196
|
+
// Runs after the lockfile safety net; absent invoke degrades with a
|
|
1197
|
+
// note, never blocks. Owner failure → diagnostics + non-zero exit. ──
|
|
1198
|
+
let regenerated: string[] = [];
|
|
1199
|
+
let regenSkipped: string[] = [];
|
|
1200
|
+
let regenExcluded: Array<{ command: string; reason: string }> = [];
|
|
1201
|
+
let regenFailures: Array<{ command: string; error: string }> = [];
|
|
1202
|
+
const { shouldRunArchiveRegen, runArchiveRegen, stageMovedPairs } = await import(
|
|
1203
|
+
"./archive-regen.ts"
|
|
1204
|
+
);
|
|
1205
|
+
if (shouldRunArchiveRegen(dryRun, totalMoved)) {
|
|
1206
|
+
const movedPaths = new Set<string>();
|
|
1207
|
+
for (const data of Object.values(results)) {
|
|
1208
|
+
// An archiver that threw records `{error}` with no moved[] — the
|
|
1209
|
+
// regen set under-counts its partial moves (pre-existing shape).
|
|
1210
|
+
const moved = (data as { moved?: Array<Record<string, unknown>> })?.moved;
|
|
1211
|
+
if (!Array.isArray(moved)) continue;
|
|
1212
|
+
for (const entry of moved) {
|
|
1213
|
+
for (const key of ["from", "to", "file"] as const) {
|
|
1214
|
+
const value = entry[key];
|
|
1215
|
+
if (typeof value === "string" && value.length > 0) movedPaths.add(value);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
const regen = await runArchiveRegen({ movedPaths: [...movedPaths], context: routedContext });
|
|
1220
|
+
regenerated = regen.regenerated;
|
|
1221
|
+
regenFailures = regen.failures;
|
|
1222
|
+
regenSkipped = regen.skipped;
|
|
1223
|
+
regenExcluded = regen.excluded;
|
|
1224
|
+
if (outputFormat === "pretty") {
|
|
1225
|
+
for (const regeneratedPath of regenerated) {
|
|
1226
|
+
logger.info(` docs.archive: regenerated ${regeneratedPath}`);
|
|
1227
|
+
}
|
|
1228
|
+
for (const item of regenExcluded) {
|
|
1229
|
+
logger.info(` docs.archive: regen excluded ${item.command} (${item.reason})`);
|
|
1230
|
+
}
|
|
1231
|
+
if (regen.skipReason === "no-invoke") {
|
|
1232
|
+
logger.info(" docs.archive: regen skipped — no invoke port (standalone CLI)");
|
|
1233
|
+
} else if (regen.skipReason === "no-inventory") {
|
|
1234
|
+
logger.info(" docs.archive: regen skipped — no command inventory");
|
|
1235
|
+
}
|
|
1236
|
+
for (const failure of regenFailures) {
|
|
1237
|
+
logger.error(
|
|
1238
|
+
` docs.archive: regen failed for ${failure.command}: ${failure.error}`,
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// RFC-1535 (F-0038): self-staging — every move lands BOTH sides in
|
|
1245
|
+
// the index (destination add + source delete) so the next commit
|
|
1246
|
+
// captures the move as one unit instead of splitting it across two
|
|
1247
|
+
// commits. --dry-run stays report-only: nothing is staged.
|
|
1248
|
+
let stagedMovePairs = 0;
|
|
1249
|
+
if (!dryRun && totalMoved > 0) {
|
|
1250
|
+
const stagePaths = new Set<string>();
|
|
1251
|
+
for (const data of Object.values(results)) {
|
|
1252
|
+
const moved = (data as { moved?: Array<Record<string, unknown>> })?.moved;
|
|
1253
|
+
if (!Array.isArray(moved)) continue;
|
|
1254
|
+
for (const entry of moved) {
|
|
1255
|
+
for (const key of ["from", "to"] as const) {
|
|
1256
|
+
const value = entry[key];
|
|
1257
|
+
if (typeof value === "string" && value.length > 0) stagePaths.add(value);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
const staged = await stageMovedPairs({
|
|
1262
|
+
movedPaths: [...stagePaths],
|
|
1263
|
+
workspaceRoot: routedContext.workspaceRoot,
|
|
1264
|
+
exec: (command, args, opts) => io.exec(command, args, opts),
|
|
1265
|
+
});
|
|
1266
|
+
if (staged.error) {
|
|
1267
|
+
// Non-fatal — the commit-side EC-31 check is the safety net
|
|
1268
|
+
// for any pair that stayed half-staged.
|
|
1269
|
+
if (outputFormat === "pretty") {
|
|
1270
|
+
logger.warn(
|
|
1271
|
+
` docs.archive: move staging failed — run 'git add -A docs/' before committing: ${staged.error}`,
|
|
1272
|
+
);
|
|
1273
|
+
}
|
|
1274
|
+
} else if (staged.staged > 0) {
|
|
1275
|
+
stagedMovePairs = staged.staged;
|
|
1276
|
+
if (outputFormat === "pretty") {
|
|
1277
|
+
logger.info(
|
|
1278
|
+
` docs.archive: staged ${staged.staged} move path(s) (both sides)`,
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1143
1284
|
if (outputFormat === "pretty") {
|
|
1144
1285
|
if (dryRun) {
|
|
1145
1286
|
logger.info(
|
|
@@ -1153,9 +1294,10 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
1153
1294
|
}
|
|
1154
1295
|
|
|
1155
1296
|
return {
|
|
1297
|
+
...(regenFailures.length > 0 ? { exitCode: 1 } : {}),
|
|
1156
1298
|
data: {
|
|
1157
1299
|
command: "docs.archive",
|
|
1158
|
-
status: "ok",
|
|
1300
|
+
status: regenFailures.length > 0 ? "fail" : "ok",
|
|
1159
1301
|
totalMoved,
|
|
1160
1302
|
totalSkipped,
|
|
1161
1303
|
results,
|
|
@@ -1163,6 +1305,11 @@ export async function createForgeCoreModule(): Promise<ForgeModule> {
|
|
|
1163
1305
|
liveSpecMerges: liveMergeResults.length,
|
|
1164
1306
|
liveSpecSkipped: liveMergeSkipped,
|
|
1165
1307
|
liveSpecFailures: liveMergeFailures.length,
|
|
1308
|
+
regenerated,
|
|
1309
|
+
regenSkipped,
|
|
1310
|
+
regenExcluded,
|
|
1311
|
+
regenFailures,
|
|
1312
|
+
stagedMovePairs,
|
|
1166
1313
|
},
|
|
1167
1314
|
summary: dryRun
|
|
1168
1315
|
? `[dry-run] Would move ${totalMoved} file(s), skip ${totalSkipped}`
|