@warpgogol/forge 7.0.0 → 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 +24 -0
- 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 +51 -1
- 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 +594 -81
- 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 +60 -8
- 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 +89 -5
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +81 -12
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +15 -10
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +10 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +175 -10
- 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/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 +25 -0
- package/os/rfc/acceptance.ts +51 -1
- 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 +20 -2
- package/os/rfc/handlers/implement-stamp.ts +714 -87
- 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 +14 -0
- package/os/rfc/handlers/validate-rules.ts +80 -7
- package/os/rfc/handlers/validate.test.ts +4 -3
- package/os/rfc/reachable-symbol.ts +441 -0
- package/os/rfc/rfc-0000-template.md +3 -0
- 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 +95 -5
- package/os/rfc/types.ts +106 -12
- package/os/rfc/verification-emit-check.test.ts +14 -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 +230 -10
- package/os/rfc/verification-normalize.test.ts +14 -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 +1 -1
- 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-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/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/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/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 +14 -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
|
@@ -49,16 +49,45 @@ function makeInput(flags: Record<string, unknown>) {
|
|
|
49
49
|
// by compass.summary.record itself and rewritten at commit time.
|
|
50
50
|
const CS_OPEN = "<" + "CHANGE_SUMMARY>";
|
|
51
51
|
const CS_CLOSE = "</" + "CHANGE_SUMMARY>";
|
|
52
|
+
const MC_OPEN = "<" + "MODULE_CONTRACT>";
|
|
53
|
+
const MC_CLOSE = "</" + "MODULE_CONTRACT>";
|
|
52
54
|
const CS_BLOCK_RE = new RegExp(`${CS_OPEN}[\\s\\S]*?${CS_CLOSE}`);
|
|
55
|
+
const HTML_OPEN = "<!" + "--";
|
|
56
|
+
const HTML_CLOSE = "--" + ">";
|
|
57
|
+
|
|
58
|
+
// .astro headers can live in a markup comment below the frontmatter — the
|
|
59
|
+
// extension table guesses block, the real enclosure is html.
|
|
60
|
+
const ASTRO_HTML_HEADER = (items: string[]) => `---
|
|
61
|
+
const frontmatter = true;
|
|
62
|
+
---
|
|
63
|
+
${HTML_OPEN}
|
|
64
|
+
${MC_OPEN}
|
|
65
|
+
<purpose>Astro page fixture exercising html-enclosed Compass headers.</purpose>
|
|
66
|
+
<non-goals><item>No production logic.</item></non-goals>
|
|
67
|
+
${MC_CLOSE}
|
|
68
|
+
${CS_OPEN}
|
|
69
|
+
${items.map((i) => ` <item>${i}</item>`).join("\n")}
|
|
70
|
+
${CS_CLOSE}
|
|
71
|
+
${HTML_CLOSE}
|
|
72
|
+
<main/>
|
|
73
|
+
`;
|
|
53
74
|
|
|
54
75
|
const TS_HEADER = (items: string[], history?: string[]) => `/*
|
|
55
76
|
<MODULE_CONTRACT>
|
|
56
|
-
<purpose>
|
|
77
|
+
<purpose>
|
|
78
|
+
Unit tests for summary record covering compass.summary.record; summary-record helpers. It also guards the documented public contract and regression-sensitive edge cases.
|
|
79
|
+
</purpose>
|
|
57
80
|
<non-goals><item>No production logic.</item></non-goals>
|
|
58
81
|
</MODULE_CONTRACT>
|
|
59
82
|
${CS_OPEN}
|
|
60
83
|
${items.map((i) => ` <item>${i}</item>`).join("\n")}
|
|
61
84
|
${history && history.length > 0 ? ` <history>${history.join(", ")}</history>\n` : ""}${CS_CLOSE}
|
|
85
|
+
<CHANGE_SUMMARY>
|
|
86
|
+
<item>RFC-1311: Compass header sweep — declares the summary suite's contract for test-file scaffold coverage.</item>
|
|
87
|
+
<item>RFC-1323: write-time comment-terminator safety — shared comment-safety seam, authored CS-08 reject, injected neutralization, header-region scan</item>
|
|
88
|
+
<item>RFC-1323: review pass — still-open enclosing-style detection, per-file pre-pass parity, scaffold never-throws, docs.scaffold raw-leaf assert, trim per-file skip, CS-08 always-error severity</item>
|
|
89
|
+
<item>RFC-1323: re-review pass — frontmatter-zone enclosing-style detection, existing-item pre-pass gating, trim exit-1 on unsafe, nextSteps rule labels, severity/census test coverage</item>
|
|
90
|
+
</CHANGE_SUMMARY>
|
|
62
91
|
*/
|
|
63
92
|
export const x = 1;
|
|
64
93
|
`;
|
|
@@ -207,6 +236,82 @@ describe("compass.summary.record", () => {
|
|
|
207
236
|
expect(source).toContain("<item>RFC-1095: step 2</item>");
|
|
208
237
|
});
|
|
209
238
|
|
|
239
|
+
it("suppresses a diff-added same-ID item even when HEAD already carries the ID (RFC-1315 AC-1)", async () => {
|
|
240
|
+
execFileSync("git", ["init"], { cwd: root });
|
|
241
|
+
execFileSync("git", ["config", "user.email", "t@t"], { cwd: root });
|
|
242
|
+
execFileSync("git", ["config", "user.name", "T"], { cwd: root });
|
|
243
|
+
await writeFile(
|
|
244
|
+
join(root, "src", "a.ts"),
|
|
245
|
+
TS_HEADER(["RFC-1315: step 1 — recorded by the previous commit"]),
|
|
246
|
+
);
|
|
247
|
+
execFileSync("git", ["add", "-A"], { cwd: root });
|
|
248
|
+
execFileSync("git", ["commit", "-m", "baseline"], { cwd: root });
|
|
249
|
+
// Pending change hand-authors a second, descriptive same-ID item.
|
|
250
|
+
await writeFile(
|
|
251
|
+
join(root, "src", "a.ts"),
|
|
252
|
+
TS_HEADER([
|
|
253
|
+
"RFC-1315: step 1 — recorded by the previous commit",
|
|
254
|
+
"RFC-1315: hand-authored descriptive entry for this step",
|
|
255
|
+
]),
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
const result = await runCompassSummaryRecord(
|
|
259
|
+
makeInput({ id: "RFC-1315", files: ["src/a.ts"], text: "generic subject line" }),
|
|
260
|
+
makeContext(root),
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
expect(result.data?.skipped).toEqual([{ file: "src/a.ts", reason: "id-in-diff" }]);
|
|
264
|
+
expect(result.data?.recorded).toEqual([]);
|
|
265
|
+
const source = await readFile(join(root, "src", "a.ts"), "utf8");
|
|
266
|
+
expect(source).not.toContain("generic subject line");
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it("does not suppress when the diff adds an item for a different ID (RFC-1315)", async () => {
|
|
270
|
+
execFileSync("git", ["init"], { cwd: root });
|
|
271
|
+
execFileSync("git", ["config", "user.email", "t@t"], { cwd: root });
|
|
272
|
+
execFileSync("git", ["config", "user.name", "T"], { cwd: root });
|
|
273
|
+
await writeFile(join(root, "src", "a.ts"), TS_HEADER(["RFC-0001: existing item."]));
|
|
274
|
+
execFileSync("git", ["add", "-A"], { cwd: root });
|
|
275
|
+
execFileSync("git", ["commit", "-m", "baseline"], { cwd: root });
|
|
276
|
+
await writeFile(
|
|
277
|
+
join(root, "src", "a.ts"),
|
|
278
|
+
TS_HEADER(["RFC-0001: existing item.", "RFC-0002: another RFC's item"]),
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
const result = await runCompassSummaryRecord(
|
|
282
|
+
makeInput({ id: "RFC-1315", files: ["src/a.ts"], text: "inject me" }),
|
|
283
|
+
makeContext(root),
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
expect(result.data?.recorded).toEqual(["src/a.ts"]);
|
|
287
|
+
const source = await readFile(join(root, "src", "a.ts"), "utf8");
|
|
288
|
+
expect(source).toContain("<item>RFC-1315: inject me</item>");
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("suppresses when the diff verbatim re-adds a same-ID item line (RFC-1315)", async () => {
|
|
292
|
+
execFileSync("git", ["init"], { cwd: root });
|
|
293
|
+
execFileSync("git", ["config", "user.email", "t@t"], { cwd: root });
|
|
294
|
+
execFileSync("git", ["config", "user.name", "T"], { cwd: root });
|
|
295
|
+
await writeFile(
|
|
296
|
+
join(root, "src", "a.ts"),
|
|
297
|
+
TS_HEADER(["RFC-1315: the same line", "RFC-0001: other item."]),
|
|
298
|
+
);
|
|
299
|
+
execFileSync("git", ["add", "-A"], { cwd: root });
|
|
300
|
+
execFileSync("git", ["commit", "-m", "baseline"], { cwd: root });
|
|
301
|
+
// Swapped item order — git emits the RFC-1315 line as -/+ verbatim re-add.
|
|
302
|
+
await writeFile(
|
|
303
|
+
join(root, "src", "a.ts"),
|
|
304
|
+
TS_HEADER(["RFC-0001: other item.", "RFC-1315: the same line"]),
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
const result = await runCompassSummaryRecord(
|
|
308
|
+
makeInput({ id: "RFC-1315", files: ["src/a.ts"], text: "generic subject" }),
|
|
309
|
+
makeContext(root),
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
expect(result.data?.skipped).toEqual([{ file: "src/a.ts", reason: "id-in-diff" }]);
|
|
313
|
+
});
|
|
314
|
+
|
|
210
315
|
it("defaults item text to the bare ID when --text is absent", async () => {
|
|
211
316
|
await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
|
|
212
317
|
await runCompassSummaryRecord(
|
|
@@ -256,13 +361,14 @@ describe("compass.summary.record", () => {
|
|
|
256
361
|
expect(source).not.toContain("devin.ai");
|
|
257
362
|
});
|
|
258
363
|
|
|
259
|
-
it("neutralizes a literal star-slash in --text so the item cannot terminate the block comment (RFC-1233 AC-2)", async () => {
|
|
364
|
+
it("neutralizes a literal star-slash in injected --text so the item cannot terminate the block comment (RFC-1233 AC-2, RFC-1323)", async () => {
|
|
260
365
|
await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
|
|
261
|
-
await runCompassSummaryRecord(
|
|
366
|
+
const result = await runCompassSummaryRecord(
|
|
262
367
|
makeInput({
|
|
263
368
|
id: "RFC-1233",
|
|
264
369
|
files: ["src/a.ts"],
|
|
265
370
|
text: "glob src" + "/**/*.ts in comments",
|
|
371
|
+
injected: true,
|
|
266
372
|
}),
|
|
267
373
|
makeContext(root),
|
|
268
374
|
);
|
|
@@ -271,6 +377,26 @@ describe("compass.summary.record", () => {
|
|
|
271
377
|
expect(source.match(CS_BLOCK_RE)).not.toBeNull();
|
|
272
378
|
// The neutralized form keeps both characters readable but cannot close /*.
|
|
273
379
|
expect(source).toContain("glob src/**" + "∕*.ts in comments");
|
|
380
|
+
// RFC-1323: the record report marks the neutralized file.
|
|
381
|
+
expect(result.data?.neutralized).toEqual(["src/a.ts"]);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it("rejects a literal star-slash in authored --text with COMPASS-CS-08 and writes nothing (RFC-1323 AC-1)", async () => {
|
|
385
|
+
await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
|
|
386
|
+
const before = await readFile(join(root, "src", "a.ts"), "utf8");
|
|
387
|
+
const result = await runCompassSummaryRecord(
|
|
388
|
+
makeInput({
|
|
389
|
+
id: "RFC-1323",
|
|
390
|
+
files: ["src/a.ts"],
|
|
391
|
+
text: "glob src" + "/**/*.ts in comments",
|
|
392
|
+
}),
|
|
393
|
+
makeContext(root),
|
|
394
|
+
);
|
|
395
|
+
expect(result.exitCode).toBe(1);
|
|
396
|
+
expect(result.summary).toContain("COMPASS-CS-08");
|
|
397
|
+
expect(result.summary).toContain("src/a.ts");
|
|
398
|
+
// Fail closed: the file is untouched.
|
|
399
|
+
expect(await readFile(join(root, "src", "a.ts"), "utf8")).toBe(before);
|
|
274
400
|
});
|
|
275
401
|
|
|
276
402
|
it("keeps a single-line subject identical — negative regression (RFC-1233 AC-3)", async () => {
|
|
@@ -297,6 +423,191 @@ describe("compass.summary.record", () => {
|
|
|
297
423
|
expect(source).toContain("Note: this line is prose about the fix");
|
|
298
424
|
expect(source).toContain("final summary line");
|
|
299
425
|
});
|
|
426
|
+
|
|
427
|
+
// RFC-1323: style-aware authored/injected coverage. Concatenation keeps the
|
|
428
|
+
// terminator literal out of this file's own comment-level view.
|
|
429
|
+
const BLOCK_TERM = "*" + "/";
|
|
430
|
+
const HTML_CLOSE = "--" + ">";
|
|
431
|
+
const MD_HEADER = (items: string[]) => `${"<"}!--
|
|
432
|
+
${MC_OPEN}
|
|
433
|
+
<purpose>
|
|
434
|
+
Fixture markdown doc for summary record tests.
|
|
435
|
+
</purpose>
|
|
436
|
+
${MC_CLOSE}
|
|
437
|
+
${CS_OPEN}
|
|
438
|
+
${items.map((i) => ` <item>${i}</item>`).join("\n")}
|
|
439
|
+
${CS_CLOSE}
|
|
440
|
+
${HTML_CLOSE}
|
|
441
|
+
`;
|
|
442
|
+
|
|
443
|
+
it("rejects an authored html terminator on a .md target with COMPASS-CS-08 (RFC-1323 AC-1)", async () => {
|
|
444
|
+
await mkdir(join(root, "docs"), { recursive: true });
|
|
445
|
+
await writeFile(join(root, "docs", "guide.md"), MD_HEADER([]));
|
|
446
|
+
const before = await readFile(join(root, "docs", "guide.md"), "utf8");
|
|
447
|
+
const result = await runCompassSummaryRecord(
|
|
448
|
+
makeInput({
|
|
449
|
+
id: "RFC-1323",
|
|
450
|
+
files: ["docs/guide.md"],
|
|
451
|
+
text: `close the comment ${HTML_CLOSE} here`,
|
|
452
|
+
}),
|
|
453
|
+
makeContext(root),
|
|
454
|
+
);
|
|
455
|
+
expect(result.exitCode).toBe(1);
|
|
456
|
+
expect(result.summary).toContain("COMPASS-CS-08");
|
|
457
|
+
expect(await readFile(join(root, "docs", "guide.md"), "utf8")).toBe(before);
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
it("accepts authored text whose star-slash is harmless in the target's html style (RFC-1323)", async () => {
|
|
461
|
+
await mkdir(join(root, "docs"), { recursive: true });
|
|
462
|
+
await writeFile(join(root, "docs", "guide.md"), MD_HEADER([]));
|
|
463
|
+
const result = await runCompassSummaryRecord(
|
|
464
|
+
makeInput({
|
|
465
|
+
id: "RFC-1323",
|
|
466
|
+
files: ["docs/guide.md"],
|
|
467
|
+
text: `glob src${BLOCK_TERM}*.ts stays literal in html comments`,
|
|
468
|
+
}),
|
|
469
|
+
makeContext(root),
|
|
470
|
+
);
|
|
471
|
+
expect(result.exitCode).toBe(0);
|
|
472
|
+
const source = await readFile(join(root, "docs", "guide.md"), "utf8");
|
|
473
|
+
expect(source).toContain(`glob src${BLOCK_TERM}*.ts stays literal`);
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
it("neutralizes html terminators in injected --text and reports the file (RFC-1323)", async () => {
|
|
477
|
+
await mkdir(join(root, "docs"), { recursive: true });
|
|
478
|
+
await writeFile(join(root, "docs", "guide.md"), MD_HEADER([]));
|
|
479
|
+
const result = await runCompassSummaryRecord(
|
|
480
|
+
makeInput({
|
|
481
|
+
id: "RFC-1323",
|
|
482
|
+
files: ["docs/guide.md"],
|
|
483
|
+
text: `close ${HTML_CLOSE} open ${"<"}!--`,
|
|
484
|
+
injected: true,
|
|
485
|
+
}),
|
|
486
|
+
makeContext(root),
|
|
487
|
+
);
|
|
488
|
+
expect(result.exitCode).toBe(0);
|
|
489
|
+
const source = await readFile(join(root, "docs", "guide.md"), "utf8");
|
|
490
|
+
expect(source).toContain(`close --› open ‹!--`);
|
|
491
|
+
expect(result.data?.neutralized).toEqual(["docs/guide.md"]);
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
it("a mixed target set rejects authored text unsafe for ANY member's style (RFC-1323)", async () => {
|
|
495
|
+
await mkdir(join(root, "docs"), { recursive: true });
|
|
496
|
+
await writeFile(join(root, "docs", "guide.md"), MD_HEADER([]));
|
|
497
|
+
await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
|
|
498
|
+
const tsBefore = await readFile(join(root, "src", "a.ts"), "utf8");
|
|
499
|
+
const mdBefore = await readFile(join(root, "docs", "guide.md"), "utf8");
|
|
500
|
+
const result = await runCompassSummaryRecord(
|
|
501
|
+
makeInput({
|
|
502
|
+
id: "RFC-1323",
|
|
503
|
+
files: ["docs/guide.md", "src/a.ts"],
|
|
504
|
+
text: `glob src${BLOCK_TERM}*.ts`,
|
|
505
|
+
}),
|
|
506
|
+
makeContext(root),
|
|
507
|
+
);
|
|
508
|
+
// Legal inside guide.md's html comment but fatal inside a.ts's block
|
|
509
|
+
// comment — the whole set fails closed, nothing is written anywhere.
|
|
510
|
+
expect(result.exitCode).toBe(1);
|
|
511
|
+
expect(await readFile(join(root, "src", "a.ts"), "utf8")).toBe(tsBefore);
|
|
512
|
+
expect(await readFile(join(root, "docs", "guide.md"), "utf8")).toBe(mdBefore);
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
// RFC-1323 review fixes: .astro files carry BOTH candidate styles — the
|
|
516
|
+
// enclosing comment, not the extension guess, must gate the write.
|
|
517
|
+
it("rejects an authored html terminator on an .astro file whose header is html-enclosed (RFC-1323)", async () => {
|
|
518
|
+
await writeFile(join(root, "src", "page.astro"), ASTRO_HTML_HEADER([]));
|
|
519
|
+
const before = await readFile(join(root, "src", "page.astro"), "utf8");
|
|
520
|
+
const result = await runCompassSummaryRecord(
|
|
521
|
+
makeInput({
|
|
522
|
+
id: "RFC-1323",
|
|
523
|
+
files: ["src/page.astro"],
|
|
524
|
+
text: `close the comment ${HTML_CLOSE} here`,
|
|
525
|
+
}),
|
|
526
|
+
makeContext(root),
|
|
527
|
+
);
|
|
528
|
+
// The extension table guesses block for .astro — the pre-pass must still
|
|
529
|
+
// catch the html terminator, and nothing must be written.
|
|
530
|
+
expect(result.exitCode).toBe(1);
|
|
531
|
+
expect(result.summary).toContain("COMPASS-CS-08");
|
|
532
|
+
expect(await readFile(join(root, "src", "page.astro"), "utf8")).toBe(before);
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
it("allows authored star-slash text on an .astro file whose header is html-enclosed (RFC-1323)", async () => {
|
|
536
|
+
await writeFile(join(root, "src", "page.astro"), ASTRO_HTML_HEADER([]));
|
|
537
|
+
const result = await runCompassSummaryRecord(
|
|
538
|
+
makeInput({
|
|
539
|
+
id: "RFC-1323",
|
|
540
|
+
files: ["src/page.astro"],
|
|
541
|
+
text: `glob src${BLOCK_TERM}*.ts is inert inside an html comment`,
|
|
542
|
+
}),
|
|
543
|
+
makeContext(root),
|
|
544
|
+
);
|
|
545
|
+
expect(result.exitCode).toBe(0);
|
|
546
|
+
const source = await readFile(join(root, "src", "page.astro"), "utf8");
|
|
547
|
+
expect(source).toContain(`glob src${BLOCK_TERM}*.ts is inert`);
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
it("neutralizes injected html terminators inside an .astro html header (RFC-1323)", async () => {
|
|
551
|
+
await writeFile(join(root, "src", "page.astro"), ASTRO_HTML_HEADER([]));
|
|
552
|
+
const result = await runCompassSummaryRecord(
|
|
553
|
+
makeInput({
|
|
554
|
+
id: "RFC-1323",
|
|
555
|
+
files: ["src/page.astro"],
|
|
556
|
+
text: `close ${HTML_CLOSE} open ${"<"}!--`,
|
|
557
|
+
injected: true,
|
|
558
|
+
}),
|
|
559
|
+
makeContext(root),
|
|
560
|
+
);
|
|
561
|
+
expect(result.exitCode).toBe(0);
|
|
562
|
+
const source = await readFile(join(root, "src", "page.astro"), "utf8");
|
|
563
|
+
expect(source).toContain(`close --› open ‹!--`);
|
|
564
|
+
expect(result.data?.neutralized).toEqual(["src/page.astro"]);
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
it("a .ts + .astro-html mixed set rejects authored html text before EITHER file is written (RFC-1323)", async () => {
|
|
568
|
+
await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
|
|
569
|
+
await writeFile(join(root, "src", "page.astro"), ASTRO_HTML_HEADER([]));
|
|
570
|
+
const tsBefore = await readFile(join(root, "src", "a.ts"), "utf8");
|
|
571
|
+
const astroBefore = await readFile(join(root, "src", "page.astro"), "utf8");
|
|
572
|
+
const result = await runCompassSummaryRecord(
|
|
573
|
+
makeInput({
|
|
574
|
+
id: "RFC-1323",
|
|
575
|
+
// a.ts comes FIRST in the list — a divergent pre-pass would write it
|
|
576
|
+
// before the astro file rejects mid-loop. Atomicity: nothing written.
|
|
577
|
+
files: ["src/a.ts", "src/page.astro"],
|
|
578
|
+
text: `close the comment ${HTML_CLOSE} here`,
|
|
579
|
+
}),
|
|
580
|
+
makeContext(root),
|
|
581
|
+
);
|
|
582
|
+
expect(result.exitCode).toBe(1);
|
|
583
|
+
expect(await readFile(join(root, "src", "a.ts"), "utf8")).toBe(tsBefore);
|
|
584
|
+
expect(await readFile(join(root, "src", "page.astro"), "utf8")).toBe(astroBefore);
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
it("a PRE-EXISTING corrupt item aborts the record before any file writes (RFC-1323)", async () => {
|
|
588
|
+
// The html item parses (<!-- does not end the comment) but re-emitting it
|
|
589
|
+
// would corrupt — buildChangeSummaryBlock asserts all items, so the
|
|
590
|
+
// pre-pass must catch it before the first file in the batch is written.
|
|
591
|
+
await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
|
|
592
|
+
await writeFile(
|
|
593
|
+
join(root, "src", "page.astro"),
|
|
594
|
+
ASTRO_HTML_HEADER([`RFC-0001: existing ${"<"}!-- note`]),
|
|
595
|
+
);
|
|
596
|
+
const tsBefore = await readFile(join(root, "src", "a.ts"), "utf8");
|
|
597
|
+
const astroBefore = await readFile(join(root, "src", "page.astro"), "utf8");
|
|
598
|
+
const result = await runCompassSummaryRecord(
|
|
599
|
+
makeInput({
|
|
600
|
+
id: "RFC-1323",
|
|
601
|
+
files: ["src/a.ts", "src/page.astro"],
|
|
602
|
+
text: "harmless new text",
|
|
603
|
+
}),
|
|
604
|
+
makeContext(root),
|
|
605
|
+
);
|
|
606
|
+
expect(result.exitCode).toBe(1);
|
|
607
|
+
expect(result.summary).toContain("COMPASS-CS-08");
|
|
608
|
+
expect(await readFile(join(root, "src", "a.ts"), "utf8")).toBe(tsBefore);
|
|
609
|
+
expect(await readFile(join(root, "src", "page.astro"), "utf8")).toBe(astroBefore);
|
|
610
|
+
});
|
|
300
611
|
});
|
|
301
612
|
|
|
302
613
|
describe("summary-record helpers", () => {
|
|
@@ -359,6 +670,16 @@ describe("summary-record helpers", () => {
|
|
|
359
670
|
).toBe("subject\n\nbody line");
|
|
360
671
|
});
|
|
361
672
|
|
|
673
|
+
it("stripGitTrailers keeps a governed subject line that looks like a trailer", () => {
|
|
674
|
+
expect(stripGitTrailers("RFC-1331: steps 1-2 — analyzer")).toBe(
|
|
675
|
+
"RFC-1331: steps 1-2 — analyzer",
|
|
676
|
+
);
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
it("stripGitTrailers keeps a lowercase governed subject", () => {
|
|
680
|
+
expect(stripGitTrailers("rfc-1331: steps")).toBe("rfc-1331: steps");
|
|
681
|
+
});
|
|
682
|
+
|
|
362
683
|
it("stripGitTrailers keeps a lone markdown-link tail (no strict trailer line)", () => {
|
|
363
684
|
const msg = "subject\n\nsee [the docs](https://example.com)";
|
|
364
685
|
expect(stripGitTrailers(msg)).toBe(msg);
|
package/os/compass/index.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<item>RFC-1097: steps 1-4 — compass.migrate codemod
|
|
13
13
|
|
|
14
14
|
Add the v1 to v2 Compass header codemod: migrateFile pure transform (collapse, strip, seed, reorder, purpose-flag actions), migrateWorkspace walker, runCompassMigrate handler with dirty-tree refusal and --force/--files/--dry-run flags, module registration, and 15 unit tests.</item>
|
|
15
|
+
<item>RFC-1323: write-time comment-terminator safety — shared comment-safety seam, authored CS-08 reject, injected neutralization, header-region scan</item>
|
|
15
16
|
</CHANGE_SUMMARY>
|
|
16
17
|
*/
|
|
17
18
|
|
|
@@ -49,3 +50,17 @@ export {
|
|
|
49
50
|
type SummaryRecordResult,
|
|
50
51
|
type SummaryRecordSkipReason,
|
|
51
52
|
} from "./handlers/summary-record.ts";
|
|
53
|
+
export {
|
|
54
|
+
CompassCommentSafetyError,
|
|
55
|
+
HEADER_SCAN_LINES,
|
|
56
|
+
commentStyleCandidates,
|
|
57
|
+
commentStyleFor,
|
|
58
|
+
enclosingCommentStyle,
|
|
59
|
+
getLineCommentPrefix,
|
|
60
|
+
findCompassTerminator,
|
|
61
|
+
findCompassTerminatorInHeader,
|
|
62
|
+
assertCompassCommentSafe,
|
|
63
|
+
neutralizeCompassText,
|
|
64
|
+
type CommentStyle,
|
|
65
|
+
type CompassTerminatorHit,
|
|
66
|
+
} from "./comment-safety.ts";
|
package/os/compass/policy.ts
CHANGED
|
@@ -44,6 +44,13 @@ export interface CompassPolicySource {
|
|
|
44
44
|
export interface CompassPolicy {
|
|
45
45
|
fileExtensions: ReadonlySet<string>;
|
|
46
46
|
testPatterns: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* RFC-1311: test-path globs that opt OUT of the test-file authoring
|
|
49
|
+
* exclusion — matched test files are authored and carry the standard
|
|
50
|
+
* MODULE_CONTRACT scaffolding. `testPatterns` itself still controls test
|
|
51
|
+
* classification; this list only narrows the exclusion.
|
|
52
|
+
*/
|
|
53
|
+
scaffoldTestPatterns: readonly string[];
|
|
47
54
|
scanRoots: readonly string[];
|
|
48
55
|
ignoredDirs: ReadonlySet<string>;
|
|
49
56
|
ignoredDirPrefixes: readonly string[];
|
|
@@ -68,6 +75,8 @@ export interface CompassPolicy {
|
|
|
68
75
|
isHighRisk(pathFromRoot: string): boolean;
|
|
69
76
|
/** Whether a workspace-relative path is a test file. */
|
|
70
77
|
isTestPath(workspaceRelativePath: string): boolean;
|
|
78
|
+
/** Whether a workspace-relative path is a scaffold-required test file (RFC-1311). */
|
|
79
|
+
isScaffoldedTestPath(workspaceRelativePath: string): boolean;
|
|
71
80
|
/** Exclusion reason for a workspace-relative path, if any. */
|
|
72
81
|
excludedReason(workspaceRelativePath: string): string | undefined;
|
|
73
82
|
}
|
|
@@ -125,6 +134,10 @@ const GENERIC_TEST_PATTERNS = [
|
|
|
125
134
|
"**/*.spec.js",
|
|
126
135
|
];
|
|
127
136
|
|
|
137
|
+
// RFC-1311: no generic scaffolded-test patterns — whether test files carry
|
|
138
|
+
// Compass headers is a consumer decision declared in bindings.compass.
|
|
139
|
+
const GENERIC_SCAFFOLD_TEST_PATTERNS: string[] = [];
|
|
140
|
+
|
|
128
141
|
const GENERIC_ID_PATTERN = "\\b([A-Z][A-Z0-9]*-)+\\d+\\b";
|
|
129
142
|
|
|
130
143
|
const GENERIC_PURPOSE_BOILERPLATE = [
|
|
@@ -162,8 +175,8 @@ const GENERIC_WORKSPACE_KINDS: Record<string, CompassWorkspaceKind> = {
|
|
|
162
175
|
|
|
163
176
|
// ---------------------------------------------------------------------------
|
|
164
177
|
// Merge semantics (RFC-1096): union keys merge with `!entry` subtraction
|
|
165
|
-
// (fileExtensions, testPatterns,
|
|
166
|
-
// excludedPaths — matched by `pattern`); scanRoots, idPattern,
|
|
178
|
+
// (fileExtensions, testPatterns, scaffoldTestPatterns, ignoredDirs,
|
|
179
|
+
// ignoredDirPrefixes, highRiskPaths, excludedPaths — matched by `pattern`); scanRoots, idPattern,
|
|
167
180
|
// purposeBoilerplatePatterns, layerRules, and workspaceKinds replace wholesale
|
|
168
181
|
// (bindings > profile > generic).
|
|
169
182
|
// ---------------------------------------------------------------------------
|
|
@@ -259,6 +272,11 @@ export function resolveCompassPolicy(workspaceRoot: string, forgeRoot?: string):
|
|
|
259
272
|
profileCompass?.testPatterns,
|
|
260
273
|
bindingsCompass?.testPatterns,
|
|
261
274
|
);
|
|
275
|
+
const scaffoldTestPatterns = mergeStringList(
|
|
276
|
+
GENERIC_SCAFFOLD_TEST_PATTERNS,
|
|
277
|
+
profileCompass?.scaffoldTestPatterns,
|
|
278
|
+
bindingsCompass?.scaffoldTestPatterns,
|
|
279
|
+
);
|
|
262
280
|
const ignoredDirs = mergeStringList(
|
|
263
281
|
GENERIC_IGNORED_DIRS,
|
|
264
282
|
profileCompass?.ignoredDirs,
|
|
@@ -312,6 +330,9 @@ export function resolveCompassPolicy(workspaceRoot: string, forgeRoot?: string):
|
|
|
312
330
|
}));
|
|
313
331
|
const highRiskMatchers = highRiskPaths.map((pattern) => picomatch(pattern, { dot: true }));
|
|
314
332
|
const testMatchers = testPatterns.map((pattern) => picomatch(pattern, { dot: true }));
|
|
333
|
+
const scaffoldTestMatchers = scaffoldTestPatterns.map((pattern) =>
|
|
334
|
+
picomatch(pattern, { dot: true }),
|
|
335
|
+
);
|
|
315
336
|
const excludedMatchers = excludedPaths.map((entry) => ({
|
|
316
337
|
reason: entry.reason,
|
|
317
338
|
is: picomatch(entry.pattern, { dot: true }),
|
|
@@ -322,6 +343,7 @@ export function resolveCompassPolicy(workspaceRoot: string, forgeRoot?: string):
|
|
|
322
343
|
return Object.freeze({
|
|
323
344
|
fileExtensions: new Set(fileExtensions),
|
|
324
345
|
testPatterns,
|
|
346
|
+
scaffoldTestPatterns,
|
|
325
347
|
scanRoots,
|
|
326
348
|
ignoredDirs: new Set(ignoredDirs),
|
|
327
349
|
ignoredDirPrefixes,
|
|
@@ -346,6 +368,9 @@ export function resolveCompassPolicy(workspaceRoot: string, forgeRoot?: string):
|
|
|
346
368
|
isTestPath(workspaceRelativePath: string): boolean {
|
|
347
369
|
return testMatchers.some((is) => is(workspaceRelativePath));
|
|
348
370
|
},
|
|
371
|
+
isScaffoldedTestPath(workspaceRelativePath: string): boolean {
|
|
372
|
+
return scaffoldTestMatchers.some((is) => is(workspaceRelativePath));
|
|
373
|
+
},
|
|
349
374
|
excludedReason(workspaceRelativePath: string): string | undefined {
|
|
350
375
|
for (const { reason, is } of excludedMatchers) {
|
|
351
376
|
if (is(workspaceRelativePath)) return reason;
|
package/os/core/core.module.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<item>RFC-1248: VITE-CLIENT-DEP-02 lazy-import gate + SCAN-02 validator reads-root existence check (RFC-1248)</item>
|
|
11
11
|
<item>RFC-1251: step 3 — diagnostic.rule-id.validate gate + RULEID-CANONICAL-01, pipeline-wired</item>
|
|
12
12
|
<item>RFC-1254: forge.package.health lint-surface probe (PKG-HEALTH-06) + --compass-docs generates marked conditional for OWN-DUP-01 parity</item>
|
|
13
|
-
<item>forge.doctor next-steps are severity-aware — warn-only runs emit an optional "review the warnings" step instead of a required "fix the violations" one.</item>
|
|
13
|
+
<item>RFC-1255: forge.doctor next-steps are severity-aware — warn-only runs emit an optional "review the warnings" step instead of a required "fix the violations" one.</item>
|
|
14
14
|
<history>ADR-0021, RFC-0374, RFC-0521, RFC-0539, RFC-0542, RFC-0543, RFC-0544, RFC-0546, RFC-0640, RFC-0662, RFC-0674, RFC-0678, RFC-0679, RFC-0680, RFC-0711, RFC-0733, RFC-0877, RFC-0940, RFC-1080, RFC-1088, RFC-1089, RFC-1097, RFC-1173, RFC-1230, RFC-1231</history>
|
|
15
15
|
</CHANGE_SUMMARY>
|
|
16
16
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for invariant engine covering invariant-engine. It also guards the documented public contract and regression-sensitive edge cases.
|
|
5
|
+
</purpose>
|
|
4
6
|
<non-goals>
|
|
5
7
|
<item>Do not test domain-specific invariant logic — all rules are profile-driven.</item>
|
|
6
8
|
</non-goals>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for note frontmatter validate covering note.frontmatter.validate. It also guards the documented public contract and regression-sensitive edge cases.
|
|
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>
|
|
4
9
|
</MODULE_CONTRACT>
|
|
5
10
|
<CHANGE_SUMMARY>
|
|
6
11
|
<item>RFC-0808: initial note.frontmatter.validate tests.</item>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for note link validate covering note.link.validate. It also guards the documented public contract and regression-sensitive edge cases.
|
|
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>
|
|
4
9
|
</MODULE_CONTRACT>
|
|
5
10
|
<CHANGE_SUMMARY>
|
|
6
11
|
<item>RFC-0808: initial note.link.validate tests.</item>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for note orphan detect covering note.orphan.detect. It also guards the documented public contract and regression-sensitive edge cases.
|
|
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>
|
|
4
9
|
</MODULE_CONTRACT>
|
|
5
10
|
<CHANGE_SUMMARY>
|
|
6
11
|
<item>RFC-0808: initial note.orphan.detect tests.</item>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
3
|
<purpose>Unit tests for forge.package.health validator — engines, CI workflow, extract config, devDeps completeness.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
|
|
6
|
+
</non-goals>
|
|
4
7
|
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1311: Compass header sweep — declares the package suite's contract for test-file scaffold coverage.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
5
11
|
*/
|
|
6
12
|
|
|
7
13
|
import { test, expect, beforeEach, afterEach } from "vitest";
|
|
@@ -8,15 +8,10 @@
|
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
10
|
<item>PKG-HEALTH-05: reject any versionBump in extract.config.yaml — version in package.json is source of truth.</item>
|
|
11
|
-
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
12
|
-
|
|
13
|
-
Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
|
|
14
|
-
<item>RFC-1097: sweep — werkstatt-engine clean
|
|
15
|
-
|
|
16
|
-
Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
|
|
17
11
|
<item>RFC-1254: PKG-HEALTH-06 lint-surface probe — extractable packages run `pnpm --dir <projectDir> run lint` (eslint fallback), per-package pass/fail, error-severity violation</item>
|
|
18
12
|
<item>RFC-1254: retune PKG-HEALTH-02 — repo-extract generates ci.yml from the config `ci:` provider block, so the check now flags only extractable packages whose exported repo would ship no CI (no ci: provider AND no in-package workflow)</item>
|
|
19
13
|
<item>RFC-1255: PKG-HEALTH-07 generated-CI script contract (build/lint/typecheck/test), PKG-HEALTH-08 repository.url vs git.remote for provenance publish, PKG-HEALTH-09 files[] src-reachability coverage; "extractable": false opt-out suppresses all extract-dependent checks</item>
|
|
14
|
+
<history>RFC-1097</history>
|
|
20
15
|
</CHANGE_SUMMARY>
|
|
21
16
|
*/
|
|
22
17
|
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for archive covering mission.archive. It also guards the documented public contract and regression-sensitive edge cases.
|
|
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 archive suite's contract for test-file scaffold coverage.</item>
|
|
12
|
+
</CHANGE_SUMMARY>
|
|
13
|
+
*/
|
|
14
|
+
|
|
1
15
|
import { test, expect, describe, beforeEach, afterEach, vi } from "vitest";
|
|
2
16
|
import fs from "node:fs/promises";
|
|
3
17
|
import { existsSync } from "node:fs";
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Unit tests for naming convention covering runNamingConventionLint. It also guards the documented public contract and regression-sensitive edge cases.
|
|
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 naming suite's contract for test-file scaffold coverage.</item>
|
|
12
|
+
</CHANGE_SUMMARY>
|
|
13
|
+
*/
|
|
14
|
+
|
|
1
15
|
import { test, expect, describe } from "vitest";
|
|
2
16
|
import { runNamingConventionLint } from "./naming-convention.ts";
|
|
3
17
|
import { mkdtemp, rm, mkdir, writeFile } from "node:fs/promises";
|