@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
|
@@ -20,8 +20,9 @@ Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PU
|
|
|
20
20
|
<history>RFC-0391, RFC-0393, RFC-0524, RFC-0539, RFC-0540, RFC-0611, RFC-0640, RFC-0660, RFC-0661, RFC-0663, RFC-0675</history>
|
|
21
21
|
</CHANGE_SUMMARY>
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { resolveIo } from "../utils/io.js";
|
|
24
|
+
import { hasEditableGeneratedMarker, mergeEditableGenerated } from "../utils/index.js";
|
|
25
|
+
import { readFileSync, existsSync } from "../utils/sync-fs.js";
|
|
25
26
|
import { join, relative, dirname, resolve } from "node:path";
|
|
26
27
|
import { parse as parseYaml } from "yaml";
|
|
27
28
|
import { forgePluginManifestSchema } from "../plugin/forge-plugin-manifest.js";
|
|
@@ -29,7 +30,7 @@ import { resolveForgeRoot, loadForgeConfig, resolveBinding, resolveTerminology,
|
|
|
29
30
|
import { FORGE_SKILLS, discoverPackSkills } from "../registry.js";
|
|
30
31
|
import { discoverWorkspaces } from "./workspace-discovery.js";
|
|
31
32
|
import { buildNestedAgentsMd, selectNestedTemplate } from "./nested-agents-templates.js";
|
|
32
|
-
import { readPackageInfo } from "./nested-agents-generate.js";
|
|
33
|
+
import { readPackageInfo, generateNestedAgentsMd } from "./nested-agents-generate.js";
|
|
33
34
|
import { listStackProfiles } from "../profiles/stack-profile.js";
|
|
34
35
|
import { resolveAllTerminology } from "../profiles/terminology-utils.js";
|
|
35
36
|
import { TERMINOLOGY_DEFAULTS } from "../profiles/profile-schema.js";
|
|
@@ -38,34 +39,29 @@ import { parseKnowledgeFile } from "../knowledge/index.js";
|
|
|
38
39
|
import { planKnowledgeSync } from "../knowledge/index.js";
|
|
39
40
|
import { computeLayerBudgets, resolveKnowledgeBudgets, DEFAULT_KNOWLEDGE_BUDGETS } from "../knowledge/budgets.js";
|
|
40
41
|
import { detectDuplicatePrinciples } from "../knowledge/index.js";
|
|
41
|
-
import { checkMemoryLayerHealth } from "./memory-scaffold.js";
|
|
42
|
+
import { checkMemoryLayerHealth, resolveMemoryBudget } from "./memory-scaffold.js";
|
|
43
|
+
import { compactMemoryMd } from "./memory-compact.js";
|
|
42
44
|
import { checkInvariants } from "./invariant-engine.js";
|
|
43
45
|
import { checkNpmToken, workshopNeedsWarpgogolToken } from "./npm-token-check.js";
|
|
44
|
-
import { execSync } from "
|
|
45
|
-
import fs from "
|
|
46
|
-
async function pathExists(target) {
|
|
47
|
-
|
|
48
|
-
await stat(target);
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
46
|
+
import { execSync } from "../utils/sync-fs.js";
|
|
47
|
+
import * as fs from "../utils/sync-fs.js";
|
|
48
|
+
async function pathExists(target, io) {
|
|
49
|
+
return io.exists(target);
|
|
54
50
|
}
|
|
55
51
|
const FORBIDDEN_IMPORT_PATTERN = /(?:^|\n)\s*(?:import\s+[^;]+?\s+from\s+|require\s*\(\s*)["'`](@warpgogol\/[^"'`]+)["'`]/g;
|
|
56
|
-
async function scanForForbiddenImports(dir, workspaceRoot) {
|
|
52
|
+
async function scanForForbiddenImports(dir, workspaceRoot, io) {
|
|
57
53
|
const violations = [];
|
|
58
|
-
const entries = await readdir(dir
|
|
54
|
+
const entries = await io.readdir(dir).catch(() => []);
|
|
59
55
|
for (const entry of entries) {
|
|
60
56
|
const fullPath = join(dir, entry.name);
|
|
61
|
-
if (entry.isDirectory
|
|
57
|
+
if (entry.isDirectory) {
|
|
62
58
|
if (entry.name === "node_modules" || entry.name === "tests")
|
|
63
59
|
continue;
|
|
64
|
-
const sub = await scanForForbiddenImports(fullPath, workspaceRoot);
|
|
60
|
+
const sub = await scanForForbiddenImports(fullPath, workspaceRoot, io);
|
|
65
61
|
violations.push(...sub);
|
|
66
62
|
}
|
|
67
63
|
else if (entry.name.endsWith(".ts")) {
|
|
68
|
-
const content = await readFile(fullPath
|
|
64
|
+
const content = await io.readFile(fullPath).catch(() => "");
|
|
69
65
|
let match;
|
|
70
66
|
const pattern = new RegExp(FORBIDDEN_IMPORT_PATTERN.source, "g");
|
|
71
67
|
while ((match = pattern.exec(content)) !== null) {
|
|
@@ -97,7 +93,7 @@ const BINDING_COMMAND_KEYS = [
|
|
|
97
93
|
"commands.specValidate",
|
|
98
94
|
"commands.sessionSave",
|
|
99
95
|
];
|
|
100
|
-
async function validateBindings(workspaceRoot) {
|
|
96
|
+
async function validateBindings(workspaceRoot, io) {
|
|
101
97
|
const result = { resolved: [], absent: [], invalid: [], notices: [] };
|
|
102
98
|
let config;
|
|
103
99
|
try {
|
|
@@ -115,7 +111,7 @@ async function validateBindings(workspaceRoot) {
|
|
|
115
111
|
result.absent.push(key);
|
|
116
112
|
}
|
|
117
113
|
else if (typeof value === "string") {
|
|
118
|
-
const exists = await pathExists(join(workspaceRoot, value));
|
|
114
|
+
const exists = await pathExists(join(workspaceRoot, value), io);
|
|
119
115
|
if (exists) {
|
|
120
116
|
result.resolved.push(key);
|
|
121
117
|
}
|
|
@@ -127,7 +123,7 @@ async function validateBindings(workspaceRoot) {
|
|
|
127
123
|
const compassDocs = resolveBinding(config, "paths.compassDocs");
|
|
128
124
|
if (Array.isArray(compassDocs) && compassDocs.length > 0) {
|
|
129
125
|
for (const docPath of compassDocs) {
|
|
130
|
-
const exists = await pathExists(join(workspaceRoot, docPath));
|
|
126
|
+
const exists = await pathExists(join(workspaceRoot, docPath), io);
|
|
131
127
|
if (exists) {
|
|
132
128
|
result.resolved.push(`paths.compassDocs[${docPath}]`);
|
|
133
129
|
}
|
|
@@ -166,7 +162,7 @@ async function validateBindings(workspaceRoot) {
|
|
|
166
162
|
// ---------------------------------------------------------------------------
|
|
167
163
|
// Stale knowledge file detection (RFC-0524)
|
|
168
164
|
// ---------------------------------------------------------------------------
|
|
169
|
-
async function checkStaleKnowledgeFiles(workspaceRoot, forgeRoot) {
|
|
165
|
+
async function checkStaleKnowledgeFiles(workspaceRoot, forgeRoot, io) {
|
|
170
166
|
const stale = [];
|
|
171
167
|
let config;
|
|
172
168
|
try {
|
|
@@ -183,8 +179,8 @@ async function checkStaleKnowledgeFiles(workspaceRoot, forgeRoot) {
|
|
|
183
179
|
for (const kf of skill.knowledge) {
|
|
184
180
|
const srcPath = join(skillSrcDir, kf);
|
|
185
181
|
const destPath = join(agentsSkillsDir, skill.name, kf);
|
|
186
|
-
const srcExists = await pathExists(srcPath);
|
|
187
|
-
const destExists = await pathExists(destPath);
|
|
182
|
+
const srcExists = await pathExists(srcPath, io);
|
|
183
|
+
const destExists = await pathExists(destPath, io);
|
|
188
184
|
if (srcExists && destExists) {
|
|
189
185
|
// Append-only contract: local copies legitimately accumulate entries.
|
|
190
186
|
// Stale = source has entries the local copy lacks (sync would merge).
|
|
@@ -212,8 +208,8 @@ async function checkStaleKnowledgeFiles(workspaceRoot, forgeRoot) {
|
|
|
212
208
|
for (const kf of skill.knowledge) {
|
|
213
209
|
const srcPath = join(skillSrcDir, kf);
|
|
214
210
|
const destPath = join(agentsSkillsDir, skill.name, kf);
|
|
215
|
-
const srcExists = await pathExists(srcPath);
|
|
216
|
-
const destExists = await pathExists(destPath);
|
|
211
|
+
const srcExists = await pathExists(srcPath, io);
|
|
212
|
+
const destExists = await pathExists(destPath, io);
|
|
217
213
|
if (srcExists && destExists) {
|
|
218
214
|
const plan = planKnowledgeSync(srcPath, destPath);
|
|
219
215
|
if (plan.action === "merged") {
|
|
@@ -539,7 +535,7 @@ function checkSharedKnowledgeFile(workspaceRoot, forgeRoot) {
|
|
|
539
535
|
// ---------------------------------------------------------------------------
|
|
540
536
|
// Independent version packages diagnostics (RFC-0704)
|
|
541
537
|
// ---------------------------------------------------------------------------
|
|
542
|
-
async function checkIndependentVersionPackages(workspaceRoot) {
|
|
538
|
+
async function checkIndependentVersionPackages(workspaceRoot, io) {
|
|
543
539
|
let config;
|
|
544
540
|
try {
|
|
545
541
|
config = loadForgeConfig(workspaceRoot);
|
|
@@ -553,8 +549,8 @@ async function checkIndependentVersionPackages(workspaceRoot) {
|
|
|
553
549
|
const issues = [];
|
|
554
550
|
let validCount = 0;
|
|
555
551
|
for (const pkgPath of config.independentVersionPackages) {
|
|
556
|
-
const dirExists = await pathExists(join(workspaceRoot, pkgPath));
|
|
557
|
-
const pkgJsonExists = await pathExists(join(workspaceRoot, pkgPath, "package.json"));
|
|
552
|
+
const dirExists = await pathExists(join(workspaceRoot, pkgPath), io);
|
|
553
|
+
const pkgJsonExists = await pathExists(join(workspaceRoot, pkgPath, "package.json"), io);
|
|
558
554
|
if (!dirExists) {
|
|
559
555
|
issues.push(`path '${pkgPath}' does not exist`);
|
|
560
556
|
}
|
|
@@ -581,7 +577,7 @@ async function checkIndependentVersionPackages(workspaceRoot) {
|
|
|
581
577
|
// ---------------------------------------------------------------------------
|
|
582
578
|
// Pack skill diagnostics (RFC-0539)
|
|
583
579
|
// ---------------------------------------------------------------------------
|
|
584
|
-
async function checkPackSkills(workspaceRoot) {
|
|
580
|
+
async function checkPackSkills(workspaceRoot, io) {
|
|
585
581
|
let config;
|
|
586
582
|
try {
|
|
587
583
|
config = loadForgeConfig(workspaceRoot);
|
|
@@ -608,7 +604,7 @@ async function checkPackSkills(workspaceRoot) {
|
|
|
608
604
|
issues.push(`duplicate dir '${pack.dir}'`);
|
|
609
605
|
}
|
|
610
606
|
dirs.add(pack.dir);
|
|
611
|
-
const packDirExists = await pathExists(join(workspaceRoot, pack.dir));
|
|
607
|
+
const packDirExists = await pathExists(join(workspaceRoot, pack.dir), io);
|
|
612
608
|
if (!packDirExists) {
|
|
613
609
|
issues.push(`pack dir '${pack.dir}' does not exist`);
|
|
614
610
|
}
|
|
@@ -625,11 +621,11 @@ async function checkPackSkills(workspaceRoot) {
|
|
|
625
621
|
for (const skill of packSkills) {
|
|
626
622
|
const srcPath = join(workspaceRoot, skill.dir, skill.path);
|
|
627
623
|
const destPath = join(agentsSkillsDir, skill.name, "SKILL.md");
|
|
628
|
-
const srcExists = await pathExists(srcPath);
|
|
629
|
-
const destExists = await pathExists(destPath);
|
|
624
|
+
const srcExists = await pathExists(srcPath, io);
|
|
625
|
+
const destExists = await pathExists(destPath, io);
|
|
630
626
|
if (srcExists && destExists) {
|
|
631
|
-
const srcContent = await readFile(srcPath
|
|
632
|
-
const destContent = await readFile(destPath
|
|
627
|
+
const srcContent = await io.readFile(srcPath).catch(() => "");
|
|
628
|
+
const destContent = await io.readFile(destPath).catch(() => "");
|
|
633
629
|
if (srcContent !== destContent) {
|
|
634
630
|
issues.push(`stale copy of '${skill.name}'`);
|
|
635
631
|
}
|
|
@@ -649,7 +645,7 @@ async function checkPackSkills(workspaceRoot) {
|
|
|
649
645
|
// ---------------------------------------------------------------------------
|
|
650
646
|
// Pack manifest diagnostics (RFC-0941)
|
|
651
647
|
// ---------------------------------------------------------------------------
|
|
652
|
-
async function checkPackManifests(workspaceRoot) {
|
|
648
|
+
async function checkPackManifests(workspaceRoot, _io) {
|
|
653
649
|
let config;
|
|
654
650
|
try {
|
|
655
651
|
config = loadForgeConfig(workspaceRoot);
|
|
@@ -696,7 +692,7 @@ async function checkPackManifests(workspaceRoot) {
|
|
|
696
692
|
// ---------------------------------------------------------------------------
|
|
697
693
|
// Nested AGENTS.md diagnostics (RFC-0611)
|
|
698
694
|
// ---------------------------------------------------------------------------
|
|
699
|
-
async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
|
|
695
|
+
async function checkNestedAgentsMd(workspaceRoot, workspaceTypes, io) {
|
|
700
696
|
let config;
|
|
701
697
|
try {
|
|
702
698
|
config = loadForgeConfig(workspaceRoot);
|
|
@@ -708,7 +704,7 @@ async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
|
|
|
708
704
|
message: "forge.yaml not loadable — nested AGENTS.md check skipped",
|
|
709
705
|
};
|
|
710
706
|
}
|
|
711
|
-
const workspaces = discoverWorkspaces(workspaceRoot, workspaceTypes);
|
|
707
|
+
const workspaces = discoverWorkspaces(workspaceRoot, workspaceTypes, config.bindings?.workspaces?.skipDirs);
|
|
712
708
|
if (workspaces.length === 0) {
|
|
713
709
|
return {
|
|
714
710
|
name: "nested-AGENTS.md",
|
|
@@ -720,6 +716,7 @@ async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
|
|
|
720
716
|
let missing = 0;
|
|
721
717
|
let stale = 0;
|
|
722
718
|
let handwritten = 0;
|
|
719
|
+
let unmapped = 0;
|
|
723
720
|
for (const ws of workspaces) {
|
|
724
721
|
if (!ws.hasAgentsMd) {
|
|
725
722
|
missing++;
|
|
@@ -730,7 +727,7 @@ async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
|
|
|
730
727
|
handwritten++;
|
|
731
728
|
const suggestions = [];
|
|
732
729
|
try {
|
|
733
|
-
const content = await readFile(join(workspaceRoot, ws.path, "AGENTS.md")
|
|
730
|
+
const content = await io.readFile(join(workspaceRoot, ws.path, "AGENTS.md"));
|
|
734
731
|
if (!content.includes("AGENTS.md")) {
|
|
735
732
|
suggestions.push("reference root AGENTS.md");
|
|
736
733
|
}
|
|
@@ -752,8 +749,18 @@ async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
|
|
|
752
749
|
const terminology = resolveAllTerminology(config, profile);
|
|
753
750
|
const wsType = workspaceTypes?.find((wt) => wt.id === ws.type);
|
|
754
751
|
const expected = selectNestedTemplate(wsType, profile, terminology, fallback);
|
|
755
|
-
const actual = await readFile(join(workspaceRoot, ws.path, "AGENTS.md")
|
|
756
|
-
|
|
752
|
+
const actual = await io.readFile(join(workspaceRoot, ws.path, "AGENTS.md"));
|
|
753
|
+
// RFC-1153: boundary-aware staleness — merge(expected, actual) compares
|
|
754
|
+
// only the generated head; content below the forge:custom boundary (or
|
|
755
|
+
// the canonical footer fallback) is preserved, not drift. Files bearing
|
|
756
|
+
// the restrictive GENERATED marker are generator-owned (RFC-0081) — any
|
|
757
|
+
// divergence is plain staleness, never unmapped-customization.
|
|
758
|
+
const merged = mergeEditableGenerated(expected, actual, `${ws.path}/AGENTS.md`);
|
|
759
|
+
if (merged === null && hasEditableGeneratedMarker(actual)) {
|
|
760
|
+
unmapped++;
|
|
761
|
+
issues.push(`${ws.path}/AGENTS.md has custom content but no resolvable boundary — add <!-- forge:custom --> manually`);
|
|
762
|
+
}
|
|
763
|
+
else if (merged === null || merged !== actual.replace(/\r\n/g, "\n")) {
|
|
757
764
|
stale++;
|
|
758
765
|
issues.push(`${ws.path}/AGENTS.md stale — run 'forge agents generate'`);
|
|
759
766
|
}
|
|
@@ -774,11 +781,13 @@ async function checkNestedAgentsMd(workspaceRoot, workspaceTypes) {
|
|
|
774
781
|
parts.push(`${missing} missing`);
|
|
775
782
|
if (stale > 0)
|
|
776
783
|
parts.push(`${stale} stale`);
|
|
784
|
+
if (unmapped > 0)
|
|
785
|
+
parts.push(`${unmapped} unmapped-customization`);
|
|
777
786
|
if (handwritten > 0)
|
|
778
787
|
parts.push(`${handwritten} hand-written`);
|
|
779
788
|
return {
|
|
780
789
|
name: "nested-AGENTS.md",
|
|
781
|
-
status: stale > 0 ? "warn" : "pass",
|
|
790
|
+
status: stale > 0 || unmapped > 0 ? "warn" : "pass",
|
|
782
791
|
message: `${parts.join(", ")} — ${issues.slice(0, 3).join("; ")}${issues.length > 3 ? ` (+${issues.length - 3} more)` : ""}`,
|
|
783
792
|
};
|
|
784
793
|
}
|
|
@@ -1046,11 +1055,13 @@ function checkPrerequisites(prerequisites) {
|
|
|
1046
1055
|
};
|
|
1047
1056
|
}
|
|
1048
1057
|
export async function runDoctor(input, context) {
|
|
1049
|
-
const { workspaceRoot, logger, outputFormat } = context;
|
|
1058
|
+
const { workspaceRoot, logger, outputFormat, dryRun } = context;
|
|
1059
|
+
const fio = resolveIo(context.io);
|
|
1050
1060
|
const strict = input.flags["strict"] === true;
|
|
1061
|
+
const fix = input.flags["fix"] === true;
|
|
1051
1062
|
const checks = [];
|
|
1052
1063
|
// Check forge.yaml
|
|
1053
|
-
const forgeYamlExists = await pathExists(join(workspaceRoot, "forge.yaml"));
|
|
1064
|
+
const forgeYamlExists = await pathExists(join(workspaceRoot, "forge.yaml"), fio);
|
|
1054
1065
|
checks.push({
|
|
1055
1066
|
name: "forge.yaml",
|
|
1056
1067
|
status: forgeYamlExists ? "pass" : "warn",
|
|
@@ -1059,7 +1070,7 @@ export async function runDoctor(input, context) {
|
|
|
1059
1070
|
: "forge.yaml not found — run 'forge create' to create project configuration",
|
|
1060
1071
|
});
|
|
1061
1072
|
// Check AGENTS.md
|
|
1062
|
-
const agentsMdExists = await pathExists(join(workspaceRoot, "AGENTS.md"));
|
|
1073
|
+
const agentsMdExists = await pathExists(join(workspaceRoot, "AGENTS.md"), fio);
|
|
1063
1074
|
checks.push({
|
|
1064
1075
|
name: "AGENTS.md",
|
|
1065
1076
|
status: agentsMdExists ? "pass" : "warn",
|
|
@@ -1068,7 +1079,7 @@ export async function runDoctor(input, context) {
|
|
|
1068
1079
|
: "AGENTS.md not found — run 'forge create' to deploy agent instructions",
|
|
1069
1080
|
});
|
|
1070
1081
|
// Check PREFERENCES.md
|
|
1071
|
-
const preferencesExists = await pathExists(join(workspaceRoot, "PREFERENCES.md"));
|
|
1082
|
+
const preferencesExists = await pathExists(join(workspaceRoot, "PREFERENCES.md"), fio);
|
|
1072
1083
|
checks.push({
|
|
1073
1084
|
name: "PREFERENCES.md",
|
|
1074
1085
|
status: preferencesExists ? "pass" : "warn",
|
|
@@ -1077,7 +1088,7 @@ export async function runDoctor(input, context) {
|
|
|
1077
1088
|
: "PREFERENCES.md not found — run 'forge create' to create preferences file",
|
|
1078
1089
|
});
|
|
1079
1090
|
// Check .agents/skills/
|
|
1080
|
-
const skillsDirExists = await pathExists(join(workspaceRoot, ".agents", "skills"));
|
|
1091
|
+
const skillsDirExists = await pathExists(join(workspaceRoot, ".agents", "skills"), fio);
|
|
1081
1092
|
checks.push({
|
|
1082
1093
|
name: ".agents/skills/",
|
|
1083
1094
|
status: skillsDirExists ? "pass" : "fail",
|
|
@@ -1086,7 +1097,7 @@ export async function runDoctor(input, context) {
|
|
|
1086
1097
|
: ".agents/skills/ directory not found — run 'forge create' to deploy skills",
|
|
1087
1098
|
});
|
|
1088
1099
|
// Check docs/rfcs/
|
|
1089
|
-
const rfcsDirExists = await pathExists(join(workspaceRoot, "docs", "rfcs"));
|
|
1100
|
+
const rfcsDirExists = await pathExists(join(workspaceRoot, "docs", "rfcs"), fio);
|
|
1090
1101
|
checks.push({
|
|
1091
1102
|
name: "docs/rfcs/",
|
|
1092
1103
|
status: rfcsDirExists ? "pass" : "warn",
|
|
@@ -1095,7 +1106,7 @@ export async function runDoctor(input, context) {
|
|
|
1095
1106
|
: "docs/rfcs/ directory not found — run 'forge create' to create RFC directory",
|
|
1096
1107
|
});
|
|
1097
1108
|
// Check docs/adrs/
|
|
1098
|
-
const adrsDirExists = await pathExists(join(workspaceRoot, "docs", "adrs"));
|
|
1109
|
+
const adrsDirExists = await pathExists(join(workspaceRoot, "docs", "adrs"), fio);
|
|
1099
1110
|
checks.push({
|
|
1100
1111
|
name: "docs/adrs/",
|
|
1101
1112
|
status: adrsDirExists ? "pass" : "warn",
|
|
@@ -1187,7 +1198,7 @@ export async function runDoctor(input, context) {
|
|
|
1187
1198
|
? `${profileValidateResult.data?.profiles.length ?? 0} profile(s) valid`
|
|
1188
1199
|
: `${invalidProfiles.length} profile(s) invalid (advisory): ${invalidProfiles.map((p) => p.id).join(", ")}`,
|
|
1189
1200
|
});
|
|
1190
|
-
const forbiddenImports = await scanForForbiddenImports(forgeRoot, workspaceRoot);
|
|
1201
|
+
const forbiddenImports = await scanForForbiddenImports(forgeRoot, workspaceRoot, fio);
|
|
1191
1202
|
checks.push({
|
|
1192
1203
|
name: "autonomy-guard",
|
|
1193
1204
|
status: forbiddenImports.length === 0 ? "pass" : "fail",
|
|
@@ -1196,7 +1207,7 @@ export async function runDoctor(input, context) {
|
|
|
1196
1207
|
: `${forbiddenImports.length} @warpgogol/* import(s) found in forge source — remove them`,
|
|
1197
1208
|
});
|
|
1198
1209
|
// Check bindings contract (RFC-0393)
|
|
1199
|
-
const bindingsResult = await validateBindings(workspaceRoot);
|
|
1210
|
+
const bindingsResult = await validateBindings(workspaceRoot, fio);
|
|
1200
1211
|
checks.push({
|
|
1201
1212
|
name: "bindings",
|
|
1202
1213
|
status: bindingsResult.invalid.length === 0 ? "pass" : "fail",
|
|
@@ -1205,7 +1216,7 @@ export async function runDoctor(input, context) {
|
|
|
1205
1216
|
: `Bindings: ${bindingsResult.invalid.length} invalid — ${bindingsResult.invalid.join(", ")}`,
|
|
1206
1217
|
});
|
|
1207
1218
|
// Check stale knowledge files (RFC-0524, RFC-0539)
|
|
1208
|
-
const staleCheck = await checkStaleKnowledgeFiles(workspaceRoot, forgeRoot);
|
|
1219
|
+
const staleCheck = await checkStaleKnowledgeFiles(workspaceRoot, forgeRoot, fio);
|
|
1209
1220
|
checks.push(staleCheck);
|
|
1210
1221
|
// RFC-0660: Check legacy sections in knowledge files
|
|
1211
1222
|
const legacyCheck = checkLegacyKnowledgeSections(workspaceRoot, forgeRoot);
|
|
@@ -1221,22 +1232,24 @@ export async function runDoctor(input, context) {
|
|
|
1221
1232
|
checks.push(sharedKnowledgeCheck);
|
|
1222
1233
|
// RFC-0664: Check memory layer health (budget, gitignore coverage, leak risk)
|
|
1223
1234
|
checks.push(checkMemoryLayer(workspaceRoot));
|
|
1235
|
+
// RFC-1151: Check dist freshness — stale dist/ silently shadows src/ in source checkouts
|
|
1236
|
+
checks.push(checkDistFreshness(forgeRoot));
|
|
1224
1237
|
// RFC-0539: Check pack skills — stale/missing copies and config validation
|
|
1225
|
-
const packCheck = await checkPackSkills(workspaceRoot);
|
|
1238
|
+
const packCheck = await checkPackSkills(workspaceRoot, fio);
|
|
1226
1239
|
checks.push(packCheck);
|
|
1227
1240
|
// RFC-0941: Check pack manifests — forge.plugin.yaml existence and validity
|
|
1228
|
-
const packManifestCheck = await checkPackManifests(workspaceRoot);
|
|
1241
|
+
const packManifestCheck = await checkPackManifests(workspaceRoot, fio);
|
|
1229
1242
|
checks.push(packManifestCheck);
|
|
1230
1243
|
// RFC-0704: Check independent version packages — paths must exist and contain package.json
|
|
1231
|
-
const independentCheck = await checkIndependentVersionPackages(workspaceRoot);
|
|
1244
|
+
const independentCheck = await checkIndependentVersionPackages(workspaceRoot, fio);
|
|
1232
1245
|
checks.push(independentCheck);
|
|
1233
1246
|
// RFC-0611: Check nested AGENTS.md — missing, stale, hand-written
|
|
1234
1247
|
// RFC-0640: Use profile-driven workspace types when available (all domains)
|
|
1235
1248
|
// RFC-0640 fix: previously gated by isSoftwareDomain, which skipped the check
|
|
1236
1249
|
// entirely for non-software domains. Now runs for all domains — profile-driven
|
|
1237
1250
|
// wsTypes replace hardcoded detection when present.
|
|
1251
|
+
let wsTypes;
|
|
1238
1252
|
{
|
|
1239
|
-
let wsTypes;
|
|
1240
1253
|
try {
|
|
1241
1254
|
const config = loadForgeConfig(workspaceRoot);
|
|
1242
1255
|
// RFC-0643: prefer config.profile (loaded by loadForgeConfig)
|
|
@@ -1257,7 +1270,7 @@ export async function runDoctor(input, context) {
|
|
|
1257
1270
|
catch {
|
|
1258
1271
|
// profiles not loadable
|
|
1259
1272
|
}
|
|
1260
|
-
const nestedCheck = await checkNestedAgentsMd(workspaceRoot, wsTypes);
|
|
1273
|
+
const nestedCheck = await checkNestedAgentsMd(workspaceRoot, wsTypes, fio);
|
|
1261
1274
|
checks.push(nestedCheck);
|
|
1262
1275
|
}
|
|
1263
1276
|
// RFC-0640: --strict flag elevates warn to fail for domain-related checks
|
|
@@ -1269,6 +1282,15 @@ export async function runDoctor(input, context) {
|
|
|
1269
1282
|
: checks;
|
|
1270
1283
|
const allPass = finalChecks.every((c) => c.status === "pass");
|
|
1271
1284
|
const hasFails = finalChecks.some((c) => c.status === "fail");
|
|
1285
|
+
// RFC-1151: --fix applies registered safe remediations for warn/fail checks
|
|
1286
|
+
const fixes = [];
|
|
1287
|
+
if (fix) {
|
|
1288
|
+
for (const check of finalChecks) {
|
|
1289
|
+
if (check.status === "pass")
|
|
1290
|
+
continue;
|
|
1291
|
+
fixes.push(await applyDoctorRemediation(check, workspaceRoot, wsTypes, dryRun === true, fio));
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1272
1294
|
if (outputFormat === "pretty") {
|
|
1273
1295
|
logger.section(`Forge Doctor — ${workspaceRoot}`);
|
|
1274
1296
|
for (const check of finalChecks) {
|
|
@@ -1276,6 +1298,10 @@ export async function runDoctor(input, context) {
|
|
|
1276
1298
|
const fn = check.status === "pass" ? logger.success : check.status === "warn" ? logger.warn : logger.error;
|
|
1277
1299
|
fn(`${icon} ${check.name}: ${check.message}`);
|
|
1278
1300
|
}
|
|
1301
|
+
for (const f of fixes) {
|
|
1302
|
+
const fn = f.action === "fixed" ? logger.success : f.action === "failed" ? logger.error : logger.info;
|
|
1303
|
+
fn(` fix ${f.check}: ${f.action} — ${f.detail}`);
|
|
1304
|
+
}
|
|
1279
1305
|
if (allPass) {
|
|
1280
1306
|
logger.success("All checks passed — forge is properly configured.");
|
|
1281
1307
|
}
|
|
@@ -1286,12 +1312,104 @@ export async function runDoctor(input, context) {
|
|
|
1286
1312
|
logger.warn("Some checks warn — review above.");
|
|
1287
1313
|
}
|
|
1288
1314
|
}
|
|
1315
|
+
const fixFailed = fixes.some((f) => f.action === "failed");
|
|
1289
1316
|
return {
|
|
1290
|
-
data: { command: "forge.doctor", checks: finalChecks, allPass, forbiddenImports, bindings: bindingsResult, domain: domainReport },
|
|
1291
|
-
exitCode: hasFails ? 1 : 0,
|
|
1317
|
+
data: { command: "forge.doctor", checks: finalChecks, allPass, forbiddenImports, bindings: bindingsResult, domain: domainReport, ...(fix ? { fixes } : {}) },
|
|
1318
|
+
exitCode: hasFails || fixFailed ? 1 : 0,
|
|
1292
1319
|
summary: allPass
|
|
1293
1320
|
? "forge.doctor: all checks passed"
|
|
1294
|
-
: `forge.doctor: ${finalChecks.filter((c) => c.status === "fail").length} fail(s), ${finalChecks.filter((c) => c.status === "warn").length} warn(s)`,
|
|
1321
|
+
: `forge.doctor: ${finalChecks.filter((c) => c.status === "fail").length} fail(s), ${finalChecks.filter((c) => c.status === "warn").length} warn(s)${fix ? `, ${fixes.filter((f) => f.action === "fixed").length} fixed` : ""}`,
|
|
1295
1322
|
};
|
|
1296
1323
|
}
|
|
1324
|
+
// RFC-1151: dist-freshness — a stale dist/ silently shadows src/ because
|
|
1325
|
+
// bin/cli.js prefers dist when present. Warn-only; rebuild is a pnpm script,
|
|
1326
|
+
// not forge's call. Pass (skip) when src/ or dist/ is absent — npm consumers
|
|
1327
|
+
// ship dist-only, so this activates only in source checkouts.
|
|
1328
|
+
function checkDistFreshness(forgeRoot) {
|
|
1329
|
+
const srcDir = join(forgeRoot, "src");
|
|
1330
|
+
const distDir = join(forgeRoot, "dist");
|
|
1331
|
+
if (!fs.existsSync(srcDir) || !fs.existsSync(distDir)) {
|
|
1332
|
+
return {
|
|
1333
|
+
name: "dist-freshness",
|
|
1334
|
+
status: "pass",
|
|
1335
|
+
message: "no src+dist pair — not a source checkout",
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
const newestSrc = newestMtime(srcDir);
|
|
1339
|
+
const distMtime = fs.statSync(distDir).mtimeMs;
|
|
1340
|
+
if (newestSrc > distMtime) {
|
|
1341
|
+
return {
|
|
1342
|
+
name: "dist-freshness",
|
|
1343
|
+
status: "warn",
|
|
1344
|
+
message: `dist/ older than newest src/ file — run 'pnpm run build' in ${forgeRoot}`,
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
return { name: "dist-freshness", status: "pass", message: "dist/ is fresh" };
|
|
1348
|
+
}
|
|
1349
|
+
function newestMtime(dir) {
|
|
1350
|
+
let newest = 0;
|
|
1351
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true, recursive: true })) {
|
|
1352
|
+
if (!entry.isFile())
|
|
1353
|
+
continue;
|
|
1354
|
+
const m = fs.statSync(join(entry.parentPath, entry.name)).mtimeMs;
|
|
1355
|
+
if (m > newest)
|
|
1356
|
+
newest = m;
|
|
1357
|
+
}
|
|
1358
|
+
return newest;
|
|
1359
|
+
}
|
|
1360
|
+
// RFC-1151: remediation dispatch — check name → safe fix action.
|
|
1361
|
+
// Remediations reuse existing generators; hand-written files are never touched
|
|
1362
|
+
// (generated-marker edit guard inside generateNestedAgentsMd).
|
|
1363
|
+
async function applyDoctorRemediation(check, workspaceRoot, workspaceTypes, dryRun, io) {
|
|
1364
|
+
switch (check.name) {
|
|
1365
|
+
case "nested-AGENTS.md": {
|
|
1366
|
+
try {
|
|
1367
|
+
const config = loadForgeConfig(workspaceRoot);
|
|
1368
|
+
const res = await generateNestedAgentsMd(workspaceRoot, config, dryRun, workspaceTypes, io);
|
|
1369
|
+
return {
|
|
1370
|
+
check: check.name,
|
|
1371
|
+
action: res.generated.length > 0 ? "fixed" : "skipped",
|
|
1372
|
+
detail: `${res.generated.length} file(s) ${dryRun ? "would be " : ""}regenerated, ${res.skipped.length} skipped`,
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
catch (err) {
|
|
1376
|
+
return { check: check.name, action: "failed", detail: err.message };
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
case "memory-layer": {
|
|
1380
|
+
try {
|
|
1381
|
+
const memoryPath = join(workspaceRoot, ".agents", "memory", "MEMORY.md");
|
|
1382
|
+
if (!(await io.exists(memoryPath))) {
|
|
1383
|
+
return { check: check.name, action: "skipped", detail: "MEMORY.md absent" };
|
|
1384
|
+
}
|
|
1385
|
+
const content = await io.readFile(memoryPath);
|
|
1386
|
+
const budget = resolveMemoryBudget(workspaceRoot);
|
|
1387
|
+
const { lines, removedLines, fitsBudget } = compactMemoryMd(content, budget);
|
|
1388
|
+
if (!fitsBudget) {
|
|
1389
|
+
return {
|
|
1390
|
+
check: check.name,
|
|
1391
|
+
action: "failed",
|
|
1392
|
+
detail: "still over budget after Environment notes truncation — manual editorial compaction required",
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
if (removedLines.length === 0) {
|
|
1396
|
+
return { check: check.name, action: "skipped", detail: "within budget" };
|
|
1397
|
+
}
|
|
1398
|
+
if (!dryRun) {
|
|
1399
|
+
await io.writeFile(memoryPath, lines.join("\n"));
|
|
1400
|
+
}
|
|
1401
|
+
return {
|
|
1402
|
+
check: check.name,
|
|
1403
|
+
action: "fixed",
|
|
1404
|
+
detail: `${dryRun ? "would remove" : "removed"} ${removedLines.length} bullet(s)`,
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
catch (err) {
|
|
1408
|
+
return { check: check.name, action: "failed", detail: err.message };
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
default:
|
|
1412
|
+
return { check: check.name, action: "skipped", detail: "no-remediation" };
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1297
1415
|
//# sourceMappingURL=doctor.js.map
|