@warpgogol/forge 5.2.3 → 5.3.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 +34 -2
- package/README.md +1 -1
- package/README.uk.md +8 -8
- package/bin/cli.ts +1 -0
- package/dist/bin/cli.js +1 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/adr.module.d.ts.map +1 -1
- package/dist/os/adr/adr.module.js +8 -3
- package/dist/os/adr/adr.module.js.map +1 -1
- package/dist/os/adr/frontmatter-io.js +5 -5
- package/dist/os/adr/frontmatter-io.js.map +1 -1
- package/dist/os/adr/handlers/archive.d.ts.map +1 -1
- package/dist/os/adr/handlers/archive.js +10 -4
- package/dist/os/adr/handlers/archive.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +10 -9
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/adr/handlers/list-create.js +5 -5
- package/dist/os/adr/handlers/list-create.js.map +1 -1
- package/dist/os/adr/handlers/validate.js +1 -1
- package/dist/os/adr/handlers/validate.js.map +1 -1
- package/dist/os/audit/audit.module.js +3 -3
- package/dist/os/audit/audit.module.js.map +1 -1
- package/dist/os/audit/frontmatter-io.js +5 -5
- package/dist/os/audit/frontmatter-io.js.map +1 -1
- package/dist/os/audit/handlers/archive.d.ts.map +1 -1
- package/dist/os/audit/handlers/archive.js +10 -4
- package/dist/os/audit/handlers/archive.js.map +1 -1
- package/dist/os/compass/compass.module.d.ts.map +1 -1
- package/dist/os/compass/compass.module.js +17 -1
- package/dist/os/compass/compass.module.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 +12 -5
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-change-summary-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-change-summary-handler.js +3 -2
- package/dist/os/compass/handlers/compass-change-summary-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.js +6 -4
- package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-inventory.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory.js +10 -8
- package/dist/os/compass/handlers/compass-inventory.js.map +1 -1
- package/dist/os/compass/handlers/compass-migrate-handler.js +1 -1
- package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-migrate.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-migrate.js +6 -3
- package/dist/os/compass/handlers/compass-migrate.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +9 -6
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/resolve-scan-root.js +1 -1
- package/dist/os/compass/handlers/resolve-scan-root.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +8 -4
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +57 -4
- 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 +6 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/build.js +1 -1
- package/dist/os/core/handlers/build.js.map +1 -1
- package/dist/os/core/handlers/determinism-check.d.ts.map +1 -1
- package/dist/os/core/handlers/determinism-check.js +10 -6
- package/dist/os/core/handlers/determinism-check.js.map +1 -1
- package/dist/os/core/handlers/dev.js +1 -1
- package/dist/os/core/handlers/dev.js.map +1 -1
- package/dist/os/core/handlers/file-size-lint.d.ts.map +1 -1
- package/dist/os/core/handlers/file-size-lint.js +11 -7
- package/dist/os/core/handlers/file-size-lint.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 +9 -5
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/knowledge-compact.js +1 -1
- package/dist/os/core/handlers/knowledge-compact.js.map +1 -1
- package/dist/os/core/handlers/package-health.js +1 -1
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/core/handlers/pinned-check.js +2 -2
- package/dist/os/core/handlers/pinned-check.js.map +1 -1
- package/dist/os/core/handlers/pinned-init.d.ts.map +1 -1
- package/dist/os/core/handlers/pinned-init.js +9 -8
- package/dist/os/core/handlers/pinned-init.js.map +1 -1
- package/dist/os/core/handlers/pinned-validate.js +3 -3
- package/dist/os/core/handlers/pinned-validate.js.map +1 -1
- package/dist/os/core/handlers/profile-resolve.js +1 -1
- package/dist/os/core/handlers/profile-resolve.js.map +1 -1
- package/dist/os/core/handlers/public-surface.js +1 -1
- package/dist/os/core/handlers/public-surface.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +10 -6
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/core/handlers/release-publish.js +6 -6
- package/dist/os/core/handlers/release-publish.js.map +1 -1
- package/dist/os/core/handlers/validate.js +1 -1
- package/dist/os/core/handlers/validate.js.map +1 -1
- package/dist/os/exploration/exploration.module.d.ts.map +1 -1
- package/dist/os/exploration/exploration.module.js +1 -0
- package/dist/os/exploration/exploration.module.js.map +1 -1
- package/dist/os/exploration/frontmatter-io.js +4 -4
- package/dist/os/exploration/frontmatter-io.js.map +1 -1
- package/dist/os/exploration/handlers/archive.js +3 -3
- package/dist/os/exploration/handlers/archive.js.map +1 -1
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +22 -19
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/mission.module.js +3 -3
- package/dist/os/mission/mission.module.js.map +1 -1
- package/dist/os/naming/naming-convention.d.ts.map +1 -1
- package/dist/os/naming/naming-convention.js +7 -3
- package/dist/os/naming/naming-convention.js.map +1 -1
- package/dist/os/naming/naming.module.d.ts.map +1 -1
- package/dist/os/naming/naming.module.js +4 -3
- package/dist/os/naming/naming.module.js.map +1 -1
- package/dist/os/notes/notes.module.d.ts.map +1 -1
- package/dist/os/notes/notes.module.js +6 -3
- package/dist/os/notes/notes.module.js.map +1 -1
- package/dist/os/plan/frontmatter-io.js +5 -5
- package/dist/os/plan/frontmatter-io.js.map +1 -1
- package/dist/os/plan/handlers/archive.d.ts.map +1 -1
- package/dist/os/plan/handlers/archive.js +10 -4
- package/dist/os/plan/handlers/archive.js.map +1 -1
- package/dist/os/plan/plan.module.js +3 -3
- package/dist/os/plan/plan.module.js.map +1 -1
- package/dist/os/plugin/plugin.module.d.ts.map +1 -1
- package/dist/os/plugin/plugin.module.js +6 -3
- package/dist/os/plugin/plugin.module.js.map +1 -1
- package/dist/os/program/discovery.js +2 -2
- package/dist/os/program/discovery.js.map +1 -1
- package/dist/os/program/handlers/complete.js +1 -1
- package/dist/os/program/handlers/complete.js.map +1 -1
- package/dist/os/program/handlers/lease.js +1 -1
- package/dist/os/program/handlers/lease.js.map +1 -1
- package/dist/os/program/handlers/seal.js +1 -1
- package/dist/os/program/handlers/seal.js.map +1 -1
- package/dist/os/program/lease.js +1 -1
- package/dist/os/program/lease.js.map +1 -1
- package/dist/os/program/program.module.d.ts.map +1 -1
- package/dist/os/program/program.module.js +9 -3
- package/dist/os/program/program.module.js.map +1 -1
- package/dist/os/queue/index.js +1 -1
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +4 -8
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +10 -6
- 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 +4 -3
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/dna-trace.d.ts.map +1 -1
- package/dist/os/rfc/dna-trace.js +7 -2
- package/dist/os/rfc/dna-trace.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +5 -5
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/archive.d.ts.map +1 -1
- package/dist/os/rfc/handlers/archive.js +11 -5
- package/dist/os/rfc/handlers/archive.js.map +1 -1
- package/dist/os/rfc/handlers/check.d.ts.map +1 -1
- package/dist/os/rfc/handlers/check.js +6 -3
- package/dist/os/rfc/handlers/check.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +11 -10
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +3 -3
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/lifecycle.d.ts.map +1 -1
- package/dist/os/rfc/handlers/lifecycle.js +6 -2
- package/dist/os/rfc/handlers/lifecycle.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +7 -6
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/shared.js +3 -3
- package/dist/os/rfc/handlers/shared.js.map +1 -1
- package/dist/os/rfc/handlers/supersede-propose.d.ts.map +1 -1
- package/dist/os/rfc/handlers/supersede-propose.js +7 -3
- package/dist/os/rfc/handlers/supersede-propose.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +8 -5
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +44 -4
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +9 -5
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
- package/dist/os/rfc/verification-refresh.js +4 -3
- package/dist/os/rfc/verification-refresh.js.map +1 -1
- package/dist/os/session/frontmatter-io.js +12 -12
- package/dist/os/session/frontmatter-io.js.map +1 -1
- package/dist/os/session/handlers/archive.d.ts.map +1 -1
- package/dist/os/session/handlers/archive.js +10 -4
- package/dist/os/session/handlers/archive.js.map +1 -1
- package/dist/os/session/handlers/metrics-aggregate.d.ts.map +1 -1
- package/dist/os/session/handlers/metrics-aggregate.js +9 -5
- package/dist/os/session/handlers/metrics-aggregate.js.map +1 -1
- package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
- package/dist/os/session/handlers/metrics-rfc.js +11 -8
- package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
- package/dist/os/session/handlers/metrics-session.d.ts.map +1 -1
- package/dist/os/session/handlers/metrics-session.js +6 -3
- package/dist/os/session/handlers/metrics-session.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +14 -8
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/session/session.module.d.ts.map +1 -1
- package/dist/os/session/session.module.js +6 -0
- package/dist/os/session/session.module.js.map +1 -1
- package/dist/os/spec/live-spec-list.js +4 -4
- package/dist/os/spec/live-spec-list.js.map +1 -1
- package/dist/os/spec/live-spec-merge.js +5 -5
- package/dist/os/spec/live-spec-merge.js.map +1 -1
- package/dist/os/spec/live-spec-show.js +3 -3
- package/dist/os/spec/live-spec-show.js.map +1 -1
- package/dist/os/spec/live-spec-validate.js +4 -4
- package/dist/os/spec/live-spec-validate.js.map +1 -1
- package/dist/os/spec/spec-materialize.js +9 -9
- package/dist/os/spec/spec-materialize.js.map +1 -1
- package/dist/os/spec/spec-status.js +9 -9
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.js +7 -7
- 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 +8 -0
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/werkstatt/handlers/lock.js +16 -16
- package/dist/os/werkstatt/handlers/lock.js.map +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +3 -3
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +3 -2
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.js +6 -2
- package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
- package/dist/os/workflow/handlers.d.ts.map +1 -1
- package/dist/os/workflow/handlers.js +8 -5
- package/dist/os/workflow/handlers.js.map +1 -1
- package/dist/os/workflow/workflow.module.d.ts.map +1 -1
- package/dist/os/workflow/workflow.module.js +6 -3
- package/dist/os/workflow/workflow.module.js.map +1 -1
- package/dist/src/compass/contract-registry.js +1 -1
- package/dist/src/compass/contract-registry.js.map +1 -1
- package/dist/src/config/forge-config.d.ts +10 -1
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +8 -1
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/knowledge/budgets.js +1 -1
- package/dist/src/knowledge/budgets.js.map +1 -1
- package/dist/src/knowledge/compact.js +1 -1
- package/dist/src/knowledge/compact.js.map +1 -1
- package/dist/src/knowledge/parse.js +1 -1
- package/dist/src/knowledge/parse.js.map +1 -1
- package/dist/src/knowledge/sync.d.ts.map +1 -1
- package/dist/src/knowledge/sync.js +3 -5
- package/dist/src/knowledge/sync.js.map +1 -1
- package/dist/src/migration-adapters/git-utils.js +2 -2
- package/dist/src/migration-adapters/git-utils.js.map +1 -1
- package/dist/src/migration-adapters/ignored-files.js +2 -2
- package/dist/src/migration-adapters/ignored-files.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/onboarding/agents-generate.d.ts +2 -0
- package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/agents-generate.js +73 -48
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/create.d.ts.map +1 -1
- package/dist/src/onboarding/create.js +10 -10
- package/dist/src/onboarding/create.js.map +1 -1
- package/dist/src/onboarding/doctor.d.ts +6 -0
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +179 -61
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/init.d.ts.map +1 -1
- package/dist/src/onboarding/init.js +30 -1
- package/dist/src/onboarding/init.js.map +1 -1
- package/dist/src/onboarding/invariant-engine.js +1 -1
- package/dist/src/onboarding/invariant-engine.js.map +1 -1
- package/dist/src/onboarding/memory-compact.d.ts +22 -0
- package/dist/src/onboarding/memory-compact.d.ts.map +1 -0
- package/dist/src/onboarding/memory-compact.js +148 -0
- package/dist/src/onboarding/memory-compact.js.map +1 -0
- package/dist/src/onboarding/memory-scaffold.d.ts +1 -0
- package/dist/src/onboarding/memory-scaffold.d.ts.map +1 -1
- package/dist/src/onboarding/memory-scaffold.js +2 -2
- package/dist/src/onboarding/memory-scaffold.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts +4 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +35 -6
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-templates.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-templates.js +8 -12
- package/dist/src/onboarding/nested-agents-templates.js.map +1 -1
- package/dist/src/onboarding/npm-token-check.js +2 -2
- package/dist/src/onboarding/npm-token-check.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts +29 -0
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -0
- package/dist/src/onboarding/prettierignore.js +231 -0
- package/dist/src/onboarding/prettierignore.js.map +1 -0
- package/dist/src/onboarding/profile-validate.d.ts.map +1 -1
- package/dist/src/onboarding/profile-validate.js +5 -4
- package/dist/src/onboarding/profile-validate.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.d.ts.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +35 -27
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/scaffold.js +1 -1
- package/dist/src/onboarding/scaffold.js.map +1 -1
- package/dist/src/onboarding/skill-markers.d.ts +27 -0
- package/dist/src/onboarding/skill-markers.d.ts.map +1 -0
- package/dist/src/onboarding/skill-markers.js +131 -0
- package/dist/src/onboarding/skill-markers.js.map +1 -0
- package/dist/src/onboarding/upgrade.d.ts +10 -0
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +215 -74
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +15 -3
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/pipeline-status.d.ts +6 -5
- package/dist/src/pipeline-status.d.ts.map +1 -1
- package/dist/src/pipeline-status.js +24 -19
- package/dist/src/pipeline-status.js.map +1 -1
- package/dist/src/profiles/stack-profile.js +1 -1
- package/dist/src/profiles/stack-profile.js.map +1 -1
- package/dist/src/registry.d.ts +1 -1
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +3 -3
- package/dist/src/registry.js.map +1 -1
- package/dist/src/skill-schema.d.ts +1 -1
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +4 -1
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/types.d.ts +116 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/editable-region.d.ts +46 -0
- package/dist/src/utils/editable-region.d.ts.map +1 -0
- package/dist/src/utils/editable-region.js +125 -0
- package/dist/src/utils/editable-region.js.map +1 -0
- package/dist/src/utils/fs-idempotent.d.ts +2 -1
- package/dist/src/utils/fs-idempotent.d.ts.map +1 -1
- package/dist/src/utils/fs-idempotent.js +11 -7
- package/dist/src/utils/fs-idempotent.js.map +1 -1
- package/dist/src/utils/generated-marker.d.ts +17 -0
- package/dist/src/utils/generated-marker.d.ts.map +1 -1
- package/dist/src/utils/generated-marker.js +29 -1
- package/dist/src/utils/generated-marker.js.map +1 -1
- package/dist/src/utils/index.d.ts +3 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +3 -1
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/io.d.ts +9 -0
- package/dist/src/utils/io.d.ts.map +1 -0
- package/dist/src/utils/io.js +130 -0
- package/dist/src/utils/io.js.map +1 -0
- package/dist/src/utils/markdown-table.d.ts +21 -0
- package/dist/src/utils/markdown-table.d.ts.map +1 -0
- package/dist/src/utils/markdown-table.js +116 -0
- package/dist/src/utils/markdown-table.js.map +1 -0
- package/dist/src/utils/sync-fs.d.ts +5 -0
- package/dist/src/utils/sync-fs.d.ts.map +1 -0
- package/dist/src/utils/sync-fs.js +26 -0
- package/dist/src/utils/sync-fs.js.map +1 -0
- package/dist/src/validators/note-frontmatter-validate.js +1 -1
- package/dist/src/validators/note-frontmatter-validate.js.map +1 -1
- package/dist/src/validators/note-link-validate.js +1 -1
- package/dist/src/validators/note-link-validate.js.map +1 -1
- package/dist/src/validators/note-orphan-detect.js +1 -1
- package/dist/src/validators/note-orphan-detect.js.map +1 -1
- package/dist/src/validators/port-validate.js +1 -1
- package/dist/src/validators/port-validate.js.map +1 -1
- package/dist/src/validators/skill-validate.d.ts.map +1 -1
- package/dist/src/validators/skill-validate.js +34 -13
- package/dist/src/validators/skill-validate.js.map +1 -1
- package/docs/reference/forge-yaml.md +12 -0
- package/os/adr/adr.module.ts +136 -132
- package/os/adr/frontmatter-io.ts +5 -5
- package/os/adr/handlers/archive.ts +8 -4
- package/os/adr/handlers/implement-stamp.ts +14 -9
- package/os/adr/handlers/list-create.ts +5 -5
- package/os/adr/handlers/validate.ts +1 -1
- package/os/audit/audit.module.ts +33 -34
- package/os/audit/frontmatter-io.ts +5 -5
- package/os/audit/handlers/archive.ts +8 -4
- package/os/compass/compass.module.ts +17 -1
- package/os/compass/handlers/compass-audit-handler.ts +13 -5
- package/os/compass/handlers/compass-change-summary-handler.ts +4 -2
- package/os/compass/handlers/compass-inventory-handler.ts +7 -4
- package/os/compass/handlers/compass-inventory.ts +11 -8
- package/os/compass/handlers/compass-migrate-handler.ts +1 -1
- package/os/compass/handlers/compass-migrate.ts +7 -3
- package/os/compass/handlers/git-revision.ts +11 -6
- package/os/compass/handlers/resolve-scan-root.ts +1 -1
- package/os/compass/handlers/summary-record.ts +10 -4
- package/os/compass/handlers/tests/compass-audit-plan.test.ts +2 -1
- package/os/core/core.module.ts +58 -4
- package/os/core/handlers/assets-helpers.ts +7 -3
- package/os/core/handlers/build.ts +1 -1
- package/os/core/handlers/determinism-check.ts +12 -6
- package/os/core/handlers/dev.ts +1 -1
- package/os/core/handlers/file-size-lint.ts +16 -9
- package/os/core/handlers/forge-autonomy-validate.ts +10 -5
- package/os/core/handlers/knowledge-compact.ts +1 -1
- package/os/core/handlers/package-health.ts +1 -1
- package/os/core/handlers/pinned-check.ts +2 -2
- package/os/core/handlers/pinned-init.ts +9 -8
- package/os/core/handlers/pinned-validate.ts +3 -3
- package/os/core/handlers/profile-resolve.ts +1 -1
- package/os/core/handlers/public-surface.ts +1 -1
- package/os/core/handlers/release-prepare.ts +11 -6
- package/os/core/handlers/release-publish.ts +6 -6
- package/os/core/handlers/validate.ts +1 -1
- package/os/exploration/exploration.module.ts +1 -0
- package/os/exploration/frontmatter-io.ts +4 -4
- package/os/exploration/handlers/archive.ts +3 -3
- package/os/mission/handlers/archive.ts +27 -19
- package/os/mission/mission.module.ts +38 -39
- package/os/naming/naming-convention.ts +9 -3
- package/os/naming/naming.module.ts +25 -25
- package/os/notes/notes.module.ts +87 -85
- package/os/plan/frontmatter-io.ts +5 -5
- package/os/plan/handlers/archive.ts +8 -4
- package/os/plan/plan.module.ts +33 -34
- package/os/plugin/plugin.module.ts +8 -6
- package/os/program/discovery.ts +2 -2
- package/os/program/handlers/complete.ts +1 -1
- package/os/program/handlers/lease.ts +1 -1
- package/os/program/handlers/seal.ts +1 -1
- package/os/program/lease.ts +1 -1
- package/os/program/program.module.ts +198 -193
- package/os/queue/index.ts +1 -1
- package/os/queue/manifest.ts +10 -9
- package/os/queue/queue-validate.test.ts +6 -15
- package/os/rfc/acceptance.ts +12 -6
- package/os/rfc/decision-log.ts +4 -3
- package/os/rfc/dna-trace.ts +8 -2
- package/os/rfc/frontmatter-io.ts +5 -5
- package/os/rfc/handlers/archive.ts +9 -5
- package/os/rfc/handlers/check.ts +5 -3
- package/os/rfc/handlers/implement-stamp.ts +15 -10
- package/os/rfc/handlers/index-graph.ts +3 -3
- package/os/rfc/handlers/lifecycle.ts +7 -2
- package/os/rfc/handlers/list-create.ts +7 -6
- package/os/rfc/handlers/shared.ts +3 -3
- package/os/rfc/handlers/supersede-propose.ts +8 -3
- package/os/rfc/handlers/validate-rules-rfc1006.test.ts +18 -6
- package/os/rfc/handlers/validate-rules.ts +10 -5
- package/os/rfc/rfc-create-concurrent.test.ts +11 -3
- package/os/rfc/rfc.module.ts +413 -374
- package/os/rfc/verification-evidence.ts +11 -5
- package/os/rfc/verification-refresh.ts +4 -3
- package/os/session/frontmatter-io.ts +14 -14
- package/os/session/handlers/archive.ts +8 -4
- package/os/session/handlers/metrics-aggregate.ts +34 -13
- package/os/session/handlers/metrics-rfc.ts +13 -8
- package/os/session/handlers/metrics-session.ts +7 -3
- package/os/session/handlers/save.ts +12 -8
- package/os/session/session.module.ts +6 -0
- package/os/spec/live-spec-list.ts +4 -4
- package/os/spec/live-spec-merge.ts +5 -5
- package/os/spec/live-spec-show.ts +3 -3
- package/os/spec/live-spec-validate.ts +4 -4
- package/os/spec/spec-materialize.ts +9 -9
- package/os/spec/spec-status.ts +9 -9
- package/os/spec/spec-validate.ts +7 -7
- package/os/spec/spec.module.ts +8 -0
- package/os/werkstatt/handlers/lock.ts +16 -16
- package/os/werkstatt/handlers/werkstatt-lock-recover.ts +3 -3
- package/os/werkstatt/handlers/werkstatt-operation-validate.ts +4 -2
- package/os/werkstatt/werkstatt.module.ts +8 -5
- package/os/workflow/handlers.ts +7 -5
- package/os/workflow/workflow.module.ts +45 -44
- package/package.json +1 -1
- package/profiles/forge-shell.yaml +3 -0
- package/profiles/godot-game.yaml +3 -0
- package/profiles/phaser-game.yaml +3 -0
- package/profiles/site-workshop.yaml +567 -564
- package/skills/fo/fo-add-tests/SKILL.md +2 -2
- package/skills/fo/fo-architecture/SKILL.md +2 -2
- package/skills/fo/fo-compass-annotate/SKILL.md +2 -2
- package/skills/fo/fo-design-summit/SKILL.md +2 -2
- package/skills/fo/fo-doc-audit/SKILL.md +2 -2
- package/skills/fo/fo-explore/SKILL.md +2 -2
- package/skills/fo/fo-extract-dna/SKILL.md +2 -2
- package/skills/fo/fo-fix/SKILL.md +2 -2
- package/skills/fo/fo-handoff/SKILL.md +2 -2
- package/skills/fo/fo-harvest/SKILL.md +2 -2
- package/skills/fo/fo-idea/SKILL.md +2 -2
- package/skills/fo/fo-idea-audit/SKILL.md +2 -2
- package/skills/fo/fo-idea-create-adr/SKILL.md +3 -3
- package/skills/fo/fo-idea-create-rfc/SKILL.md +3 -3
- package/skills/fo/fo-idea-enhance/SKILL.md +2 -2
- package/skills/fo/fo-idea-i-just-want-to-see-the-plan/SKILL.md +2 -2
- package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +1 -1
- package/skills/fo/fo-idea-implement/SKILL.md +2 -2
- package/skills/fo/fo-idea-plan/SKILL.md +2 -2
- package/skills/fo/fo-idea-status/SKILL.md +2 -2
- package/skills/fo/fo-knowledge-distill/SKILL.md +2 -2
- package/skills/fo/fo-memory-sync/SKILL.md +2 -2
- package/skills/fo/fo-qa/SKILL.md +2 -2
- package/skills/fo/fo-review/SKILL.md +2 -2
- package/skills/fo/fo-session-retro/SKILL.md +2 -2
- package/skills/fo/fo-session-save/SKILL.md +2 -2
- package/skills/fo/fo-spec-ingest/SKILL.md +2 -2
- package/skills/fo/fo-step-commit/SKILL.md +1 -1
- package/skills/fo/fo-triage/SKILL.md +2 -2
- package/skills/meta/forge-bootstrap/SKILL.md +1 -1
- package/skills/meta/port-to-forge/SKILL.md +1 -1
- package/skills/meta/skill-create/SKILL.md +1 -1
- package/skills/shared/grilling/SKILL.md +1 -1
- package/skills/shared/grilling/learned-principles.archive.md +17 -0
- package/skills/shared/grilling/learned-principles.md +0 -1
- package/skills/shared/knowledge/learned-principles.md +6 -0
- package/skills/shared/my-preferences/SKILL.md +1 -1
- package/skills/shared/windows-ai-tooling/SKILL.md +1 -1
- package/skills/shared/writing-great-skills/SKILL.md +1 -1
- package/src/compass/contract-registry.ts +1 -1
- package/src/config/forge-config.ts +12 -1
- package/src/knowledge/__tests__/sync.test.ts +2 -7
- package/src/knowledge/budgets.ts +1 -1
- package/src/knowledge/compact.ts +1 -1
- package/src/knowledge/parse.ts +1 -1
- package/src/knowledge/sync.ts +3 -5
- package/src/migration-adapters/git-utils.ts +2 -2
- package/src/migration-adapters/ignored-files.ts +2 -2
- package/src/migration-adapters/node-typescript-pnpm/index.ts +1 -1
- package/src/migration-adapters/phaser-pnpm/index.ts +1 -1
- package/src/onboarding/agents-generate.ts +91 -50
- package/src/onboarding/create.ts +10 -10
- package/src/onboarding/doctor.ts +199 -59
- package/src/onboarding/init.ts +38 -1
- package/src/onboarding/invariant-engine.ts +1 -1
- package/src/onboarding/memory-compact.ts +189 -0
- package/src/onboarding/memory-scaffold.ts +2 -2
- package/src/onboarding/nested-agents-generate.ts +50 -5
- package/src/onboarding/nested-agents-templates.ts +19 -13
- package/src/onboarding/npm-token-check.ts +2 -2
- package/src/onboarding/prettierignore.ts +263 -0
- package/src/onboarding/profile-validate.ts +5 -4
- package/src/onboarding/scaffold-project.ts +38 -27
- package/src/onboarding/scaffold.ts +1 -1
- package/src/onboarding/skill-markers.ts +162 -0
- package/src/onboarding/templates/behavioral-layer-core.md +2 -4
- package/src/onboarding/upgrade.ts +285 -89
- package/src/onboarding/workspace-discovery.ts +16 -2
- package/src/pipeline-status.test.ts +1 -4
- package/src/pipeline-status.ts +30 -13
- package/src/profiles/stack-profile.ts +1 -1
- package/src/registry.ts +4 -4
- package/src/skill-schema.ts +4 -1
- package/src/tests/acceptance-probe-kinds.test.ts +5 -15
- package/src/tests/agents-generate.test.ts +32 -7
- package/src/tests/contract-registry.test.ts +12 -6
- package/src/tests/doctor-dist-freshness.test.ts +110 -0
- package/src/tests/doctor-fix.test.ts +142 -0
- package/src/tests/doctor-nested-agents.test.ts +160 -0
- package/src/tests/editable-generated-region.test.ts +231 -0
- package/src/tests/file-size-lint.test.ts +8 -12
- package/src/tests/fixtures/agents-generate-business-before.txt +54 -54
- package/src/tests/markdown-table.test.ts +107 -0
- package/src/tests/memory-compact.test.ts +143 -0
- package/src/tests/prettierignore-manage.test.ts +134 -0
- package/src/tests/skill-agents-sync.test.ts +168 -0
- package/src/tests/skill-sync-marker.test.ts +134 -0
- package/src/tests/skill-validate.test.ts +12 -5
- package/src/tests/upgrade.test.ts +87 -41
- package/src/tests/workspace-discovery.test.ts +28 -0
- package/src/types.ts +123 -0
- package/src/utils/editable-region.ts +156 -0
- package/src/utils/fs-idempotent.ts +12 -6
- package/src/utils/generated-marker.ts +36 -2
- package/src/utils/index.ts +17 -0
- package/src/utils/io.ts +143 -0
- package/src/utils/markdown-table.ts +121 -0
- package/src/utils/sync-fs.ts +43 -0
- package/src/validators/note-frontmatter-validate.ts +1 -1
- package/src/validators/note-link-validate.ts +1 -1
- package/src/validators/note-orphan-detect.ts +1 -1
- package/src/validators/port-validate.ts +1 -1
- package/src/validators/skill-validate.ts +38 -13
|
@@ -18,9 +18,8 @@ Sweep batch 4: 73 Compass headers on headerless engine files (certification, com
|
|
|
18
18
|
</CHANGE_SUMMARY>
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import fs from "node:fs";
|
|
22
21
|
import path from "node:path";
|
|
23
|
-
import {
|
|
22
|
+
import { resolveIo } from "../utils/io.ts";
|
|
24
23
|
import { listStackProfiles, type StackProfile } from "../profiles/stack-profile.ts";
|
|
25
24
|
import { checkNpmToken, workshopNeedsWarpgogolToken } from "./npm-token-check.ts";
|
|
26
25
|
import { resolveForgeRoot } from "../config/forge-config.ts";
|
|
@@ -45,6 +44,18 @@ export async function runScaffoldProject(
|
|
|
45
44
|
context: ForgeRuntimeContext,
|
|
46
45
|
): Promise<ForgeCommandResult<ScaffoldProjectResult>> {
|
|
47
46
|
const { workspaceRoot, logger, outputFormat } = context;
|
|
47
|
+
const fio = resolveIo(context.io);
|
|
48
|
+
const execCommand = async (
|
|
49
|
+
cmd: string,
|
|
50
|
+
cwd: string,
|
|
51
|
+
timeoutMs: number,
|
|
52
|
+
): Promise<{ ok: boolean; stdout: string; stderr: string }> => {
|
|
53
|
+
const parts = cmd.split(/\s+/).filter(Boolean);
|
|
54
|
+
const res = await fio
|
|
55
|
+
.exec(parts[0]!, parts.slice(1), { cwd, timeoutMs })
|
|
56
|
+
.catch((err: Error) => ({ exitCode: null, stdout: "", stderr: String(err) }));
|
|
57
|
+
return { ok: res.exitCode === 0, stdout: res.stdout, stderr: res.stderr };
|
|
58
|
+
};
|
|
48
59
|
const profileId = input.flags["profile"] as string | undefined;
|
|
49
60
|
const projectName = input.flags["name"] as string | undefined;
|
|
50
61
|
const templateId = input.flags["template"] as string | undefined;
|
|
@@ -98,16 +109,16 @@ export async function runScaffoldProject(
|
|
|
98
109
|
// Create workspace directories
|
|
99
110
|
for (const dir of profile.workspace.dirs) {
|
|
100
111
|
const dirPath = path.join(workspaceRoot, dir);
|
|
101
|
-
|
|
112
|
+
await fio.mkdir(dirPath);
|
|
102
113
|
created.push(`${dir}/`);
|
|
103
114
|
}
|
|
104
115
|
|
|
105
116
|
// Create workspace files (with __PROJECT_NAME__ placeholder replacement)
|
|
106
117
|
for (const file of profile.workspace.files) {
|
|
107
118
|
const filePath = path.join(workspaceRoot, file.path);
|
|
108
|
-
|
|
119
|
+
await fio.mkdir(path.dirname(filePath));
|
|
109
120
|
const content = file.content.replace(/__PROJECT_NAME__/g, effectiveProjectName);
|
|
110
|
-
|
|
121
|
+
await fio.writeFile(filePath, content);
|
|
111
122
|
created.push(file.path);
|
|
112
123
|
}
|
|
113
124
|
|
|
@@ -117,13 +128,13 @@ export async function runScaffoldProject(
|
|
|
117
128
|
// Profiles may already include .npmrc in workspace.files — append the setting if missing.
|
|
118
129
|
const npmrcPath = path.join(workspaceRoot, ".npmrc");
|
|
119
130
|
if (profile.install.length > 0) {
|
|
120
|
-
if (
|
|
121
|
-
const existing =
|
|
131
|
+
if (await fio.exists(npmrcPath)) {
|
|
132
|
+
const existing = await fio.readFile(npmrcPath);
|
|
122
133
|
if (!existing.includes("ignore-workspace-root-check=true")) {
|
|
123
|
-
|
|
134
|
+
await fio.appendFile(npmrcPath, "ignore-workspace-root-check=true\n");
|
|
124
135
|
}
|
|
125
136
|
} else {
|
|
126
|
-
|
|
137
|
+
await fio.writeFile(npmrcPath, "ignore-workspace-root-check=true\n");
|
|
127
138
|
created.push(".npmrc");
|
|
128
139
|
}
|
|
129
140
|
}
|
|
@@ -152,17 +163,17 @@ export async function runScaffoldProject(
|
|
|
152
163
|
if (effectiveFirstWorkspace) {
|
|
153
164
|
const wsPath = effectiveFirstWorkspace.path.replace("my-site", effectiveProjectName).replace("my-game", effectiveProjectName);
|
|
154
165
|
const wsDir = path.join(workspaceRoot, wsPath);
|
|
155
|
-
|
|
166
|
+
await fio.mkdir(wsDir);
|
|
156
167
|
created.push(`${wsPath}/`);
|
|
157
168
|
|
|
158
169
|
for (const file of effectiveFirstWorkspace.files) {
|
|
159
170
|
const filePath = path.join(wsDir, file.path);
|
|
160
|
-
|
|
171
|
+
await fio.mkdir(path.dirname(filePath));
|
|
161
172
|
// Replace placeholder names (quoted and bare)
|
|
162
173
|
const content = file.content
|
|
163
174
|
.replace(/my-site/g, effectiveProjectName)
|
|
164
175
|
.replace(/my-game/g, effectiveProjectName);
|
|
165
|
-
|
|
176
|
+
await fio.writeFile(filePath, content);
|
|
166
177
|
created.push(`${wsPath}/${file.path}`);
|
|
167
178
|
}
|
|
168
179
|
}
|
|
@@ -186,16 +197,17 @@ export async function runScaffoldProject(
|
|
|
186
197
|
if (outputFormat === "pretty") {
|
|
187
198
|
logger.info(`Running: ${cmd}`);
|
|
188
199
|
}
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
const res = await execCommand(cmd, workspaceRoot, 60000);
|
|
201
|
+
if (res.ok) {
|
|
191
202
|
installLog.push(`${cmd} — ok`);
|
|
192
203
|
if (outputFormat === "pretty") {
|
|
193
204
|
logger.success(`Finished: ${cmd}`);
|
|
194
205
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
206
|
+
if (outputFormat === "pretty") {
|
|
207
|
+
logger.success(`Finished: ${cmd}`);
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
const details = [res.stderr.trim(), res.stdout.trim()].filter(Boolean).join("\n");
|
|
199
211
|
// pnpm v10 exits non-zero for ERR_PNPM_IGNORED_BUILDS even when install succeeded
|
|
200
212
|
if (details.includes("ERR_PNPM_IGNORED_BUILDS")) {
|
|
201
213
|
installLog.push(`${cmd} — ok (build scripts ignored)`);
|
|
@@ -203,7 +215,7 @@ export async function runScaffoldProject(
|
|
|
203
215
|
logger.success(`Finished: ${cmd} (build scripts ignored — run 'pnpm approve-builds' later)`);
|
|
204
216
|
}
|
|
205
217
|
} else {
|
|
206
|
-
installLog.push(`${cmd} — FAILED: ${details ||
|
|
218
|
+
installLog.push(`${cmd} — FAILED: ${details || "non-zero exit"}`);
|
|
207
219
|
if (outputFormat === "pretty") {
|
|
208
220
|
logger.warn(`Install failed (non-fatal): ${cmd}`);
|
|
209
221
|
if (details) logger.warn(details);
|
|
@@ -224,16 +236,14 @@ export async function runScaffoldProject(
|
|
|
224
236
|
if (outputFormat === "pretty") {
|
|
225
237
|
logger.info(`Running: ${cmd}`);
|
|
226
238
|
}
|
|
227
|
-
|
|
228
|
-
|
|
239
|
+
const res2 = await execCommand(cmd, wsDir, 60000);
|
|
240
|
+
if (res2.ok) {
|
|
229
241
|
installLog.push(`${cmd} — ok`);
|
|
230
242
|
if (outputFormat === "pretty") {
|
|
231
243
|
logger.success(`Finished: ${cmd}`);
|
|
232
244
|
}
|
|
233
|
-
}
|
|
234
|
-
const
|
|
235
|
-
const stdout = String((err as { stdout?: Buffer }).stdout ?? "").trim();
|
|
236
|
-
const details = [stderr, stdout].filter(Boolean).join("\n");
|
|
245
|
+
} else {
|
|
246
|
+
const details = [res2.stderr.trim(), res2.stdout.trim()].filter(Boolean).join("\n");
|
|
237
247
|
// pnpm v10 exits non-zero for ERR_PNPM_IGNORED_BUILDS even when install succeeded
|
|
238
248
|
if (details.includes("ERR_PNPM_IGNORED_BUILDS")) {
|
|
239
249
|
installLog.push(`${cmd} — ok (build scripts ignored)`);
|
|
@@ -241,7 +251,7 @@ export async function runScaffoldProject(
|
|
|
241
251
|
logger.success(`Finished: ${cmd} (build scripts ignored — run 'pnpm approve-builds' later)`);
|
|
242
252
|
}
|
|
243
253
|
} else {
|
|
244
|
-
errors.push(`Install step failed: ${cmd}\n${details ||
|
|
254
|
+
errors.push(`Install step failed: ${cmd}\n${details || "non-zero exit"}`);
|
|
245
255
|
if (outputFormat === "pretty") {
|
|
246
256
|
logger.error(`Install failed: ${cmd}`);
|
|
247
257
|
if (details) logger.error(details);
|
|
@@ -262,7 +272,8 @@ export async function runScaffoldProject(
|
|
|
262
272
|
if (outputFormat === "pretty") {
|
|
263
273
|
logger.info("Formatting generated files with prettier...");
|
|
264
274
|
}
|
|
265
|
-
|
|
275
|
+
const res3 = await execCommand("npx prettier --write .", workspaceRoot, 30000);
|
|
276
|
+
if (!res3.ok) throw new Error(res3.stderr || "prettier failed");
|
|
266
277
|
installLog.push("prettier --write . — ok");
|
|
267
278
|
if (outputFormat === "pretty") {
|
|
268
279
|
logger.success("Formatting complete.");
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1154: .forge-managed marker manifests for synced skill dirs and the
|
|
5
|
+
stale-dir prune for forge upgrade. Every skill-sync site records the files it
|
|
6
|
+
wrote into .agents/skills/<name>/ so a later upgrade can distinguish
|
|
7
|
+
forge-owned leftover dirs from consumer-authored skills — ownership is proven
|
|
8
|
+
by the marker, not inferred from the name.
|
|
9
|
+
</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>Do not prune unmarked dirs — no marker means consumer-owned (pre-RFC-1154 syncs, hand-authored skills).</item>
|
|
12
|
+
<item>Do not delete dirs containing files outside the manifest — consumer additions keep the dir.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
<KEY_DECISIONS>
|
|
15
|
+
<item>Marker is a per-dir JSON manifest ({ files: string[] }) — fail-safe: missing marker means no right to delete.</item>
|
|
16
|
+
<item>Prune only when on-disk contents ⊆ manifest files + marker; extras keep the dir and warn.</item>
|
|
17
|
+
</KEY_DECISIONS>
|
|
18
|
+
</MODULE_CONTRACT>
|
|
19
|
+
<CHANGE_SUMMARY>
|
|
20
|
+
<item>RFC-1154: initial implementation — SKILL_MARKER_FILE, writeSkillMarker, pruneStaleSkillDirs.</item>
|
|
21
|
+
</CHANGE_SUMMARY>
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import path from "node:path";
|
|
25
|
+
import type { WorkspaceIO } from "../types.ts";
|
|
26
|
+
import { resolveIo } from "../utils/io.ts";
|
|
27
|
+
import { writeFileIfChanged } from "../utils/fs-idempotent.ts";
|
|
28
|
+
import * as sfs from "../utils/sync-fs.ts";
|
|
29
|
+
|
|
30
|
+
/** Marker file name written into every forge-synced skill dir. */
|
|
31
|
+
export const SKILL_MARKER_FILE = ".forge-managed";
|
|
32
|
+
|
|
33
|
+
export interface SkillMarkerManifest {
|
|
34
|
+
files: string[]; // paths forge wrote into the skill dir, relative to it
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface PruneResult {
|
|
38
|
+
/** Stale marked dirs that were deleted (contents ⊆ manifest + marker). */
|
|
39
|
+
pruned: string[];
|
|
40
|
+
/** Marked stale dirs kept because extra consumer files exist or the marker is corrupt. */
|
|
41
|
+
keptWithConsumerFiles: string[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Canonical marker bytes — deterministic, sorted file list. */
|
|
45
|
+
export function buildSkillMarkerContent(files: string[]): string {
|
|
46
|
+
const manifest: SkillMarkerManifest = { files: [...files].sort() };
|
|
47
|
+
return JSON.stringify(manifest) + "\n";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Write the .forge-managed manifest into a synced skill dir (async/io path). */
|
|
51
|
+
export async function writeSkillMarker(
|
|
52
|
+
skillDir: string,
|
|
53
|
+
files: string[],
|
|
54
|
+
io?: WorkspaceIO,
|
|
55
|
+
): Promise<void> {
|
|
56
|
+
const fio = resolveIo(io);
|
|
57
|
+
await writeFileIfChanged(
|
|
58
|
+
path.join(skillDir, SKILL_MARKER_FILE),
|
|
59
|
+
buildSkillMarkerContent(files),
|
|
60
|
+
fio,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Sync twin for runInit (sync call path — no WorkspaceIO). */
|
|
65
|
+
export function writeSkillMarkerSync(skillDir: string, files: string[]): void {
|
|
66
|
+
const markerPath = path.join(skillDir, SKILL_MARKER_FILE);
|
|
67
|
+
const next = buildSkillMarkerContent(files);
|
|
68
|
+
try {
|
|
69
|
+
if (sfs.readFileSync(markerPath, "utf8") === next) return;
|
|
70
|
+
} catch {
|
|
71
|
+
// Marker absent or unreadable — write below
|
|
72
|
+
}
|
|
73
|
+
sfs.writeFileSync(markerPath, next, "utf8");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function parseMarker(raw: string): SkillMarkerManifest | null {
|
|
77
|
+
try {
|
|
78
|
+
const parsed = JSON.parse(raw) as unknown;
|
|
79
|
+
if (
|
|
80
|
+
typeof parsed === "object" &&
|
|
81
|
+
parsed !== null &&
|
|
82
|
+
Array.isArray((parsed as SkillMarkerManifest).files) &&
|
|
83
|
+
(parsed as SkillMarkerManifest).files.every((f) => typeof f === "string")
|
|
84
|
+
) {
|
|
85
|
+
return parsed as SkillMarkerManifest;
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
} catch {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Prune stale synced skill dirs under `agentsSkillsDir`: a dir is stale when it
|
|
95
|
+
* carries `.forge-managed` and its name is not in `currentSyncSet`. Deletion is
|
|
96
|
+
* allowed only when every file in the dir is listed in the manifest (or is the
|
|
97
|
+
* marker itself). Corrupt markers and dirs with extra files are kept and
|
|
98
|
+
* reported in `keptWithConsumerFiles`.
|
|
99
|
+
*/
|
|
100
|
+
export async function pruneStaleSkillDirs(
|
|
101
|
+
agentsSkillsDir: string,
|
|
102
|
+
currentSyncSet: Set<string>,
|
|
103
|
+
io?: WorkspaceIO,
|
|
104
|
+
): Promise<PruneResult> {
|
|
105
|
+
const fio = resolveIo(io);
|
|
106
|
+
const result: PruneResult = { pruned: [], keptWithConsumerFiles: [] };
|
|
107
|
+
|
|
108
|
+
let entries;
|
|
109
|
+
try {
|
|
110
|
+
entries = await fio.readdir(agentsSkillsDir);
|
|
111
|
+
} catch {
|
|
112
|
+
return result; // No skills dir — nothing to prune
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
for (const entry of entries) {
|
|
116
|
+
if (!entry.isDirectory) continue;
|
|
117
|
+
const name = entry.name;
|
|
118
|
+
if (currentSyncSet.has(name)) continue;
|
|
119
|
+
|
|
120
|
+
const dir = path.join(agentsSkillsDir, name);
|
|
121
|
+
const markerPath = path.join(dir, SKILL_MARKER_FILE);
|
|
122
|
+
if (!(await fio.exists(markerPath))) continue; // consumer-owned — never touch
|
|
123
|
+
|
|
124
|
+
let manifest: SkillMarkerManifest | null = null;
|
|
125
|
+
try {
|
|
126
|
+
manifest = parseMarker(await fio.readFile(markerPath));
|
|
127
|
+
} catch {
|
|
128
|
+
manifest = null;
|
|
129
|
+
}
|
|
130
|
+
if (!manifest) {
|
|
131
|
+
result.keptWithConsumerFiles.push(`${name} (corrupt marker)`);
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const allowed = new Set([...manifest.files, SKILL_MARKER_FILE]);
|
|
136
|
+
const onDisk = await listFilesRecursive(dir, fio);
|
|
137
|
+
const extra = onDisk.filter((f) => !allowed.has(f));
|
|
138
|
+
if (extra.length > 0) {
|
|
139
|
+
result.keptWithConsumerFiles.push(`${name} (consumer files: ${extra.join(", ")})`);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
await fio.rm(dir, { recursive: true });
|
|
144
|
+
result.pruned.push(name);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async function listFilesRecursive(dir: string, io: WorkspaceIO, prefix = ""): Promise<string[]> {
|
|
151
|
+
const out: string[] = [];
|
|
152
|
+
const entries = await io.readdir(dir);
|
|
153
|
+
for (const entry of entries) {
|
|
154
|
+
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
155
|
+
if (entry.isDirectory) {
|
|
156
|
+
out.push(...(await listFilesRecursive(path.join(dir, entry.name), io, rel)));
|
|
157
|
+
} else {
|
|
158
|
+
out.push(rel);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Behavioral layer
|
|
4
4
|
|
|
5
|
-
This section defines the agent's core behavioral contract. It is generated from skill `
|
|
5
|
+
This section defines the agent's core behavioral contract. It is generated from skill `triggerPhrases` and fixed policy text. The agent MUST follow these behaviors in every session.
|
|
6
6
|
|
|
7
7
|
### Intent-to-skill routing
|
|
8
8
|
|
|
9
|
-
When the operator expresses an intent in natural language, the agent routes to the matching skill. The routing table is generated from `
|
|
9
|
+
When the operator expresses an intent in natural language, the agent routes to the matching skill. The routing table is generated from `triggerPhrases` fields in skill frontmatter.
|
|
10
10
|
|
|
11
|
-
| Operator says something like | Skill |
|
|
12
|
-
| --- | --- |
|
|
13
11
|
{{triggersTable}}
|
|
14
12
|
The agent uses judgment to calibrate routing — minor edits (typo fixes, small CSS changes) do not require skill invocation, while significant changes (new features, architectural decisions) do.
|
|
15
13
|
|