@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,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1333: RFC-IMP-12 tests — HIGH-tier stamps need a committed passing, subagent-isolated acceptance report bound to the current code.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not read git — reports and candidate binding are supplied directly.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1333: tests for AC-5 and AC-6.</item>
|
|
10
|
+
<item>RFC-1333: steps 1-3 — report contract, rfc.verify.workspace export, RFC-IMP-12 gate, RFC-IMP-11 blocking</item>
|
|
11
|
+
</CHANGE_SUMMARY>
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, it } from "vitest";
|
|
15
|
+
import { evaluateAcceptanceVerificationGate } from "./implement-stamp-origin.ts";
|
|
16
|
+
|
|
17
|
+
const fm = { createdAt: "2026-10-18", verificationTier: "high" };
|
|
18
|
+
const report = (extra: Record<string, unknown>) => ({
|
|
19
|
+
path: "docs/reviews/acceptance/rfc-9001/acceptance-2026-10-18-r0.md",
|
|
20
|
+
frontmatter: {
|
|
21
|
+
rfcId: "RFC-9001",
|
|
22
|
+
candidateSha: "abc1234",
|
|
23
|
+
round: 0,
|
|
24
|
+
verdict: "pass",
|
|
25
|
+
isolation: "subagent",
|
|
26
|
+
...extra,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe("RFC-IMP-12 (RFC-1333)", () => {
|
|
31
|
+
it("blocks RFC-IMP-12 when a high-tier RFC has no pass report bound to the implementation commit", async () => {
|
|
32
|
+
const none = await evaluateAcceptanceVerificationGate({
|
|
33
|
+
targetId: "RFC-9001",
|
|
34
|
+
frontmatter: fm,
|
|
35
|
+
reports: [],
|
|
36
|
+
isCandidateBound: async () => true,
|
|
37
|
+
});
|
|
38
|
+
expect(none.errors.map((e) => e.rule)).toEqual(["RFC-IMP-12"]);
|
|
39
|
+
const unbound = await evaluateAcceptanceVerificationGate({
|
|
40
|
+
targetId: "RFC-9001",
|
|
41
|
+
frontmatter: fm,
|
|
42
|
+
reports: [report({})],
|
|
43
|
+
isCandidateBound: async () => false,
|
|
44
|
+
});
|
|
45
|
+
expect(unbound.errors.map((e) => e.rule)).toEqual(["RFC-IMP-12"]);
|
|
46
|
+
const ok = await evaluateAcceptanceVerificationGate({
|
|
47
|
+
targetId: "RFC-9001",
|
|
48
|
+
frontmatter: fm,
|
|
49
|
+
reports: [report({})],
|
|
50
|
+
isCandidateBound: async () => true,
|
|
51
|
+
});
|
|
52
|
+
expect(ok.errors).toEqual([]);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("blocks RFC-IMP-12 when the bound report records non-subagent isolation without a waiver", async () => {
|
|
56
|
+
const input = {
|
|
57
|
+
targetId: "RFC-9001",
|
|
58
|
+
frontmatter: fm,
|
|
59
|
+
reports: [report({ isolation: "isolated-inline" })],
|
|
60
|
+
isCandidateBound: async () => true,
|
|
61
|
+
};
|
|
62
|
+
const blocked = await evaluateAcceptanceVerificationGate(input);
|
|
63
|
+
expect(blocked.errors.map((e) => e.rule)).toEqual(["RFC-IMP-12"]);
|
|
64
|
+
const waived = await evaluateAcceptanceVerificationGate({
|
|
65
|
+
...input,
|
|
66
|
+
waiverReason: "operator: no subagent on this platform",
|
|
67
|
+
});
|
|
68
|
+
expect(waived.errors).toEqual([]);
|
|
69
|
+
expect(waived.warnings[0]?.message).toContain("Waived by operator");
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("ignores standard-tier and pre-cutoff RFCs", async () => {
|
|
73
|
+
const std = await evaluateAcceptanceVerificationGate({
|
|
74
|
+
targetId: "RFC-9001",
|
|
75
|
+
frontmatter: { createdAt: "2026-10-18" },
|
|
76
|
+
reports: [],
|
|
77
|
+
isCandidateBound: async () => true,
|
|
78
|
+
});
|
|
79
|
+
expect(std.errors).toEqual([]);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1333: candidate-binding and report-parsing tests for RFC-IMP-12 over a temporary git repository.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not run the full stamp — the gate evaluator is covered elsewhere.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1333: merge-commit binding and CRLF report regression tests (REVIEW-CODE-2026-10-18-04).</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { execFileSync } from "node:child_process";
|
|
14
|
+
import * as fs from "node:fs/promises";
|
|
15
|
+
import * as os from "node:os";
|
|
16
|
+
import * as path from "node:path";
|
|
17
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
18
|
+
import { candidateBoundToHead, readAcceptanceReports } from "./implement-stamp.ts";
|
|
19
|
+
|
|
20
|
+
let root: string;
|
|
21
|
+
const git = (...a: string[]) =>
|
|
22
|
+
execFileSync(
|
|
23
|
+
"git",
|
|
24
|
+
["-c", "core.hooksPath=/dev/null", "-c", "user.email=t@t", "-c", "user.name=T", ...a],
|
|
25
|
+
{
|
|
26
|
+
cwd: root,
|
|
27
|
+
encoding: "utf8",
|
|
28
|
+
},
|
|
29
|
+
).trim();
|
|
30
|
+
async function put(rel: string, body: string): Promise<void> {
|
|
31
|
+
await fs.mkdir(path.dirname(path.join(root, rel)), { recursive: true });
|
|
32
|
+
await fs.writeFile(path.join(root, rel), body);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
beforeEach(async () => {
|
|
36
|
+
root = await fs.mkdtemp(path.join(os.tmpdir(), "imp12-bind-"));
|
|
37
|
+
git("init", "-q", "-b", "main");
|
|
38
|
+
await put("src/a.ts", "a\n");
|
|
39
|
+
git("add", "-A");
|
|
40
|
+
git("commit", "-qm", "init");
|
|
41
|
+
});
|
|
42
|
+
afterEach(async () => {
|
|
43
|
+
await fs.rm(root, { recursive: true, force: true });
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe("RFC-IMP-12 binding (RFC-1333)", () => {
|
|
47
|
+
it("unbinds when a merge brings code after the candidate", async () => {
|
|
48
|
+
const candidate = git("rev-parse", "HEAD");
|
|
49
|
+
git("checkout", "-qb", "side");
|
|
50
|
+
await put("src/evil.ts", "x\n");
|
|
51
|
+
git("add", "-A");
|
|
52
|
+
git("commit", "-qm", "side change");
|
|
53
|
+
git("checkout", "-q", "main");
|
|
54
|
+
await put("docs/note.md", "n\n");
|
|
55
|
+
git("add", "-A");
|
|
56
|
+
git("commit", "-qm", "docs");
|
|
57
|
+
git("merge", "-q", "--no-ff", "side", "-m", "merge side");
|
|
58
|
+
expect(await candidateBoundToHead(root, candidate)).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("stays bound across docs-only commits", async () => {
|
|
62
|
+
const candidate = git("rev-parse", "HEAD");
|
|
63
|
+
await put("docs/note.md", "n\n");
|
|
64
|
+
git("add", "-A");
|
|
65
|
+
git("commit", "-qm", "docs");
|
|
66
|
+
expect(await candidateBoundToHead(root, candidate)).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("parses CRLF report frontmatter", async () => {
|
|
70
|
+
await put(
|
|
71
|
+
"docs/reviews/acceptance/rfc-9003/acceptance-2026-10-18-r0.md",
|
|
72
|
+
"---\r\nrfcId: RFC-9003\r\nverdict: pass\r\nisolation: subagent\r\ncandidateSha: abc\r\n---\r\n\r\nok\r\n",
|
|
73
|
+
);
|
|
74
|
+
git("add", "-A");
|
|
75
|
+
git("commit", "-qm", "report");
|
|
76
|
+
const reports = await readAcceptanceReports(root, "RFC-9003");
|
|
77
|
+
expect(reports[0]?.frontmatter["verdict"]).toBe("pass");
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1330: implement-stamp-origin tests — RFC-IMP-10 blocks contradicted expectationSource declarations; RFC-IMP-11 reports HIGH-tier WHEN/IF criteria without non-self evidence.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not exercise git — origins are supplied directly; derivation is covered by verification-origin.test.ts.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1330: RFC-IMP-10/11 gate tests.</item>
|
|
10
|
+
<item>RFC-1333: steps 1-3 — report contract, rfc.verify.workspace export, RFC-IMP-12 gate, RFC-IMP-11 blocking</item>
|
|
11
|
+
</CHANGE_SUMMARY>
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, it } from "vitest";
|
|
15
|
+
import { evaluateOriginGates, RFC_IMP_11_BLOCKING } from "./implement-stamp-origin.ts";
|
|
16
|
+
import type { AcceptanceProbe, ProbeOriginRecord } from "../types.ts";
|
|
17
|
+
|
|
18
|
+
const BODY = `
|
|
19
|
+
## Acceptance criteria
|
|
20
|
+
|
|
21
|
+
- [ ] AC-1: WHEN the gate sees a weakened test, THE commit SHALL be blocked.
|
|
22
|
+
- [ ] AC-2: THE module SHALL export the evaluator.
|
|
23
|
+
|
|
24
|
+
## Implementation notes for agents
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
const probe: AcceptanceProbe = {
|
|
28
|
+
probe: "test",
|
|
29
|
+
criterion: "AC-1",
|
|
30
|
+
file: "src/gate.test.ts",
|
|
31
|
+
expect: { exitCode: 0 },
|
|
32
|
+
expectationSource: "requirement",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const selfOrigin: ProbeOriginRecord = {
|
|
36
|
+
declared: "requirement",
|
|
37
|
+
derivedOrigin: "self",
|
|
38
|
+
effective: "self",
|
|
39
|
+
reason: ["abc1234 touched src/gate.test.ts"],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const fm = (extra: Record<string, unknown> = {}) => ({ createdAt: "2026-10-18", ...extra });
|
|
43
|
+
|
|
44
|
+
describe("evaluateOriginGates (RFC-1330)", () => {
|
|
45
|
+
it("blocks RFC-IMP-10 when a declared non-self origin is derived self", () => {
|
|
46
|
+
const result = evaluateOriginGates({
|
|
47
|
+
targetId: "RFC-9001",
|
|
48
|
+
frontmatter: fm(),
|
|
49
|
+
body: BODY,
|
|
50
|
+
probes: [probe],
|
|
51
|
+
origins: [selfOrigin],
|
|
52
|
+
});
|
|
53
|
+
expect(result.errors.map((e) => e.rule)).toEqual(["RFC-IMP-10"]);
|
|
54
|
+
expect(result.errors[0]?.message).toContain("abc1234");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("does not fire RFC-IMP-10 for an honest self declaration or an unresolved range", () => {
|
|
58
|
+
const honest = evaluateOriginGates({
|
|
59
|
+
targetId: "RFC-9001",
|
|
60
|
+
frontmatter: fm(),
|
|
61
|
+
body: BODY,
|
|
62
|
+
probes: [{ ...probe, expectationSource: "self" }],
|
|
63
|
+
origins: [{ ...selfOrigin, declared: "self" }],
|
|
64
|
+
});
|
|
65
|
+
const unresolved = evaluateOriginGates({
|
|
66
|
+
targetId: "RFC-9001",
|
|
67
|
+
frontmatter: fm(),
|
|
68
|
+
body: BODY,
|
|
69
|
+
probes: [probe],
|
|
70
|
+
origins: [{ ...selfOrigin, derivedOrigin: "unresolved" }],
|
|
71
|
+
});
|
|
72
|
+
expect(honest.errors).toEqual([]);
|
|
73
|
+
expect(unresolved.errors).toEqual([]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("blocks RFC-IMP-11 when a high-tier behavioral criterion has no non-self probe", () => {
|
|
77
|
+
const result = evaluateOriginGates({
|
|
78
|
+
targetId: "RFC-9001",
|
|
79
|
+
frontmatter: fm({ verificationTier: "high" }),
|
|
80
|
+
body: BODY,
|
|
81
|
+
probes: [{ ...probe, expectationSource: "self" }],
|
|
82
|
+
origins: [{ ...selfOrigin, declared: "self" }],
|
|
83
|
+
imp11Blocking: true,
|
|
84
|
+
});
|
|
85
|
+
expect(result.errors.map((e) => e.rule)).toEqual(["RFC-IMP-11"]);
|
|
86
|
+
expect(result.errors[0]?.message).toContain("AC-1");
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("treats RFC-IMP-11 as blocking", () => {
|
|
90
|
+
expect(RFC_IMP_11_BLOCKING).toBe(true);
|
|
91
|
+
const result = evaluateOriginGates({
|
|
92
|
+
targetId: "RFC-9001",
|
|
93
|
+
frontmatter: fm({ verificationTier: "high" }),
|
|
94
|
+
body: BODY,
|
|
95
|
+
probes: [{ ...probe, expectationSource: "self" }],
|
|
96
|
+
origins: [{ ...selfOrigin, declared: "self" }],
|
|
97
|
+
});
|
|
98
|
+
expect(result.errors.map((e) => e.rule)).toEqual(["RFC-IMP-11"]);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("accepts a high-tier criterion backed by verifier evidence", () => {
|
|
102
|
+
const result = evaluateOriginGates({
|
|
103
|
+
targetId: "RFC-9001",
|
|
104
|
+
frontmatter: fm({ verificationTier: "high" }),
|
|
105
|
+
body: BODY,
|
|
106
|
+
probes: [probe],
|
|
107
|
+
origins: [
|
|
108
|
+
{
|
|
109
|
+
declared: "independent",
|
|
110
|
+
derivedOrigin: "verifier",
|
|
111
|
+
effective: "independent",
|
|
112
|
+
reason: [],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
imp11Blocking: true,
|
|
116
|
+
});
|
|
117
|
+
expect(result.errors).toEqual([]);
|
|
118
|
+
expect(result.warnings).toEqual([]);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("skips RFCs created before the cutoff", () => {
|
|
122
|
+
const result = evaluateOriginGates({
|
|
123
|
+
targetId: "RFC-9001",
|
|
124
|
+
frontmatter: { createdAt: "2026-10-01", verificationTier: "high" },
|
|
125
|
+
body: BODY,
|
|
126
|
+
probes: [probe],
|
|
127
|
+
origins: [selfOrigin],
|
|
128
|
+
imp11Blocking: true,
|
|
129
|
+
});
|
|
130
|
+
expect(result.errors).toEqual([]);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1330: stamp-time origin gates for rfc.implement.stamp — RFC-IMP-10 blocks
|
|
5
|
+
a declared expectationSource that git-derived origin contradicts, RFC-IMP-11
|
|
6
|
+
requires non-self evidence for every WHEN/IF criterion of a
|
|
7
|
+
verificationTier: high RFC.
|
|
8
|
+
</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>Do not derive origins — verification-origin.ts owns derivation.</item>
|
|
11
|
+
<item>Do not mutate the RFC or rewrite declarations — the RFC text must be corrected by its author.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<KEY_DECISIONS>
|
|
15
|
+
<item>Origins are derived fresh at stamp time (head = HEAD), never read from the committed envelope.</item>
|
|
16
|
+
<item>`unresolved` never fires RFC-IMP-10 — no contradiction is proven without history.</item>
|
|
17
|
+
<item>RFC-IMP-11 severity is a module constant until RFC-1333 provides non-self evidence.</item>
|
|
18
|
+
</KEY_DECISIONS>
|
|
19
|
+
<CHANGE_SUMMARY>
|
|
20
|
+
<item>RFC-1330: RFC-IMP-10 (blocking) and RFC-IMP-11 (warning until RFC-1333) origin gates.</item>
|
|
21
|
+
<item>RFC-1333: steps 1-3 — report contract, rfc.verify.workspace export, RFC-IMP-12 gate, RFC-IMP-11 blocking</item>
|
|
22
|
+
<item>RFC-1333: CX-1/CX-2 fixes — docs/** binding, waiver covers a missing report, IMP-12 for probe-less RFCs; merge-aware fail-closed binding.</item>
|
|
23
|
+
</CHANGE_SUMMARY>
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { RFC_ORIGIN_CUTOFF } from "../types.ts";
|
|
27
|
+
import type { AcceptanceProbe, ProbeOriginRecord, RfcImplementStampViolation } from "../types.ts";
|
|
28
|
+
import { listBehavioralCriteria } from "./validate-rules.ts";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* RFC-IMP-11 is blocking since RFC-1333: post-commitment independent
|
|
32
|
+
* verification gives HIGH-tier RFCs a source of non-self evidence.
|
|
33
|
+
*/
|
|
34
|
+
export const RFC_IMP_11_BLOCKING = true;
|
|
35
|
+
|
|
36
|
+
const NON_SELF = new Set(["requirement", "independent", "external"]);
|
|
37
|
+
|
|
38
|
+
export interface OriginGateInput {
|
|
39
|
+
targetId: string;
|
|
40
|
+
frontmatter: Record<string, unknown>;
|
|
41
|
+
body: string;
|
|
42
|
+
probes: AcceptanceProbe[];
|
|
43
|
+
origins: ProbeOriginRecord[];
|
|
44
|
+
/** Overrides RFC_IMP_11_BLOCKING (tests, RFC-1333 flip). */
|
|
45
|
+
imp11Blocking?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface OriginGateResult {
|
|
49
|
+
errors: RfcImplementStampViolation[];
|
|
50
|
+
warnings: RfcImplementStampViolation[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function describeProbe(probe: AcceptanceProbe, index: number): string {
|
|
54
|
+
const target =
|
|
55
|
+
probe.probe === "test" ? probe.file : probe.probe === "run" ? probe.command : probe.probe;
|
|
56
|
+
return `probe ${index} (${probe.probe}${probe.criterion ? ` → ${probe.criterion}` : ""}: ${target})`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Evaluate RFC-IMP-10 / RFC-IMP-11 for a post-cutoff RFC. Pure function. */
|
|
60
|
+
export function evaluateOriginGates(input: OriginGateInput): OriginGateResult {
|
|
61
|
+
const errors: RfcImplementStampViolation[] = [];
|
|
62
|
+
const warnings: RfcImplementStampViolation[] = [];
|
|
63
|
+
if (String(input.frontmatter["createdAt"] ?? "") < RFC_ORIGIN_CUTOFF) return { errors, warnings };
|
|
64
|
+
|
|
65
|
+
input.probes.forEach((probe, i) => {
|
|
66
|
+
const origin = input.origins[i];
|
|
67
|
+
if (!origin) return;
|
|
68
|
+
if (origin.derivedOrigin === "self" && NON_SELF.has(String(origin.declared))) {
|
|
69
|
+
errors.push({
|
|
70
|
+
rule: "RFC-IMP-10",
|
|
71
|
+
message:
|
|
72
|
+
`${input.targetId} ${describeProbe(probe, i)} declares expectationSource "${origin.declared}" but git derives it self ` +
|
|
73
|
+
`(${origin.reason.join("; ")}). Correct the declaration to "self", or obtain non-self evidence — never rewrite history.`,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (input.frontmatter["verificationTier"] === "high") {
|
|
79
|
+
const blocking = input.imp11Blocking ?? RFC_IMP_11_BLOCKING;
|
|
80
|
+
for (const id of listBehavioralCriteria(input.body)) {
|
|
81
|
+
const hasNonSelf = input.probes.some(
|
|
82
|
+
(p, i) => p.criterion === id && NON_SELF.has(String(input.origins[i]?.effective)),
|
|
83
|
+
);
|
|
84
|
+
if (hasNonSelf) continue;
|
|
85
|
+
const violation: RfcImplementStampViolation = {
|
|
86
|
+
rule: "RFC-IMP-11",
|
|
87
|
+
message: `${input.targetId} is verificationTier: high but ${id} (WHEN/IF) has no bound probe with a non-self effective origin. Obtain independent evidence (post-commitment verification) for ${id}.`,
|
|
88
|
+
};
|
|
89
|
+
(blocking ? errors : warnings).push(violation);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return { errors, warnings };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ─── RFC-1333: RFC-IMP-12 acceptance-verification report gate ────────────────
|
|
96
|
+
|
|
97
|
+
export const ACCEPTANCE_REPORTS_DIR = "docs/reviews/acceptance";
|
|
98
|
+
|
|
99
|
+
export interface AcceptanceGateInput {
|
|
100
|
+
targetId: string;
|
|
101
|
+
frontmatter: Record<string, unknown>;
|
|
102
|
+
/** Report frontmatters found under docs/reviews/acceptance/<id>/ (committed). */
|
|
103
|
+
reports: Array<{ path: string; frontmatter: Record<string, unknown> }>;
|
|
104
|
+
/** True when every non-docs commit in candidate..HEAD carries the verifier trailers. */
|
|
105
|
+
isCandidateBound: (candidateSha: string) => Promise<boolean>;
|
|
106
|
+
waiverReason?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Evaluate RFC-IMP-12 for a post-cutoff verificationTier: high RFC. */
|
|
110
|
+
export async function evaluateAcceptanceVerificationGate(
|
|
111
|
+
input: AcceptanceGateInput,
|
|
112
|
+
): Promise<OriginGateResult> {
|
|
113
|
+
const errors: RfcImplementStampViolation[] = [];
|
|
114
|
+
const warnings: RfcImplementStampViolation[] = [];
|
|
115
|
+
const fm = input.frontmatter;
|
|
116
|
+
if (String(fm["createdAt"] ?? "") < RFC_ORIGIN_CUTOFF || fm["verificationTier"] !== "high") {
|
|
117
|
+
return { errors, warnings };
|
|
118
|
+
}
|
|
119
|
+
const passing = input.reports.filter((r) => r.frontmatter["verdict"] === "pass");
|
|
120
|
+
const bound: typeof passing = [];
|
|
121
|
+
for (const r of passing) {
|
|
122
|
+
const sha = String(r.frontmatter["candidateSha"] ?? "");
|
|
123
|
+
if (sha && (await input.isCandidateBound(sha))) bound.push(r);
|
|
124
|
+
}
|
|
125
|
+
if (bound.length === 0) {
|
|
126
|
+
if (input.waiverReason) {
|
|
127
|
+
warnings.push({
|
|
128
|
+
rule: "RFC-IMP-12",
|
|
129
|
+
message: `${input.targetId} has no bound passing acceptance report. Waived by operator: ${input.waiverReason}`,
|
|
130
|
+
});
|
|
131
|
+
return { errors, warnings };
|
|
132
|
+
}
|
|
133
|
+
errors.push({
|
|
134
|
+
rule: "RFC-IMP-12",
|
|
135
|
+
message: `${input.targetId} is verificationTier: high but has no committed verdict: pass acceptance report in ${ACCEPTANCE_REPORTS_DIR}/${input.targetId.toLowerCase()}/ bound to the current code (only verifier-trailer or docs commits may follow the candidate). Run the independent acceptance verification step.`,
|
|
136
|
+
});
|
|
137
|
+
return { errors, warnings };
|
|
138
|
+
}
|
|
139
|
+
if (!bound.some((r) => r.frontmatter["isolation"] === "subagent")) {
|
|
140
|
+
const v: RfcImplementStampViolation = {
|
|
141
|
+
rule: "RFC-IMP-12",
|
|
142
|
+
message: `${input.targetId} acceptance report ${bound[0]!.path} records isolation "${String(bound[0]!.frontmatter["isolation"])}", not subagent.`,
|
|
143
|
+
};
|
|
144
|
+
if (input.waiverReason) {
|
|
145
|
+
warnings.push({ ...v, message: `${v.message} Waived by operator: ${input.waiverReason}` });
|
|
146
|
+
} else {
|
|
147
|
+
errors.push({
|
|
148
|
+
...v,
|
|
149
|
+
message: `${v.message} Re-run with a clean-context subagent, or the operator may waive with --waive-independent-verification "<reason>".`,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return { errors, warnings };
|
|
154
|
+
}
|