@warpgogol/forge 6.3.6 → 8.0.2
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/CHANGELOG.md +47 -0
- package/README.md +2 -1
- package/bin/cli.js +6 -12
- package/bin/resolve-entry.js +24 -0
- package/dist/os/compass/comment-safety.d.ts +83 -0
- package/dist/os/compass/comment-safety.d.ts.map +1 -0
- package/dist/os/compass/comment-safety.js +305 -0
- package/dist/os/compass/comment-safety.js.map +1 -0
- package/dist/os/compass/compass.module.d.ts.map +1 -1
- package/dist/os/compass/compass.module.js +47 -4
- package/dist/os/compass/compass.module.js.map +1 -1
- package/dist/os/compass/handlers/compass-change-summary-handler.d.ts +2 -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 +34 -10
- package/dist/os/compass/handlers/compass-change-summary-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-docs-scaffold.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-docs-scaffold.js +54 -17
- package/dist/os/compass/handlers/compass-docs-scaffold.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts +14 -0
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -0
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +261 -0
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -0
- package/dist/os/compass/handlers/compass-header-scaffold.d.ts +31 -0
- package/dist/os/compass/handlers/compass-header-scaffold.d.ts.map +1 -0
- package/dist/os/compass/handlers/compass-header-scaffold.js +739 -0
- package/dist/os/compass/handlers/compass-header-scaffold.js.map +1 -0
- package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.js +8 -4
- package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-inventory.d.ts +6 -0
- package/dist/os/compass/handlers/compass-inventory.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory.js +28 -13
- package/dist/os/compass/handlers/compass-inventory.js.map +1 -1
- package/dist/os/compass/handlers/compass-migrate-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-migrate-handler.js +12 -26
- package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-migrate.d.ts +15 -2
- package/dist/os/compass/handlers/compass-migrate.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-migrate.js +58 -20
- package/dist/os/compass/handlers/compass-migrate.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +10 -0
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +58 -4
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts +20 -5
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +175 -44
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/compass/index.d.ts +1 -0
- package/dist/os/compass/index.d.ts.map +1 -1
- package/dist/os/compass/index.js +2 -0
- package/dist/os/compass/index.js.map +1 -1
- package/dist/os/compass/policy.d.ts +9 -0
- package/dist/os/compass/policy.d.ts.map +1 -1
- package/dist/os/compass/policy.js +11 -2
- package/dist/os/compass/policy.js.map +1 -1
- package/dist/os/core/core.module.js +1 -1
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +1 -6
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/queue/types.d.ts +2 -0
- package/dist/os/queue/types.d.ts.map +1 -1
- package/dist/os/queue/types.js +3 -1
- package/dist/os/queue/types.js.map +1 -1
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +66 -2
- 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 +21 -3
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/dna-trace.d.ts +2 -0
- package/dist/os/rfc/dna-trace.d.ts.map +1 -1
- package/dist/os/rfc/dna-trace.js +13 -4
- package/dist/os/rfc/dna-trace.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts +37 -0
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-origin.js +118 -0
- package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp.d.ts +41 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +645 -47
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +42 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +147 -0
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -0
- package/dist/os/rfc/handlers/validate-rules.d.ts +9 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +71 -10
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/reachable-symbol.d.ts +17 -0
- package/dist/os/rfc/reachable-symbol.d.ts.map +1 -0
- package/dist/os/rfc/reachable-symbol.js +376 -0
- package/dist/os/rfc/reachable-symbol.js.map +1 -0
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +99 -10
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +112 -14
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +27 -10
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +25 -0
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +244 -13
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +58 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -0
- package/dist/os/rfc/verification-origin.js +346 -0
- package/dist/os/rfc/verification-origin.js.map +1 -0
- package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
- package/dist/os/rfc/verification-refresh.js +11 -1
- package/dist/os/rfc/verification-refresh.js.map +1 -1
- package/dist/os/rfc/verify-workspace.d.ts +23 -0
- package/dist/os/rfc/verify-workspace.d.ts.map +1 -0
- package/dist/os/rfc/verify-workspace.js +278 -0
- package/dist/os/rfc/verify-workspace.js.map +1 -0
- package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
- package/dist/os/session/handlers/metrics-rfc.js +3 -0
- package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +5 -23
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +30 -9
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/workflow/handlers.d.ts +0 -4
- package/dist/os/workflow/handlers.d.ts.map +1 -1
- package/dist/os/workflow/handlers.js +9 -36
- package/dist/os/workflow/handlers.js.map +1 -1
- package/dist/os/workflow/index.d.ts +2 -2
- package/dist/os/workflow/index.d.ts.map +1 -1
- package/dist/os/workflow/index.js +1 -1
- package/dist/os/workflow/index.js.map +1 -1
- package/dist/os/workflow/types.d.ts +0 -19
- package/dist/os/workflow/types.d.ts.map +1 -1
- package/dist/os/workflow/types.js +0 -2
- package/dist/os/workflow/types.js.map +1 -1
- package/dist/os/workflow/workflow.module.d.ts.map +1 -1
- package/dist/os/workflow/workflow.module.js +6 -15
- package/dist/os/workflow/workflow.module.js.map +1 -1
- package/dist/src/config/forge-config.d.ts +5 -0
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +5 -2
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/onboarding/agents-generate.js +1 -1
- package/dist/src/onboarding/doctor.js +3 -3
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/init.js +2 -2
- package/dist/src/onboarding/nested-agents-templates.js +1 -1
- package/dist/src/onboarding/prettierignore.js +1 -1
- package/dist/src/onboarding/upgrade.js +2 -2
- package/dist/src/onboarding/workspace-discovery.js +1 -1
- package/dist/src/profiles/profile-schema.d.ts +2 -0
- package/dist/src/profiles/profile-schema.d.ts.map +1 -1
- package/dist/src/profiles/profile-schema.js +1 -0
- package/dist/src/profiles/profile-schema.js.map +1 -1
- package/dist/src/profiles/stack-profile.d.ts +1 -0
- package/dist/src/profiles/stack-profile.d.ts.map +1 -1
- package/dist/src/skill-schema.d.ts +2 -0
- package/dist/src/skill-schema.d.ts.map +1 -1
- package/dist/src/skill-schema.js +9 -1
- package/dist/src/skill-schema.js.map +1 -1
- package/dist/src/types.d.ts +23 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +2 -1
- package/dist/src/types.js.map +1 -1
- package/docs/reference/cli.md +0 -1
- package/docs/reference/programmatic-api.md +1 -1
- package/os/adr/handlers/validate.test.ts +14 -0
- package/os/compass/comment-safety.ts +331 -0
- package/os/compass/compass.module.ts +50 -4
- package/os/compass/handlers/compass-change-summary-handler.ts +41 -11
- package/os/compass/handlers/compass-docs-scaffold.ts +59 -17
- package/os/compass/handlers/compass-game-extensions.test.ts +3 -7
- package/os/compass/handlers/compass-header-scaffold-handler.ts +352 -0
- package/os/compass/handlers/compass-header-scaffold.ts +847 -0
- package/os/compass/handlers/compass-inventory-handler.ts +9 -4
- package/os/compass/handlers/compass-inventory.ts +29 -13
- package/os/compass/handlers/compass-migrate-handler.ts +13 -27
- package/os/compass/handlers/compass-migrate.ts +77 -21
- package/os/compass/handlers/git-revision.ts +59 -4
- package/os/compass/handlers/resolve-scan-root-package.test.ts +14 -0
- package/os/compass/handlers/resolve-scan-root-workpiece.test.ts +14 -0
- package/os/compass/handlers/summary-record.ts +194 -41
- package/os/compass/handlers/tests/compass-audit-plan.test.ts +6 -0
- package/os/compass/handlers/tests/compass-audit-record.test.ts +6 -0
- package/os/compass/handlers/tests/compass-audit-validate.test.ts +6 -0
- package/os/compass/handlers/tests/compass-change-summary-handler.test.ts +131 -0
- package/os/compass/handlers/tests/compass-docs-validate.test.ts +6 -0
- package/os/compass/handlers/tests/compass-header-scaffold.test.ts +896 -0
- package/os/compass/handlers/tests/compass-ledger-scope.test.ts +6 -0
- package/os/compass/handlers/tests/compass-migrate.test.ts +87 -9
- package/os/compass/handlers/tests/compass-policy.test.ts +1 -1
- package/os/compass/handlers/tests/compass-text-safety.test.ts +271 -0
- package/os/compass/handlers/tests/compass-v2-contract.test.ts +52 -3
- package/os/compass/handlers/tests/summary-record.test.ts +324 -3
- package/os/compass/index.ts +15 -0
- package/os/compass/policy.ts +27 -2
- package/os/core/core.module.ts +1 -1
- package/os/core/handlers/invariant-engine.test.ts +3 -1
- package/os/core/handlers/note-frontmatter-validate.test.ts +6 -1
- package/os/core/handlers/note-link-validate.test.ts +6 -1
- package/os/core/handlers/note-orphan-detect.test.ts +6 -1
- package/os/core/handlers/package-health.test.ts +6 -0
- package/os/core/handlers/package-health.ts +1 -6
- package/os/mission/handlers/archive.test.ts +14 -0
- package/os/naming/naming-convention.test.ts +14 -0
- package/os/queue/decision-ledger.test.ts +27 -4
- package/os/queue/queue-validate.test.ts +14 -0
- package/os/queue/types.ts +3 -1
- package/os/rfc/acceptance-reachable.test.ts +146 -0
- package/os/rfc/acceptance.test.ts +136 -0
- package/os/rfc/acceptance.ts +71 -2
- package/os/rfc/decision-log.ts +22 -4
- package/os/rfc/dna-trace.ts +17 -5
- package/os/rfc/frontmatter-io.test.ts +14 -0
- package/os/rfc/handlers/implement-stamp-acceptance-verification.test.ts +81 -0
- package/os/rfc/handlers/implement-stamp-binding.test.ts +79 -0
- package/os/rfc/handlers/implement-stamp-origin.test.ts +132 -0
- package/os/rfc/handlers/implement-stamp-origin.ts +154 -0
- package/os/rfc/handlers/implement-stamp-stale.test.ts +285 -0
- package/os/rfc/handlers/implement-stamp.ts +783 -55
- package/os/rfc/handlers/lifecycle.test.ts +14 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +221 -0
- package/os/rfc/handlers/validate-rules-rfc0997.test.ts +14 -0
- package/os/rfc/handlers/validate-rules-rfc1006.test.ts +14 -0
- package/os/rfc/handlers/validate-rules-rfc1330.test.ts +120 -0
- package/os/rfc/handlers/validate-rules-rfc1334.test.ts +65 -0
- package/os/rfc/handlers/validate-rules.test.ts +56 -0
- package/os/rfc/handlers/validate-rules.ts +101 -10
- package/os/rfc/handlers/validate.test.ts +4 -3
- package/os/rfc/reachable-symbol.ts +441 -0
- package/os/rfc/rfc-0000-template.md +21 -1
- package/os/rfc/rfc-create-concurrent.test.ts +6 -0
- package/os/rfc/rfc-create-hint.test.ts +6 -0
- package/os/rfc/rfc-read-only-no-side-effects.test.ts +6 -0
- package/os/rfc/rfc.module.ts +106 -10
- package/os/rfc/types.ts +151 -14
- package/os/rfc/verification-emit-check.test.ts +215 -0
- package/os/rfc/verification-emit-freshness.test.ts +415 -0
- package/os/rfc/verification-emit.test.ts +14 -0
- package/os/rfc/verification-evidence.ts +301 -13
- package/os/rfc/verification-normalize.test.ts +75 -0
- package/os/rfc/verification-origin.test.ts +236 -0
- package/os/rfc/verification-origin.ts +417 -0
- package/os/rfc/verification-refresh.test.ts +14 -0
- package/os/rfc/verification-refresh.ts +12 -1
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +78 -0
- package/os/rfc/verifier/rfc-1333/imp12-gate.acceptance.test.ts +81 -0
- package/os/rfc/verifier/rfc-1333/skills-and-types.acceptance.test.ts +50 -0
- package/os/rfc/verifier/rfc-1333/verify-workspace.acceptance.test.ts +103 -0
- package/os/rfc/verify-workspace.test.ts +122 -0
- package/os/rfc/verify-workspace.ts +342 -0
- package/os/session/handlers/metrics-rfc.ts +3 -0
- package/os/spec/spec-status.test.ts +130 -0
- package/os/spec/spec-status.ts +5 -18
- package/os/spec/spec-validate.test.ts +76 -1
- package/os/spec/spec-validate.ts +26 -7
- package/os/workflow/handlers.ts +8 -42
- package/os/workflow/index.ts +1 -4
- package/os/workflow/types.ts +0 -22
- package/os/workflow/workflow.module.ts +6 -16
- package/package.json +1 -1
- package/skills/_shared/agent-operating-model.md +83 -0
- package/skills/_shared/fo-pipeline-conventions.md +1 -0
- package/skills/fo/fo-add-tests/SKILL.md +14 -0
- package/skills/fo/fo-fix/SKILL.md +2 -1
- package/skills/fo/fo-handoff/SKILL.md +1 -1
- package/skills/fo/fo-idea/SKILL.md +6 -3
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +8 -0
- package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +4 -2
- package/skills/fo/fo-idea-implement/SKILL.md +68 -53
- package/skills/fo/fo-idea-plan/SKILL.md +3 -1
- package/skills/fo/fo-review/SKILL.md +12 -0
- package/skills/fo/fo-session-save/learned-principles.md +13 -0
- package/skills/fo/fo-step-commit/SKILL.md +1 -1
- package/src/bin-entry.test.ts +37 -0
- package/src/compass/contract-registry.test.ts +14 -0
- package/src/compass/types.test.ts +14 -0
- package/src/config/__tests__/resolve-terminology.test.ts +14 -0
- package/src/config/forge-config.test.ts +14 -0
- package/src/config/forge-config.ts +7 -2
- package/src/forge-module.test.ts +14 -0
- package/src/knowledge/__tests__/promote.test.ts +14 -0
- package/src/knowledge/__tests__/serialize.test.ts +14 -0
- package/src/knowledge/__tests__/sync.test.ts +4 -1
- package/src/knowledge/budgets.test.ts +14 -0
- package/src/knowledge/compact.test.ts +14 -0
- package/src/knowledge/parse.test.ts +14 -0
- package/src/knowledge/schema.test.ts +14 -0
- package/src/migration-adapters/__tests__/ignored-files.test.ts +14 -0
- package/src/migration-adapters/__tests__/registry.test.ts +14 -0
- package/src/migration-adapters/__tests__/types.test.ts +14 -0
- package/src/onboarding/__tests__/workspace-discovery.test.ts +14 -0
- package/src/onboarding/agents-generate.ts +1 -1
- package/src/onboarding/compass-docs/semantic-layer-block.test.ts +6 -0
- package/src/onboarding/create.test.ts +14 -0
- package/src/onboarding/doctor-token-check.test.ts +3 -0
- package/src/onboarding/doctor.test.ts +14 -0
- package/src/onboarding/doctor.ts +3 -3
- package/src/onboarding/init.test.ts +14 -0
- package/src/onboarding/init.ts +2 -2
- package/src/onboarding/nested-agents-templates.ts +1 -1
- package/src/onboarding/prettierignore.ts +1 -1
- package/src/onboarding/scaffold.test.ts +14 -0
- package/src/onboarding/site-workshop-profile.test.ts +3 -0
- package/src/onboarding/templates/behavioral-layer-core.md +8 -0
- package/src/onboarding/upgrade.test.ts +14 -0
- package/src/onboarding/upgrade.ts +2 -2
- package/src/onboarding/workspace-discovery.ts +1 -1
- package/src/pipeline-status.test.ts +14 -0
- package/src/plugin/forge-plugin-manifest.test.ts +14 -0
- package/src/profiles/__tests__/profile-schema.test.ts +14 -0
- package/src/profiles/__tests__/stack-profile.test.ts +14 -0
- package/src/profiles/__tests__/terminology-utils.test.ts +14 -0
- package/src/profiles/profile-schema.ts +1 -0
- package/src/skill-schema.ts +9 -1
- package/src/tests/acceptance-criteria.test.ts +14 -0
- package/src/tests/acceptance-probe-kinds.test.ts +14 -0
- package/src/tests/adr-implement-stamp.test.ts +14 -0
- package/src/tests/agents-generate-domain.test.ts +3 -0
- package/src/tests/agents-generate.test.ts +3 -0
- package/src/tests/bindings-schema.test.ts +2 -0
- package/src/tests/budgets.test.ts +14 -0
- package/src/tests/compact.test.ts +14 -0
- package/src/tests/compass-docs-flag.test.ts +6 -0
- package/src/tests/compass-docs-scaffold.test.ts +6 -0
- package/src/tests/compass-docs-validate-scope.test.ts +6 -0
- package/src/tests/contract-registry.test.ts +14 -0
- package/src/tests/create.test.ts +3 -0
- package/src/tests/discover-pack-skills.test.ts +14 -0
- package/src/tests/doctor-autonomy.test.ts +3 -0
- package/src/tests/doctor-bindings.test.ts +6 -1
- package/src/tests/doctor-dist-freshness.test.ts +26 -2
- package/src/tests/doctor-domain.test.ts +6 -1
- package/src/tests/doctor-fix.test.ts +3 -0
- package/src/tests/doctor-nested-agents.test.ts +3 -0
- package/src/tests/doctor-profile-id-known.test.ts +3 -0
- package/src/tests/doctor-skills-unmanaged.test.ts +3 -0
- package/src/tests/doctor-version-sync.test.ts +4 -1
- package/src/tests/editable-generated-region.test.ts +6 -3
- package/src/tests/exploration-handlers.test.ts +14 -0
- package/src/tests/file-size-lint.test.ts +6 -1
- package/src/tests/fixtures/agents-generate-business-before.txt +8 -0
- package/src/tests/forge-autonomy-validate.test.ts +3 -1
- package/src/tests/forge-config.test.ts +6 -1
- package/src/tests/forge-validate-compass-docs.test.ts +6 -0
- package/src/tests/fs-atomic.test.ts +14 -0
- package/src/tests/fs.test.ts +14 -0
- package/src/tests/generated-marker.test.ts +14 -0
- package/src/tests/hash.test.ts +14 -0
- package/src/tests/implement-stamp.test.ts +476 -10
- package/src/tests/init-bindings.test.ts +6 -1
- package/src/tests/knowledge-parse.test.ts +14 -0
- package/src/tests/knowledge-pbt.test.ts +14 -0
- package/src/tests/markdown-table.test.ts +6 -3
- package/src/tests/memory-compact.test.ts +3 -0
- package/src/tests/memory-scaffold.test.ts +6 -1
- package/src/tests/metrics-rfc-1053.test.ts +14 -0
- package/src/tests/migration-adapters.test.ts +3 -0
- package/src/tests/package-files.test.ts +4 -1
- package/src/tests/package-health-lint-surface.test.ts +3 -0
- package/src/tests/pinned-check.test.ts +14 -0
- package/src/tests/pinned-init.test.ts +14 -0
- package/src/tests/pinned-validate.test.ts +14 -0
- package/src/tests/plugin-manifest.test.ts +14 -0
- package/src/tests/prettierignore-manage.test.ts +3 -0
- package/src/tests/profile-schema.test.ts +6 -1
- package/src/tests/profile-validate.test.ts +6 -1
- package/src/tests/program-lease.test.ts +3 -0
- package/src/tests/program-paths-extended.test.ts +3 -0
- package/src/tests/program-paths.test.ts +3 -0
- package/src/tests/program-property.test.ts +3 -0
- package/src/tests/program-schemas.test.ts +3 -0
- package/src/tests/program-spec-node.test.ts +3 -0
- package/src/tests/promote.test.ts +14 -0
- package/src/tests/public-surface.test.ts +6 -1
- package/src/tests/registry.test.ts +14 -0
- package/src/tests/rfc-evidence-sync.test.ts +347 -0
- package/src/tests/rfc-implement-stamp-governance.test.ts +403 -0
- package/src/tests/scaffold-project.test.ts +3 -0
- package/src/tests/session-handlers.test.ts +14 -0
- package/src/tests/session-pbt.test.ts +14 -0
- package/src/tests/skill-agents-sync.test.ts +3 -4
- package/src/tests/skill-schema.test.ts +53 -0
- package/src/tests/skill-sync-marker.test.ts +3 -0
- package/src/tests/skill-validate-knowledge.test.ts +14 -0
- package/src/tests/skill-validate.test.ts +14 -0
- package/src/tests/stack-profile.test.ts +6 -1
- package/src/tests/string-utils.test.ts +14 -0
- package/src/tests/upgrade.test.ts +6 -1
- package/src/tests/werkstatt-lock.test.ts +14 -0
- package/src/tests/workspace-discovery-domain.test.ts +6 -1
- package/src/tests/workspace-discovery.test.ts +6 -1
- package/src/types.test.ts +14 -0
- package/src/types.ts +30 -1
- package/src/utils/__tests__/fs-idempotent.test.ts +17 -0
- package/src/utils/__tests__/fs-trash.test.ts +17 -0
- package/src/utils/fs-atomic.test.ts +17 -0
- package/src/utils/fs-trash-sync.test.ts +17 -0
- package/src/utils/fs.test.ts +17 -0
- package/src/utils/generated-marker.test.ts +17 -0
- package/src/utils/hash.test.ts +17 -0
- package/src/utils/string-utils.test.ts +17 -0
- package/src/validators/__tests__/note-orphan-detect.test.ts +14 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for implement stamp stale covering rfc.implement.stamp — RFC-IMP-09 stale evidence gate (RFC-1271).
|
|
5
|
+
</purpose>
|
|
6
|
+
<non-goals>
|
|
7
|
+
<item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
|
|
8
|
+
</non-goals>
|
|
9
|
+
</MODULE_CONTRACT>
|
|
10
|
+
<CHANGE_SUMMARY>
|
|
11
|
+
<item>RFC-1311: Compass header sweep — declares the implement suite's contract for test-file scaffold coverage.</item>
|
|
12
|
+
<item>RFC-1310: governance-id parity guards on ecosystem.commit and rfc.implement.stamp</item>
|
|
13
|
+
</CHANGE_SUMMARY>
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// @vitest-environment node
|
|
17
|
+
import { test, expect, describe, vi, beforeEach, afterEach } from "vitest";
|
|
18
|
+
import fs from "node:fs/promises";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import os from "node:os";
|
|
21
|
+
import { execFileSync } from "node:child_process";
|
|
22
|
+
import { parse as yamlParse, stringify as yamlStringify } from "yaml";
|
|
23
|
+
|
|
24
|
+
import { runRfcImplementStamp } from "./implement-stamp.ts";
|
|
25
|
+
import { runRfcVerificationEmit } from "../verification-evidence.ts";
|
|
26
|
+
import type { ForgeCommandInput, ForgeRuntimeContext } from "../../../src/types.ts";
|
|
27
|
+
|
|
28
|
+
const { mockRunProbe } = vi.hoisted(() => ({
|
|
29
|
+
mockRunProbe: vi.fn(),
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
vi.mock("../acceptance.ts", () => ({
|
|
33
|
+
runProbe: mockRunProbe,
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
const PROBE = { probe: "file-exists", path: "src/index.ts", criterion: "AC-1" };
|
|
37
|
+
|
|
38
|
+
const RFC_MD = (id: string, probes: Record<string, unknown>[] | null, body = "Test.\n") => {
|
|
39
|
+
const probeYaml = (probes ?? [])
|
|
40
|
+
.map((p) => ` - probe: ${p.probe}\n path: ${p.path}\n criterion: ${p.criterion}`)
|
|
41
|
+
.join("\n");
|
|
42
|
+
const acceptanceBlock = probes === null ? "" : `acceptance:\n${probeYaml}\n`;
|
|
43
|
+
return `---\nid: ${id}\ntitle: "Test ${id}"\nstatus: accepted\nkind: command\nscope: workspace\nowners:\n - architecture\ncreatedAt: 2026-10-01\nupdatedAt: 2026-10-01\n${acceptanceBlock}---\n\n# ${id}\n## Context\n${body}\n## Acceptance criteria\n\n- [x] AC-1: THE thing SHALL work (evidence: test: packages/forge/x.test.ts)\n`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const git = (dir: string, args: string[]) =>
|
|
47
|
+
execFileSync("git", args, { cwd: dir, encoding: "utf-8" }).trim();
|
|
48
|
+
|
|
49
|
+
const commitAll = (dir: string, msg: string) => {
|
|
50
|
+
git(dir, ["add", "-A"]);
|
|
51
|
+
git(dir, ["commit", "-qm", msg]);
|
|
52
|
+
return git(dir, ["rev-parse", "HEAD"]);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
async function setupGitWorkspace(): Promise<{
|
|
56
|
+
dir: string;
|
|
57
|
+
rfcDir: string;
|
|
58
|
+
cleanup: () => Promise<void>;
|
|
59
|
+
}> {
|
|
60
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "tmp-stamp-"));
|
|
61
|
+
git(dir, ["init", "-q"]);
|
|
62
|
+
git(dir, ["config", "user.email", "t@t.t"]);
|
|
63
|
+
git(dir, ["config", "user.name", "t"]);
|
|
64
|
+
const rfcDir = path.join(dir, "docs", "rfcs");
|
|
65
|
+
await fs.mkdir(rfcDir, { recursive: true });
|
|
66
|
+
return {
|
|
67
|
+
dir,
|
|
68
|
+
rfcDir,
|
|
69
|
+
cleanup: () => fs.rm(dir, { recursive: true, force: true }),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function makeContext(workspaceRoot: string) {
|
|
74
|
+
return {
|
|
75
|
+
workspaceRoot,
|
|
76
|
+
logger: { info: () => {}, warn: () => {} },
|
|
77
|
+
outputFormat: "json" as const,
|
|
78
|
+
commandRegistry: undefined,
|
|
79
|
+
dryRun: false,
|
|
80
|
+
} as unknown as ForgeRuntimeContext;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const writeRfc = async (rfcDir: string, md: string) =>
|
|
84
|
+
fs.writeFile(path.join(rfcDir, "rfc-0100-stale.md"), md);
|
|
85
|
+
|
|
86
|
+
async function emitEnvelope(dir: string) {
|
|
87
|
+
mockRunProbe.mockResolvedValue({ probe: PROBE, ok: true, detail: "exists" });
|
|
88
|
+
const r = await runRfcVerificationEmit(
|
|
89
|
+
{ flags: { id: "RFC-0100" } } as unknown as ForgeCommandInput,
|
|
90
|
+
makeContext(dir),
|
|
91
|
+
);
|
|
92
|
+
expect(r.exitCode).toBe(0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const stamp = (dir: string, commit: string) =>
|
|
96
|
+
runRfcImplementStamp(
|
|
97
|
+
{
|
|
98
|
+
flags: { id: "RFC-0100", "implementation-commit": commit },
|
|
99
|
+
} as unknown as ForgeCommandInput,
|
|
100
|
+
makeContext(dir),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const rules = (result: Awaited<ReturnType<typeof stamp>>) =>
|
|
104
|
+
(result.data!.violations ?? []).map((v) => v.rule);
|
|
105
|
+
|
|
106
|
+
beforeEach(() => {
|
|
107
|
+
mockRunProbe.mockReset();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
afterEach(() => {
|
|
111
|
+
vi.restoreAllMocks();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe("rfc.implement.stamp — RFC-IMP-09 stale evidence gate (RFC-1271)", () => {
|
|
115
|
+
test("matching evidence does NOT emit RFC-IMP-09 (AC-8)", async () => {
|
|
116
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
117
|
+
try {
|
|
118
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
119
|
+
await emitEnvelope(dir);
|
|
120
|
+
const sha = commitAll(
|
|
121
|
+
dir,
|
|
122
|
+
"feat: implement RFC-0100 evidence-driven gate\n\nX-RFC: RFC-0100",
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const result = await stamp(dir, sha);
|
|
126
|
+
expect(rules(result)).not.toContain("RFC-IMP-09");
|
|
127
|
+
expect(rules(result)).toEqual([]);
|
|
128
|
+
} finally {
|
|
129
|
+
await cleanup();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test("stale acceptanceHash — probe criterion changed post-emit (AC-1)", async () => {
|
|
134
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
135
|
+
try {
|
|
136
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
137
|
+
await emitEnvelope(dir);
|
|
138
|
+
commitAll(dir, "feat: implement RFC-0100");
|
|
139
|
+
|
|
140
|
+
// Criterion retarget on the probe — committed, so IMP-04 passes.
|
|
141
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [{ ...PROBE, criterion: "AC-9" }]));
|
|
142
|
+
commitAll(dir, "chore: tweak RFC-0100 probes");
|
|
143
|
+
|
|
144
|
+
const result = await stamp(dir, git(dir, ["rev-parse", "HEAD"]));
|
|
145
|
+
expect(rules(result)).toContain("RFC-IMP-09");
|
|
146
|
+
const v = result.data!.violations.find((x) => x.rule === "RFC-IMP-09")!;
|
|
147
|
+
expect(v.message).toContain("acceptanceHash");
|
|
148
|
+
expect(v.message).toContain("rfc.verification.emit --id RFC-0100");
|
|
149
|
+
} finally {
|
|
150
|
+
await cleanup();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test("stale rfcFileHash — body changed post-emit (AC-2)", async () => {
|
|
155
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
156
|
+
try {
|
|
157
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
158
|
+
await emitEnvelope(dir);
|
|
159
|
+
commitAll(dir, "feat: implement RFC-0100");
|
|
160
|
+
|
|
161
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE], "Edited body.\n"));
|
|
162
|
+
commitAll(dir, "chore: edit RFC-0100 body");
|
|
163
|
+
|
|
164
|
+
const result = await stamp(dir, git(dir, ["rev-parse", "HEAD"]));
|
|
165
|
+
expect(rules(result)).toContain("RFC-IMP-09");
|
|
166
|
+
const v = result.data!.violations.find((x) => x.rule === "RFC-IMP-09")!;
|
|
167
|
+
expect(v.message).toContain("rfcFileHash");
|
|
168
|
+
expect(v.message).not.toContain("acceptanceHash mismatch");
|
|
169
|
+
} finally {
|
|
170
|
+
await cleanup();
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
test("acceptance list deleted post-emit → IMP-09 names probe deletion", async () => {
|
|
175
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
176
|
+
try {
|
|
177
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
178
|
+
await emitEnvelope(dir);
|
|
179
|
+
commitAll(dir, "feat: implement RFC-0100");
|
|
180
|
+
|
|
181
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", null));
|
|
182
|
+
commitAll(dir, "chore: drop RFC-0100 probes");
|
|
183
|
+
|
|
184
|
+
const result = await stamp(dir, git(dir, ["rev-parse", "HEAD"]));
|
|
185
|
+
expect(rules(result)).toContain("RFC-IMP-09");
|
|
186
|
+
const v = result.data!.violations.find((x) => x.rule === "RFC-IMP-09")!;
|
|
187
|
+
expect(v.message).toContain("probes were deleted");
|
|
188
|
+
} finally {
|
|
189
|
+
await cleanup();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test("malformed scalar envelope → IMP-09 fail-closed (no evasion)", async () => {
|
|
194
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
195
|
+
try {
|
|
196
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
197
|
+
const envPath = path.join(dir, "docs", "rfcs", "verification", "rfc-0100.generated.yaml");
|
|
198
|
+
await fs.mkdir(path.dirname(envPath), { recursive: true });
|
|
199
|
+
// yamlParse("0") → 0 — falsy scalar must NOT slip the gate open.
|
|
200
|
+
await fs.writeFile(envPath, "0\n");
|
|
201
|
+
commitAll(dir, "feat: implement RFC-0100 with forged scalar envelope");
|
|
202
|
+
|
|
203
|
+
const result = await stamp(dir, git(dir, ["rev-parse", "HEAD"]));
|
|
204
|
+
expect(rules(result)).toContain("RFC-IMP-09");
|
|
205
|
+
const v = result.data!.violations.find((x) => x.rule === "RFC-IMP-09")!;
|
|
206
|
+
expect(v.message).toContain("malformed");
|
|
207
|
+
} finally {
|
|
208
|
+
await cleanup();
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
test("unparseable envelope → IMP-09 fail-closed", async () => {
|
|
213
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
214
|
+
try {
|
|
215
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
216
|
+
const envPath = path.join(dir, "docs", "rfcs", "verification", "rfc-0100.generated.yaml");
|
|
217
|
+
await fs.mkdir(path.dirname(envPath), { recursive: true });
|
|
218
|
+
await fs.writeFile(envPath, "{{{not yaml: [unclosed\n");
|
|
219
|
+
commitAll(dir, "feat: implement RFC-0100 with broken envelope");
|
|
220
|
+
|
|
221
|
+
const result = await stamp(dir, git(dir, ["rev-parse", "HEAD"]));
|
|
222
|
+
expect(rules(result)).toContain("RFC-IMP-09");
|
|
223
|
+
const v = result.data!.violations.find((x) => x.rule === "RFC-IMP-09")!;
|
|
224
|
+
expect(v.message).toContain("malformed");
|
|
225
|
+
} finally {
|
|
226
|
+
await cleanup();
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
test("successful stamp auto re-emits — envelope binds the implemented-state file", async () => {
|
|
231
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
232
|
+
try {
|
|
233
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
234
|
+
await emitEnvelope(dir);
|
|
235
|
+
const sha = commitAll(dir, "feat: implement RFC-0100\n\nX-RFC: RFC-0100");
|
|
236
|
+
|
|
237
|
+
const result = await stamp(dir, sha);
|
|
238
|
+
expect(rules(result)).toEqual([]);
|
|
239
|
+
expect(result.data!.data?.evidenceReEmitted).toBe(true);
|
|
240
|
+
|
|
241
|
+
// Born-stale regression: the envelope MUST describe the post-mutation
|
|
242
|
+
// file — a fresh emit --check on the stamped state diverges on nothing.
|
|
243
|
+
const envPath = path.join(dir, "docs", "rfcs", "verification", "rfc-0100.generated.yaml");
|
|
244
|
+
const env = yamlParse(await fs.readFile(envPath, "utf-8")) as Record<string, unknown>;
|
|
245
|
+
expect(env["rfcStatus"]).toBe("implemented");
|
|
246
|
+
|
|
247
|
+
mockRunProbe.mockResolvedValue({ probe: PROBE, ok: true, detail: "exists" });
|
|
248
|
+
const check = await runRfcVerificationEmit(
|
|
249
|
+
{ flags: { id: "RFC-0100", check: true } } as unknown as ForgeCommandInput,
|
|
250
|
+
makeContext(dir),
|
|
251
|
+
);
|
|
252
|
+
expect(check.exitCode).toBe(0);
|
|
253
|
+
expect(check.data!.check![0]).toMatchObject({
|
|
254
|
+
rfcId: "RFC-0100",
|
|
255
|
+
match: true,
|
|
256
|
+
});
|
|
257
|
+
} finally {
|
|
258
|
+
await cleanup();
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
test("envelope lacking hash fields → IMP-09 fail-closed", async () => {
|
|
263
|
+
const { dir, rfcDir, cleanup } = await setupGitWorkspace();
|
|
264
|
+
try {
|
|
265
|
+
await writeRfc(rfcDir, RFC_MD("RFC-0100", [PROBE]));
|
|
266
|
+
await emitEnvelope(dir);
|
|
267
|
+
commitAll(dir, "feat: implement RFC-0100");
|
|
268
|
+
|
|
269
|
+
// Strip the hash fields to simulate a pre-RFC-0330 envelope.
|
|
270
|
+
const envPath = path.join(dir, "docs", "rfcs", "verification", "rfc-0100.generated.yaml");
|
|
271
|
+
const env = yamlParse(await fs.readFile(envPath, "utf-8")) as Record<string, unknown>;
|
|
272
|
+
delete env["rfcFileHash"];
|
|
273
|
+
delete env["acceptanceHash"];
|
|
274
|
+
await fs.writeFile(envPath, yamlStringify(env) + "\n");
|
|
275
|
+
commitAll(dir, "chore: age RFC-0100 envelope");
|
|
276
|
+
|
|
277
|
+
const result = await stamp(dir, git(dir, ["rev-parse", "HEAD"]));
|
|
278
|
+
expect(rules(result)).toContain("RFC-IMP-09");
|
|
279
|
+
const v = result.data!.violations.find((x) => x.rule === "RFC-IMP-09")!;
|
|
280
|
+
expect(v.message).toContain("lacks hash fields");
|
|
281
|
+
} finally {
|
|
282
|
+
await cleanup();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
});
|