@warpgogol/forge 9.6.2 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/CONTRIBUTING.md +19 -25
- package/README.md +14 -2
- package/README.uk.md +2 -2
- package/bin/cli.ts +40 -2
- package/dist/bin/cli.js +39 -2
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +55 -19
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/adr/handlers/validate.d.ts.map +1 -1
- package/dist/os/adr/handlers/validate.js +55 -21
- package/dist/os/adr/handlers/validate.js.map +1 -1
- package/dist/os/adversarial/adversarial.module.d.ts +3 -0
- package/dist/os/adversarial/adversarial.module.d.ts.map +1 -0
- package/dist/os/adversarial/adversarial.module.js +128 -0
- package/dist/os/adversarial/adversarial.module.js.map +1 -0
- package/dist/os/adversarial/catalog.d.ts +11 -0
- package/dist/os/adversarial/catalog.d.ts.map +1 -0
- package/dist/os/adversarial/catalog.js +72 -0
- package/dist/os/adversarial/catalog.js.map +1 -0
- package/dist/os/adversarial/runner.d.ts +17 -0
- package/dist/os/adversarial/runner.d.ts.map +1 -0
- package/dist/os/adversarial/runner.js +479 -0
- package/dist/os/adversarial/runner.js.map +1 -0
- package/dist/os/agent/handlers/agent-tiers-validate.d.ts.map +1 -1
- package/dist/os/agent/handlers/agent-tiers-validate.js +21 -7
- package/dist/os/agent/handlers/agent-tiers-validate.js.map +1 -1
- package/dist/os/agent/index.js +1 -1
- package/dist/os/agent-tools/agent-tools.module.d.ts +3 -0
- package/dist/os/agent-tools/agent-tools.module.d.ts.map +1 -0
- package/dist/os/agent-tools/agent-tools.module.js +80 -0
- package/dist/os/agent-tools/agent-tools.module.js.map +1 -0
- package/dist/os/agent-tools/generate.d.ts +18 -0
- package/dist/os/agent-tools/generate.d.ts.map +1 -0
- package/dist/os/agent-tools/generate.js +79 -0
- package/dist/os/agent-tools/generate.js.map +1 -0
- package/dist/os/agent-tools/handlers/tools-generate.d.ts +16 -0
- package/dist/os/agent-tools/handlers/tools-generate.d.ts.map +1 -0
- package/dist/os/agent-tools/handlers/tools-generate.js +108 -0
- package/dist/os/agent-tools/handlers/tools-generate.js.map +1 -0
- package/dist/os/agent-tools/index.d.ts +7 -0
- package/dist/os/agent-tools/index.d.ts.map +1 -0
- package/dist/os/agent-tools/index.js +16 -0
- package/dist/os/agent-tools/index.js.map +1 -0
- package/dist/os/agent-tools/manifest.d.ts +26 -0
- package/dist/os/agent-tools/manifest.d.ts.map +1 -0
- package/dist/os/agent-tools/manifest.js +70 -0
- package/dist/os/agent-tools/manifest.js.map +1 -0
- package/dist/os/agent-tools/serve.d.ts +21 -0
- package/dist/os/agent-tools/serve.d.ts.map +1 -0
- package/dist/os/agent-tools/serve.js +99 -0
- package/dist/os/agent-tools/serve.js.map +1 -0
- package/dist/os/agent-tools/server.d.ts +53 -0
- package/dist/os/agent-tools/server.d.ts.map +1 -0
- package/dist/os/agent-tools/server.js +381 -0
- package/dist/os/agent-tools/server.js.map +1 -0
- package/dist/os/agent-tools/types.d.ts +72 -0
- package/dist/os/agent-tools/types.d.ts.map +1 -0
- package/dist/os/agent-tools/types.js +74 -0
- package/dist/os/agent-tools/types.js.map +1 -0
- package/dist/os/authority/authority.module.d.ts.map +1 -1
- package/dist/os/authority/authority.module.js +17 -2
- package/dist/os/authority/authority.module.js.map +1 -1
- package/dist/os/checks/checks.module.d.ts.map +1 -1
- package/dist/os/checks/checks.module.js +44 -11
- package/dist/os/checks/checks.module.js.map +1 -1
- package/dist/os/checks/handlers/contribution-report.d.ts +3 -0
- package/dist/os/checks/handlers/contribution-report.d.ts.map +1 -1
- package/dist/os/checks/handlers/contribution-report.js +142 -23
- package/dist/os/checks/handlers/contribution-report.js.map +1 -1
- package/dist/os/checks/handlers/counters-export.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-export.js +75 -8
- package/dist/os/checks/handlers/counters-export.js.map +1 -1
- package/dist/os/checks/handlers/counters-validate.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-validate.js +1 -1
- package/dist/os/checks/handlers/counters-validate.js.map +1 -1
- package/dist/os/codebase/handlers/codebase-measure.d.ts.map +1 -1
- package/dist/os/codebase/handlers/codebase-measure.js +15 -18
- package/dist/os/codebase/handlers/codebase-measure.js.map +1 -1
- package/dist/os/codebase/index.d.ts.map +1 -1
- package/dist/os/codebase/index.js +4 -1
- package/dist/os/codebase/index.js.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.d.ts +4 -2
- package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-audit-handler.js +229 -37
- package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold-handler.js +45 -2
- package/dist/os/compass/handlers/compass-header-scaffold-handler.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 +44 -4
- package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
- package/dist/os/compass/handlers/git-revision.d.ts +31 -5
- package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
- package/dist/os/compass/handlers/git-revision.js +153 -55
- package/dist/os/compass/handlers/git-revision.js.map +1 -1
- package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
- package/dist/os/compass/handlers/summary-record.js +44 -9
- package/dist/os/compass/handlers/summary-record.js.map +1 -1
- package/dist/os/context/context.module.d.ts.map +1 -1
- package/dist/os/context/context.module.js +23 -4
- package/dist/os/context/context.module.js.map +1 -1
- package/dist/os/context/handlers/context-assemble.d.ts.map +1 -1
- package/dist/os/context/handlers/context-assemble.js +109 -16
- package/dist/os/context/handlers/context-assemble.js.map +1 -1
- package/dist/os/context/handlers/context-slate-eval.d.ts.map +1 -1
- package/dist/os/context/handlers/context-slate-eval.js +34 -9
- package/dist/os/context/handlers/context-slate-eval.js.map +1 -1
- package/dist/os/context/handlers/index-build.d.ts.map +1 -1
- package/dist/os/context/handlers/index-build.js +119 -26
- package/dist/os/context/handlers/index-build.js.map +1 -1
- package/dist/os/core/archive-regen.d.ts +55 -4
- package/dist/os/core/archive-regen.d.ts.map +1 -1
- package/dist/os/core/archive-regen.js +144 -11
- package/dist/os/core/archive-regen.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +182 -50
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts +9 -2
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +81 -0
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
- package/dist/os/core/handlers/package-health.js +6 -6
- package/dist/os/core/handlers/policy-digest.d.ts +11 -0
- package/dist/os/core/handlers/policy-digest.d.ts.map +1 -0
- package/dist/os/core/handlers/policy-digest.js +421 -0
- package/dist/os/core/handlers/policy-digest.js.map +1 -0
- package/dist/os/correctness/audit/snapshot.d.ts.map +1 -1
- package/dist/os/correctness/audit/snapshot.js +46 -15
- package/dist/os/correctness/audit/snapshot.js.map +1 -1
- package/dist/os/correctness/correctness.module.d.ts.map +1 -1
- package/dist/os/correctness/correctness.module.js +5 -3
- package/dist/os/correctness/correctness.module.js.map +1 -1
- package/dist/os/correctness/gate/frozen.d.ts +84 -9
- package/dist/os/correctness/gate/frozen.d.ts.map +1 -1
- package/dist/os/correctness/gate/frozen.js +573 -53
- package/dist/os/correctness/gate/frozen.js.map +1 -1
- package/dist/os/correctness/gate/origin.d.ts +2 -0
- package/dist/os/correctness/gate/origin.d.ts.map +1 -1
- package/dist/os/correctness/gate/origin.js +68 -35
- package/dist/os/correctness/gate/origin.js.map +1 -1
- package/dist/os/correctness/gate/repo.d.ts +58 -2
- package/dist/os/correctness/gate/repo.d.ts.map +1 -1
- package/dist/os/correctness/gate/repo.js +177 -15
- package/dist/os/correctness/gate/repo.js.map +1 -1
- package/dist/os/correctness/gate/run.d.ts +6 -0
- package/dist/os/correctness/gate/run.d.ts.map +1 -1
- package/dist/os/correctness/gate/run.js +394 -62
- package/dist/os/correctness/gate/run.js.map +1 -1
- package/dist/os/correctness/gate/runner.d.ts.map +1 -1
- package/dist/os/correctness/gate/runner.js +42 -8
- package/dist/os/correctness/gate/runner.js.map +1 -1
- package/dist/os/correctness/gate/tests/gate-fixture.d.ts +5 -1
- package/dist/os/correctness/gate/tests/gate-fixture.d.ts.map +1 -1
- package/dist/os/correctness/gate/tests/gate-fixture.js +23 -1
- package/dist/os/correctness/gate/tests/gate-fixture.js.map +1 -1
- package/dist/os/correctness/gate/types.d.ts +3 -0
- package/dist/os/correctness/gate/types.d.ts.map +1 -1
- package/dist/os/correctness/gate/types.js +1 -0
- package/dist/os/correctness/gate/types.js.map +1 -1
- package/dist/os/correctness/handlers/gate.d.ts.map +1 -1
- package/dist/os/correctness/handlers/gate.js +2 -0
- package/dist/os/correctness/handlers/gate.js.map +1 -1
- package/dist/os/correctness/handlers/validate.d.ts +30 -0
- package/dist/os/correctness/handlers/validate.d.ts.map +1 -1
- package/dist/os/correctness/handlers/validate.js +20 -7
- package/dist/os/correctness/handlers/validate.js.map +1 -1
- package/dist/os/correctness/manifest-schema.d.ts +2 -2
- package/dist/os/correctness/references.d.ts +19 -0
- package/dist/os/correctness/references.d.ts.map +1 -1
- package/dist/os/correctness/references.js +57 -22
- package/dist/os/correctness/references.js.map +1 -1
- package/dist/os/correctness/workspace.d.ts +22 -2
- package/dist/os/correctness/workspace.d.ts.map +1 -1
- package/dist/os/correctness/workspace.js +194 -18
- package/dist/os/correctness/workspace.js.map +1 -1
- package/dist/os/flow/branch-name.d.ts.map +1 -1
- package/dist/os/flow/branch-name.js +2 -4
- package/dist/os/flow/branch-name.js.map +1 -1
- package/dist/os/flow/correctness-step.d.ts.map +1 -1
- package/dist/os/flow/correctness-step.js +83 -17
- package/dist/os/flow/correctness-step.js.map +1 -1
- package/dist/os/flow/digest.d.ts +27 -10
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +530 -165
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dup-id-scan.d.ts +23 -0
- package/dist/os/flow/dup-id-scan.d.ts.map +1 -0
- package/dist/os/flow/dup-id-scan.js +171 -0
- package/dist/os/flow/dup-id-scan.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +132 -18
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/git.d.ts +77 -11
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +661 -84
- package/dist/os/flow/git.js.map +1 -1
- package/dist/os/flow/guard-files.d.ts.map +1 -1
- package/dist/os/flow/guard-files.js +3 -5
- package/dist/os/flow/guard-files.js.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-backmerge.js +2 -2
- package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +2 -2
- package/dist/os/flow/handlers/flow-cut.d.ts +38 -0
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +325 -186
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-digest.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-digest.js +2 -1
- package/dist/os/flow/handlers/flow-digest.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +6 -6
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +34 -12
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-hold.js +12 -21
- package/dist/os/flow/handlers/flow-hold.js.map +1 -1
- package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-install.js +19 -18
- package/dist/os/flow/handlers/flow-install.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +50 -2
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +624 -135
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts +11 -0
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +82 -12
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/handlers/flow-publication-retire.d.ts +2 -2
- package/dist/os/flow/handlers/flow-publication-retire.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-publication-retire.js +36 -16
- package/dist/os/flow/handlers/flow-publication-retire.js.map +1 -1
- package/dist/os/flow/handlers/flow-push.d.ts +12 -4
- package/dist/os/flow/handlers/flow-push.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-push.js +297 -47
- package/dist/os/flow/handlers/flow-push.js.map +1 -1
- package/dist/os/flow/handlers/flow-status.d.ts +6 -0
- package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-status.js +13 -10
- package/dist/os/flow/handlers/flow-status.js.map +1 -1
- package/dist/os/flow/handlers/flow-swept.d.ts +30 -0
- package/dist/os/flow/handlers/flow-swept.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-swept.js +135 -0
- package/dist/os/flow/handlers/flow-swept.js.map +1 -0
- package/dist/os/flow/handlers/flow-version.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-version.js +3 -5
- package/dist/os/flow/handlers/flow-version.js.map +1 -1
- package/dist/os/flow/index.d.ts +2 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +7 -4
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/line-version.d.ts.map +1 -1
- package/dist/os/flow/line-version.js +20 -3
- package/dist/os/flow/line-version.js.map +1 -1
- package/dist/os/flow/locks.d.ts +7 -0
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +15 -5
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/markers.d.ts +1 -1
- package/dist/os/flow/markers.d.ts.map +1 -1
- package/dist/os/flow/markers.js +14 -5
- package/dist/os/flow/markers.js.map +1 -1
- package/dist/os/flow/ops-registry.d.ts.map +1 -1
- package/dist/os/flow/ops-registry.js +19 -6
- package/dist/os/flow/ops-registry.js.map +1 -1
- package/dist/os/flow/post-rebase-regen.d.ts +30 -8
- package/dist/os/flow/post-rebase-regen.d.ts.map +1 -1
- package/dist/os/flow/post-rebase-regen.js +172 -20
- package/dist/os/flow/post-rebase-regen.js.map +1 -1
- package/dist/os/flow/pre-lock.d.ts +61 -0
- package/dist/os/flow/pre-lock.d.ts.map +1 -0
- package/dist/os/flow/pre-lock.js +265 -0
- package/dist/os/flow/pre-lock.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +6 -0
- package/dist/os/flow/preflight.d.ts.map +1 -1
- package/dist/os/flow/preflight.js +85 -13
- package/dist/os/flow/preflight.js.map +1 -1
- package/dist/os/flow/primary-dirt.d.ts +63 -0
- package/dist/os/flow/primary-dirt.d.ts.map +1 -0
- package/dist/os/flow/primary-dirt.js +259 -0
- package/dist/os/flow/primary-dirt.js.map +1 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +32 -10
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +12 -4
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +15 -8
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/release-level.d.ts +2 -0
- package/dist/os/flow/release-level.d.ts.map +1 -1
- package/dist/os/flow/release-level.js +23 -5
- package/dist/os/flow/release-level.js.map +1 -1
- package/dist/os/flow/release-lines.js +1 -1
- package/dist/os/flow/release-tags.d.ts +1 -1
- package/dist/os/flow/release-tags.d.ts.map +1 -1
- package/dist/os/flow/release-tags.js +43 -19
- package/dist/os/flow/release-tags.js.map +1 -1
- package/dist/os/flow/repo-kind.d.ts.map +1 -1
- package/dist/os/flow/repo-kind.js +6 -3
- package/dist/os/flow/repo-kind.js.map +1 -1
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +40 -7
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/semver.js +1 -1
- package/dist/os/flow/session-checkout.js +3 -3
- package/dist/os/flow/standalone-invoke.js +2 -2
- package/dist/os/flow/tests/helpers.d.ts +28 -1
- package/dist/os/flow/tests/helpers.d.ts.map +1 -1
- package/dist/os/flow/tests/helpers.js +159 -19
- package/dist/os/flow/tests/helpers.js.map +1 -1
- package/dist/os/flow/version-files.d.ts.map +1 -1
- package/dist/os/flow/version-files.js +3 -2
- package/dist/os/flow/version-files.js.map +1 -1
- package/dist/os/flow/worktree-path.d.ts.map +1 -1
- package/dist/os/flow/worktree-path.js +1 -1
- package/dist/os/flow/worktree-path.js.map +1 -1
- package/dist/os/friction/friction.module.d.ts.map +1 -1
- package/dist/os/friction/friction.module.js +134 -30
- package/dist/os/friction/friction.module.js.map +1 -1
- package/dist/os/friction/handlers/friction-add.d.ts +13 -0
- package/dist/os/friction/handlers/friction-add.d.ts.map +1 -0
- package/dist/os/friction/handlers/friction-add.js +196 -0
- package/dist/os/friction/handlers/friction-add.js.map +1 -0
- package/dist/os/friction/handlers/friction-migrate.d.ts +23 -0
- package/dist/os/friction/handlers/friction-migrate.d.ts.map +1 -0
- package/dist/os/friction/handlers/friction-migrate.js +168 -0
- package/dist/os/friction/handlers/friction-migrate.js.map +1 -0
- package/dist/os/friction/handlers/friction-validate.d.ts.map +1 -1
- package/dist/os/friction/handlers/friction-validate.js +144 -106
- package/dist/os/friction/handlers/friction-validate.js.map +1 -1
- package/dist/os/friction/index.d.ts +2 -0
- package/dist/os/friction/index.d.ts.map +1 -1
- package/dist/os/friction/index.js +3 -1
- package/dist/os/friction/index.js.map +1 -1
- package/dist/os/friction/store.d.ts +68 -0
- package/dist/os/friction/store.d.ts.map +1 -0
- package/dist/os/friction/store.js +231 -0
- package/dist/os/friction/store.js.map +1 -0
- package/dist/os/friction/types.d.ts +1 -1
- package/dist/os/friction/types.d.ts.map +1 -1
- package/dist/os/friction/types.js +11 -13
- package/dist/os/friction/types.js.map +1 -1
- package/dist/os/gate/gate.module.d.ts.map +1 -1
- package/dist/os/gate/gate.module.js +47 -6
- package/dist/os/gate/gate.module.js.map +1 -1
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts +17 -2
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts.map +1 -1
- package/dist/os/gate/handlers/gate-probe-catalog.js +343 -44
- package/dist/os/gate/handlers/gate-probe-catalog.js.map +1 -1
- package/dist/os/gate/handlers/gate-probe.d.ts.map +1 -1
- package/dist/os/gate/handlers/gate-probe.js +90 -10
- package/dist/os/gate/handlers/gate-probe.js.map +1 -1
- package/dist/os/gate/handlers/liveness.d.ts +30 -0
- package/dist/os/gate/handlers/liveness.d.ts.map +1 -0
- package/dist/os/gate/handlers/liveness.js +94 -0
- package/dist/os/gate/handlers/liveness.js.map +1 -0
- package/dist/os/gate/handlers/probe-runs-journal.d.ts +44 -0
- package/dist/os/gate/handlers/probe-runs-journal.d.ts.map +1 -0
- package/dist/os/gate/handlers/probe-runs-journal.js +157 -0
- package/dist/os/gate/handlers/probe-runs-journal.js.map +1 -0
- package/dist/os/gate-run/gate-run.module.d.ts.map +1 -1
- package/dist/os/gate-run/gate-run.module.js +3 -0
- package/dist/os/gate-run/gate-run.module.js.map +1 -1
- package/dist/os/gate-run/index.d.ts.map +1 -1
- package/dist/os/gate-run/index.js +10 -0
- package/dist/os/gate-run/index.js.map +1 -1
- package/dist/os/gate-run/record.d.ts +1 -0
- package/dist/os/gate-run/record.d.ts.map +1 -1
- package/dist/os/gate-run/record.js +2 -0
- package/dist/os/gate-run/record.js.map +1 -1
- package/dist/os/gate-run/status.d.ts.map +1 -1
- package/dist/os/gate-run/status.js +4 -1
- package/dist/os/gate-run/status.js.map +1 -1
- package/dist/os/gate-run/types.d.ts +7 -0
- package/dist/os/gate-run/types.d.ts.map +1 -1
- package/dist/os/gate-run/types.js +1 -0
- package/dist/os/gate-run/types.js.map +1 -1
- package/dist/os/instructions/handlers/scar-migrate.d.ts +3 -0
- package/dist/os/instructions/handlers/scar-migrate.d.ts.map +1 -1
- package/dist/os/instructions/handlers/scar-migrate.js +23 -66
- package/dist/os/instructions/handlers/scar-migrate.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +32 -5
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js +31 -10
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-rebuild.js +24 -12
- package/dist/os/knowledge/handlers/knowledge-rebuild.js.map +1 -1
- package/dist/os/knowledge/knowledge.module.d.ts.map +1 -1
- package/dist/os/knowledge/knowledge.module.js +20 -4
- package/dist/os/knowledge/knowledge.module.js.map +1 -1
- package/dist/os/mission/lockfile.d.ts.map +1 -1
- package/dist/os/mission/lockfile.js +44 -20
- package/dist/os/mission/lockfile.js.map +1 -1
- package/dist/os/naming/naming-convention.js +2 -2
- package/dist/os/naming/naming-convention.js.map +1 -1
- package/dist/os/program/discovery.d.ts +14 -5
- package/dist/os/program/discovery.d.ts.map +1 -1
- package/dist/os/program/discovery.js +64 -46
- package/dist/os/program/discovery.js.map +1 -1
- package/dist/os/program/handlers/complete.d.ts.map +1 -1
- package/dist/os/program/handlers/complete.js +28 -10
- package/dist/os/program/handlers/complete.js.map +1 -1
- package/dist/os/program/handlers/lease.js +12 -2
- package/dist/os/program/handlers/lease.js.map +1 -1
- package/dist/os/program/handlers/seal.js +3 -3
- package/dist/os/program/handlers/seal.js.map +1 -1
- package/dist/os/program/handlers/validate.js +3 -3
- package/dist/os/program/handlers/validate.js.map +1 -1
- package/dist/os/queue/handlers/queue-decision.d.ts +10 -0
- package/dist/os/queue/handlers/queue-decision.d.ts.map +1 -0
- package/dist/os/queue/handlers/queue-decision.js +177 -0
- package/dist/os/queue/handlers/queue-decision.js.map +1 -0
- package/dist/os/queue/handlers/queue-validate.d.ts.map +1 -1
- package/dist/os/queue/handlers/queue-validate.js +18 -22
- package/dist/os/queue/handlers/queue-validate.js.map +1 -1
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +1 -2
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/queue/queue.module.d.ts.map +1 -1
- package/dist/os/queue/queue.module.js +89 -4
- package/dist/os/queue/queue.module.js.map +1 -1
- package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
- package/dist/os/rfc/frontmatter-io.js +4 -3
- package/dist/os/rfc/frontmatter-io.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.js +6 -3
- package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +65 -29
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +13 -0
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
- package/dist/os/rfc/handlers/rfc-evidence-sync.js +52 -10
- package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +1 -0
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +172 -50
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +0 -3
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/next-id.d.ts +7 -1
- package/dist/os/rfc/next-id.d.ts.map +1 -1
- package/dist/os/rfc/next-id.js +122 -5
- package/dist/os/rfc/next-id.js.map +1 -1
- package/dist/os/rfc/outcome-probe.d.ts.map +1 -1
- package/dist/os/rfc/outcome-probe.js +5 -2
- package/dist/os/rfc/outcome-probe.js.map +1 -1
- package/dist/os/rfc/reachable-symbol.d.ts.map +1 -1
- package/dist/os/rfc/reachable-symbol.js +61 -19
- package/dist/os/rfc/reachable-symbol.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +26 -4
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +28 -3
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +13 -3
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +72 -24
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +41 -3
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +314 -50
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/rfc/verifier/rfc-1391/support.js +1 -1
- package/dist/os/rfc/verify-workspace.d.ts.map +1 -1
- package/dist/os/rfc/verify-workspace.js +148 -48
- package/dist/os/rfc/verify-workspace.js.map +1 -1
- package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
- package/dist/os/session/handlers/metrics-rfc.js +42 -11
- package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +50 -24
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/session/handlers/session-audit-report.d.ts.map +1 -1
- package/dist/os/session/handlers/session-audit-report.js +21 -6
- package/dist/os/session/handlers/session-audit-report.js.map +1 -1
- package/dist/os/session/handlers/session-audit.d.ts.map +1 -1
- package/dist/os/session/handlers/session-audit.js +22 -9
- package/dist/os/session/handlers/session-audit.js.map +1 -1
- package/dist/os/session/session.module.d.ts.map +1 -1
- package/dist/os/session/session.module.js +29 -9
- package/dist/os/session/session.module.js.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
- package/dist/os/system/handlers/system-outbox-scan.js +36 -18
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
- package/dist/os/system/handlers/system-task-dispatch.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-dispatch.js +14 -16
- package/dist/os/system/handlers/system-task-dispatch.js.map +1 -1
- package/dist/os/system/handlers/system-versionset-record.js +3 -3
- package/dist/os/system/scenario-schemas.js +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +14 -9
- package/dist/os/system/system.module.js.map +1 -1
- package/dist/os/system/task-schemas.d.ts +3 -3
- package/dist/os/trajectory/handlers/journal-io.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/journal-io.js +2 -2
- package/dist/os/trajectory/handlers/journal-io.js.map +1 -1
- package/dist/os/trajectory/handlers/outcome-record.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/outcome-record.js +49 -9
- package/dist/os/trajectory/handlers/outcome-record.js.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-index.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-index.js +75 -21
- package/dist/os/trajectory/handlers/trajectory-index.js.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-recall.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-recall.js +38 -10
- package/dist/os/trajectory/handlers/trajectory-recall.js.map +1 -1
- package/dist/os/trajectory/trajectory.module.d.ts.map +1 -1
- package/dist/os/trajectory/trajectory.module.js +35 -7
- package/dist/os/trajectory/trajectory.module.js.map +1 -1
- package/dist/src/adversarial/types.d.ts +44 -0
- package/dist/src/adversarial/types.d.ts.map +1 -0
- package/dist/src/adversarial/types.js +82 -0
- package/dist/src/adversarial/types.js.map +1 -0
- package/dist/src/authority/delegations.d.ts +1 -1
- package/dist/src/authority/delegations.d.ts.map +1 -1
- package/dist/src/authority/delegations.js +9 -2
- package/dist/src/authority/delegations.js.map +1 -1
- package/dist/src/command-modules.d.ts.map +1 -1
- package/dist/src/command-modules.js +2 -0
- package/dist/src/command-modules.js.map +1 -1
- package/dist/src/config/forge-config.d.ts +65 -1
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +114 -12
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/correctness/policy-bundle.d.ts +72 -0
- package/dist/src/correctness/policy-bundle.d.ts.map +1 -0
- package/dist/src/correctness/policy-bundle.js +170 -0
- package/dist/src/correctness/policy-bundle.js.map +1 -0
- package/dist/src/knowledge/paths.d.ts +21 -0
- package/dist/src/knowledge/paths.d.ts.map +1 -0
- package/dist/src/knowledge/paths.js +57 -0
- package/dist/src/knowledge/paths.js.map +1 -0
- package/dist/src/knowledge/sync.d.ts +7 -0
- package/dist/src/knowledge/sync.d.ts.map +1 -1
- package/dist/src/knowledge/sync.js +41 -13
- package/dist/src/knowledge/sync.js.map +1 -1
- package/dist/src/migration-adapters/ignored-files.d.ts +14 -0
- package/dist/src/migration-adapters/ignored-files.d.ts.map +1 -1
- package/dist/src/migration-adapters/ignored-files.js +62 -0
- package/dist/src/migration-adapters/ignored-files.js.map +1 -1
- package/dist/src/migration-adapters/index.d.ts +3 -3
- package/dist/src/migration-adapters/index.d.ts.map +1 -1
- package/dist/src/migration-adapters/index.js +2 -2
- package/dist/src/migration-adapters/index.js.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.d.ts.map +1 -1
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js +9 -7
- package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.d.ts.map +1 -1
- package/dist/src/migration-adapters/phaser-pnpm/index.js +9 -7
- package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
- package/dist/src/migration-adapters/types.d.ts +19 -1
- package/dist/src/migration-adapters/types.d.ts.map +1 -1
- package/dist/src/migration-adapters/types.js +19 -0
- package/dist/src/migration-adapters/types.js.map +1 -1
- package/dist/src/onboarding/init.d.ts.map +1 -1
- package/dist/src/onboarding/init.js +19 -5
- package/dist/src/onboarding/init.js.map +1 -1
- package/dist/src/onboarding/npm-token-check.d.ts.map +1 -1
- package/dist/src/onboarding/npm-token-check.js +9 -1
- package/dist/src/onboarding/npm-token-check.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.d.ts.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +17 -5
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/onboarding/trust-boundary.d.ts +16 -0
- package/dist/src/onboarding/trust-boundary.d.ts.map +1 -0
- package/dist/src/onboarding/trust-boundary.js +806 -0
- package/dist/src/onboarding/trust-boundary.js.map +1 -0
- package/dist/src/onboarding/upgrade.d.ts +4 -0
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +120 -9
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/types.d.ts +6 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +3 -3
- package/dist/src/utils/verifier-git.d.ts +1303 -0
- package/dist/src/utils/verifier-git.d.ts.map +1 -0
- package/dist/src/utils/verifier-git.js +7797 -0
- package/dist/src/utils/verifier-git.js.map +1 -0
- package/dist/src/validators/skill-validate.d.ts.map +1 -1
- package/dist/src/validators/skill-validate.js +17 -5
- package/dist/src/validators/skill-validate.js.map +1 -1
- package/docs/adversarial/downgrade-forge/scenario.yaml +22 -0
- package/docs/adversarial/drop-manifest-entry/scenario.yaml +25 -0
- package/docs/adversarial/edit-frozen-file/scenario.yaml +24 -0
- package/docs/adversarial/edit-policy-key/scenario.yaml +41 -0
- package/docs/adversarial/forge-review-record/scenario.yaml +34 -0
- package/docs/adversarial/grow-allow/scenario.yaml +46 -0
- package/docs/adversarial/mixed-weakening/scenario.yaml +26 -0
- package/docs/adversarial/rebind-checkrun/scenario.yaml +41 -0
- package/docs/adversarial/self-exempt/scenario.yaml +41 -0
- package/docs/adversarial/shrink-policy-decl/scenario.yaml +41 -0
- package/docs/adversarial/spoof-verifier-trailer/scenario.yaml +26 -0
- package/docs/adversarial/weaken-oracle/scenario.yaml +22 -0
- package/docs/concepts/why-forge.md +1 -1
- package/docs/evidence/release-9.6.2.md +31 -0
- package/docs/grants/devin-startups.md +25 -0
- package/docs/guides/existing-project.md +5 -5
- package/docs/integrations/devin.md +14 -0
- package/docs/maintainers/publishing.md +1 -1
- package/docs/reference/cli.md +2 -2
- package/docs/reference/correctness-gate.md +35 -5
- package/docs/reference/forge-yaml.md +17 -1
- package/docs/reference/trust-boundary.md +36 -0
- package/os/adr/handlers/implement-stamp.ts +56 -26
- package/os/adr/handlers/validate.ts +66 -28
- package/os/adversarial/adversarial.module.ts +147 -0
- package/os/adversarial/catalog.test.ts +96 -0
- package/os/adversarial/catalog.ts +79 -0
- package/os/adversarial/runner.ts +533 -0
- package/os/agent/handlers/agent-tiers-validate.ts +39 -10
- package/os/agent/index.ts +1 -1
- package/os/agent-tools/agent-tools.module.ts +84 -0
- package/os/agent-tools/generate.ts +104 -0
- package/os/agent-tools/handlers/tools-generate.ts +137 -0
- package/os/agent-tools/index.ts +23 -0
- package/os/agent-tools/manifest.ts +95 -0
- package/os/agent-tools/serve.ts +127 -0
- package/os/agent-tools/server.ts +460 -0
- package/os/agent-tools/tool-server.test.ts +226 -0
- package/os/agent-tools/tools-generate.test.ts +204 -0
- package/os/agent-tools/types.ts +139 -0
- package/os/authority/authority.module.ts +17 -2
- package/os/checks/checks.module.ts +46 -11
- package/os/checks/handlers/contribution-liveness.test.ts +142 -0
- package/os/checks/handlers/contribution-report.test.ts +46 -11
- package/os/checks/handlers/contribution-report.ts +222 -44
- package/os/checks/handlers/counters-export.test.ts +179 -8
- package/os/checks/handlers/counters-export.ts +77 -9
- package/os/checks/handlers/counters-journal.test.ts +25 -5
- package/os/checks/handlers/counters-validate.test.ts +21 -6
- package/os/checks/handlers/counters-validate.ts +4 -2
- package/os/checks/handlers/variant-candidates.test.ts +6 -2
- package/os/codebase/handlers/codebase-measure.ts +17 -20
- package/os/codebase/index.ts +4 -1
- package/os/compass/handlers/compass-audit-handler.ts +236 -38
- package/os/compass/handlers/compass-header-scaffold-handler.ts +47 -2
- package/os/compass/handlers/compass-migrate-handler.ts +46 -4
- package/os/compass/handlers/git-revision.ts +183 -63
- package/os/compass/handlers/summary-record.ts +48 -10
- package/os/context/context.module.ts +23 -4
- package/os/context/handlers/context-assemble.test.ts +5 -2
- package/os/context/handlers/context-assemble.ts +144 -28
- package/os/context/handlers/context-slate-eval.test.ts +11 -5
- package/os/context/handlers/context-slate-eval.ts +36 -10
- package/os/context/handlers/index-build.ts +179 -40
- package/os/context/handlers/no-model-deps.test.ts +8 -3
- package/os/context/handlers/slate-fill.test.ts +7 -2
- package/os/core/archive-regen.ts +178 -13
- package/os/core/core.module.ts +208 -51
- package/os/core/docs-archive.test.ts +134 -37
- package/os/core/handlers/forge-autonomy-validate.ts +104 -2
- package/os/core/handlers/package-health.ts +6 -6
- package/os/core/handlers/policy-digest.test.ts +143 -0
- package/os/core/handlers/policy-digest.ts +470 -0
- package/os/correctness/audit/snapshot.ts +46 -22
- package/os/correctness/correctness-chain.test.ts +6 -2
- package/os/correctness/correctness.module.ts +6 -3
- package/os/correctness/gate/anchor-events.test.ts +5 -1
- package/os/correctness/gate/freeze-coverage.test.ts +1 -1
- package/os/correctness/gate/freeze-diff.test.ts +1 -1
- package/os/correctness/gate/frozen.ts +691 -58
- package/os/correctness/gate/gate-mode.test.ts +5 -1
- package/os/correctness/gate/hardening.test.ts +5 -2
- package/os/correctness/gate/origin.ts +77 -37
- package/os/correctness/gate/policy-freeze-cx.test.ts +174 -0
- package/os/correctness/gate/policy-freeze-cx10.test.ts +873 -0
- package/os/correctness/gate/policy-freeze-cx11.test.ts +534 -0
- package/os/correctness/gate/policy-freeze-cx12.test.ts +488 -0
- package/os/correctness/gate/policy-freeze-cx13.test.ts +734 -0
- package/os/correctness/gate/policy-freeze-cx14.test.ts +533 -0
- package/os/correctness/gate/policy-freeze-cx15.test.ts +830 -0
- package/os/correctness/gate/policy-freeze-cx16.test.ts +652 -0
- package/os/correctness/gate/policy-freeze-cx17.test.ts +717 -0
- package/os/correctness/gate/policy-freeze-cx18.test.ts +705 -0
- package/os/correctness/gate/policy-freeze-cx19.test.ts +376 -0
- package/os/correctness/gate/policy-freeze-cx2.test.ts +691 -0
- package/os/correctness/gate/policy-freeze-cx20.test.ts +572 -0
- package/os/correctness/gate/policy-freeze-cx21.test.ts +423 -0
- package/os/correctness/gate/policy-freeze-cx22.test.ts +978 -0
- package/os/correctness/gate/policy-freeze-cx23.test.ts +431 -0
- package/os/correctness/gate/policy-freeze-cx24.test.ts +509 -0
- package/os/correctness/gate/policy-freeze-cx25.test.ts +1064 -0
- package/os/correctness/gate/policy-freeze-cx3.test.ts +569 -0
- package/os/correctness/gate/policy-freeze-cx4.test.ts +731 -0
- package/os/correctness/gate/policy-freeze-cx5.test.ts +577 -0
- package/os/correctness/gate/policy-freeze-cx6.test.ts +944 -0
- package/os/correctness/gate/policy-freeze-cx7.test.ts +622 -0
- package/os/correctness/gate/policy-freeze-cx8.test.ts +638 -0
- package/os/correctness/gate/policy-freeze-cx9.test.ts +959 -0
- package/os/correctness/gate/policy-freeze.test.ts +249 -0
- package/os/correctness/gate/repo.ts +194 -15
- package/os/correctness/gate/run.ts +444 -65
- package/os/correctness/gate/runner.ts +41 -8
- package/os/correctness/gate/tests/gate-fixture.ts +27 -2
- package/os/correctness/gate/tier-high.test.ts +5 -1
- package/os/correctness/gate/trust-boundary-cx1.test.ts +1020 -0
- package/os/correctness/gate/trust-boundary-cx10.test.ts +755 -0
- package/os/correctness/gate/trust-boundary-cx11.test.ts +515 -0
- package/os/correctness/gate/trust-boundary-cx12.test.ts +552 -0
- package/os/correctness/gate/trust-boundary-cx13.test.ts +446 -0
- package/os/correctness/gate/trust-boundary-cx14.test.ts +375 -0
- package/os/correctness/gate/trust-boundary-cx15.test.ts +421 -0
- package/os/correctness/gate/trust-boundary-cx16.test.ts +487 -0
- package/os/correctness/gate/trust-boundary-cx17.test.ts +319 -0
- package/os/correctness/gate/trust-boundary-cx18.test.ts +516 -0
- package/os/correctness/gate/trust-boundary-cx19.test.ts +514 -0
- package/os/correctness/gate/trust-boundary-cx2.test.ts +979 -0
- package/os/correctness/gate/trust-boundary-cx20.test.ts +216 -0
- package/os/correctness/gate/trust-boundary-cx22.test.ts +193 -0
- package/os/correctness/gate/trust-boundary-cx23.test.ts +283 -0
- package/os/correctness/gate/trust-boundary-cx24.test.ts +180 -0
- package/os/correctness/gate/trust-boundary-cx25.test.ts +482 -0
- package/os/correctness/gate/trust-boundary-cx26.test.ts +408 -0
- package/os/correctness/gate/trust-boundary-cx27.test.ts +983 -0
- package/os/correctness/gate/trust-boundary-cx28.test.ts +587 -0
- package/os/correctness/gate/trust-boundary-cx29a.test.ts +226 -0
- package/os/correctness/gate/trust-boundary-cx29b.test.ts +271 -0
- package/os/correctness/gate/trust-boundary-cx29c.test.ts +217 -0
- package/os/correctness/gate/trust-boundary-cx29d.test.ts +544 -0
- package/os/correctness/gate/trust-boundary-cx29e.test.ts +207 -0
- package/os/correctness/gate/trust-boundary-cx29f.test.ts +226 -0
- package/os/correctness/gate/trust-boundary-cx29g.test.ts +74 -0
- package/os/correctness/gate/trust-boundary-cx3.test.ts +929 -0
- package/os/correctness/gate/trust-boundary-cx30a.test.ts +195 -0
- package/os/correctness/gate/trust-boundary-cx30b.test.ts +296 -0
- package/os/correctness/gate/trust-boundary-cx31a.test.ts +129 -0
- package/os/correctness/gate/trust-boundary-cx31b.test.ts +333 -0
- package/os/correctness/gate/trust-boundary-cx31c.test.ts +259 -0
- package/os/correctness/gate/trust-boundary-cx31d.test.ts +132 -0
- package/os/correctness/gate/trust-boundary-cx32a.test.ts +275 -0
- package/os/correctness/gate/trust-boundary-cx32b.test.ts +509 -0
- package/os/correctness/gate/trust-boundary-cx32c.test.ts +211 -0
- package/os/correctness/gate/trust-boundary-cx32d.test.ts +184 -0
- package/os/correctness/gate/trust-boundary-cx33a.test.ts +250 -0
- package/os/correctness/gate/trust-boundary-cx33b.test.ts +287 -0
- package/os/correctness/gate/trust-boundary-cx33c.test.ts +122 -0
- package/os/correctness/gate/trust-boundary-cx33d.test.ts +357 -0
- package/os/correctness/gate/trust-boundary-cx33e.test.ts +96 -0
- package/os/correctness/gate/trust-boundary-cx34a.test.ts +283 -0
- package/os/correctness/gate/trust-boundary-cx34b.test.ts +228 -0
- package/os/correctness/gate/trust-boundary-cx34d.test.ts +282 -0
- package/os/correctness/gate/trust-boundary-cx34e.test.ts +224 -0
- package/os/correctness/gate/trust-boundary-cx34f.test.ts +250 -0
- package/os/correctness/gate/trust-boundary-cx34g.test.ts +179 -0
- package/os/correctness/gate/trust-boundary-cx34h.test.ts +293 -0
- package/os/correctness/gate/trust-boundary-cx34i.test.ts +245 -0
- package/os/correctness/gate/trust-boundary-cx35a.test.ts +181 -0
- package/os/correctness/gate/trust-boundary-cx35b.test.ts +137 -0
- package/os/correctness/gate/trust-boundary-cx35c.test.ts +149 -0
- package/os/correctness/gate/trust-boundary-cx35d.test.ts +121 -0
- package/os/correctness/gate/trust-boundary-cx35e.test.ts +108 -0
- package/os/correctness/gate/trust-boundary-cx36.test.ts +120 -0
- package/os/correctness/gate/trust-boundary-cx37.test.ts +430 -0
- package/os/correctness/gate/trust-boundary-cx38.test.ts +436 -0
- package/os/correctness/gate/trust-boundary-cx39.test.ts +432 -0
- package/os/correctness/gate/trust-boundary-cx4.test.ts +764 -0
- package/os/correctness/gate/trust-boundary-cx40.test.ts +264 -0
- package/os/correctness/gate/trust-boundary-cx41.test.ts +460 -0
- package/os/correctness/gate/trust-boundary-cx42.test.ts +432 -0
- package/os/correctness/gate/trust-boundary-cx43.test.ts +257 -0
- package/os/correctness/gate/trust-boundary-cx5.test.ts +998 -0
- package/os/correctness/gate/trust-boundary-cx6.test.ts +701 -0
- package/os/correctness/gate/trust-boundary-cx7.test.ts +1007 -0
- package/os/correctness/gate/trust-boundary-cx8.test.ts +929 -0
- package/os/correctness/gate/trust-boundary-cx9.test.ts +993 -0
- package/os/correctness/gate/types.ts +4 -0
- package/os/correctness/handlers/gate.ts +2 -0
- package/os/correctness/handlers/validate.ts +63 -12
- package/os/correctness/references.ts +63 -20
- package/os/correctness/workspace.ts +203 -22
- package/os/flow/branch-name.ts +3 -6
- package/os/flow/correctness-step.ts +91 -17
- package/os/flow/digest.ts +598 -178
- package/os/flow/dup-id-scan.ts +187 -0
- package/os/flow/flow.module.ts +138 -18
- package/os/flow/git.ts +757 -86
- package/os/flow/guard-files.ts +5 -14
- package/os/flow/handlers/flow-backmerge.ts +11 -22
- package/os/flow/handlers/flow-check.ts +2 -2
- package/os/flow/handlers/flow-cut.ts +459 -252
- package/os/flow/handlers/flow-digest.ts +2 -1
- package/os/flow/handlers/flow-discard.ts +6 -6
- package/os/flow/handlers/flow-fix.ts +104 -29
- package/os/flow/handlers/flow-hold.ts +24 -37
- package/os/flow/handlers/flow-install.ts +61 -33
- package/os/flow/handlers/flow-integrate.ts +992 -209
- package/os/flow/handlers/flow-open.ts +104 -12
- package/os/flow/handlers/flow-publication-retire.ts +38 -17
- package/os/flow/handlers/flow-push.ts +337 -73
- package/os/flow/handlers/flow-status.ts +32 -13
- package/os/flow/handlers/flow-swept.ts +185 -0
- package/os/flow/handlers/flow-version.ts +5 -18
- package/os/flow/index.ts +8 -4
- package/os/flow/line-version.ts +21 -8
- package/os/flow/locks.ts +21 -10
- package/os/flow/markers.ts +16 -5
- package/os/flow/ops-registry.ts +25 -7
- package/os/flow/post-rebase-regen.ts +218 -25
- package/os/flow/pre-lock.ts +334 -0
- package/os/flow/preflight.ts +108 -17
- package/os/flow/primary-dirt.ts +319 -0
- package/os/flow/publish.ts +35 -17
- package/os/flow/registry.ts +23 -13
- package/os/flow/release-level.ts +25 -12
- package/os/flow/release-lines.ts +4 -5
- package/os/flow/release-tags.ts +47 -19
- package/os/flow/repo-kind.ts +6 -3
- package/os/flow/scripts.ts +40 -7
- package/os/flow/semver.ts +1 -1
- package/os/flow/session-checkout.ts +3 -3
- package/os/flow/standalone-invoke.ts +2 -2
- package/os/flow/tests/branch-name.test.ts +15 -7
- package/os/flow/tests/flow-backmerge.test.ts +8 -6
- package/os/flow/tests/flow-check.test.ts +6 -11
- package/os/flow/tests/flow-cut-prepare.test.ts +64 -15
- package/os/flow/tests/flow-cut.rerun.test.ts +1 -1
- package/os/flow/tests/flow-cut.test.ts +230 -11
- package/os/flow/tests/flow-detachable.test.ts +10 -2
- package/os/flow/tests/flow-digest.test.ts +109 -29
- package/os/flow/tests/flow-fix.test.ts +96 -20
- package/os/flow/tests/flow-guard-parity.test.ts +55 -53
- package/os/flow/tests/flow-guard-push.test.ts +39 -2
- package/os/flow/tests/flow-guard.test.ts +5 -10
- package/os/flow/tests/flow-hold.test.ts +43 -10
- package/os/flow/tests/flow-install-markers.test.ts +47 -20
- package/os/flow/tests/flow-install.rerun.test.ts +18 -9
- package/os/flow/tests/flow-install.test.ts +19 -19
- package/os/flow/tests/flow-integrate-correctness-gate.test.ts +3 -4
- package/os/flow/tests/flow-integrate-prelock.test.ts +392 -0
- package/os/flow/tests/flow-integrate.gate-report.test.ts +2 -4
- package/os/flow/tests/flow-integrate.post-rebase-regen.test.ts +33 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +36 -1
- package/os/flow/tests/flow-integrate.test.ts +375 -21
- package/os/flow/tests/flow-open.test.ts +123 -9
- package/os/flow/tests/flow-publication-retire.test.ts +13 -6
- package/os/flow/tests/flow-push-publish.test.ts +45 -19
- package/os/flow/tests/flow-push-supersede.test.ts +37 -34
- package/os/flow/tests/flow-push-verifier-review.test.ts +190 -0
- package/os/flow/tests/flow-push.test.ts +15 -7
- package/os/flow/tests/flow-status.test.ts +54 -1
- package/os/flow/tests/flow-swept.test.ts +105 -0
- package/os/flow/tests/flow-task-files.test.ts +18 -4
- package/os/flow/tests/helpers.test.ts +91 -0
- package/os/flow/tests/helpers.ts +188 -19
- package/os/flow/tests/locks.test.ts +5 -4
- package/os/flow/tests/post-rebase-regen.test.ts +315 -0
- package/os/flow/tests/scripts.test.ts +8 -4
- package/os/flow/tests/state-roots.test.ts +8 -11
- package/os/flow/version-files.ts +4 -2
- package/os/flow/worktree-path.ts +3 -9
- package/os/friction/friction-add.test.ts +141 -0
- package/os/friction/friction-migrate.test.ts +138 -0
- package/os/friction/friction-store.test.ts +184 -0
- package/os/friction/friction-validate.test.ts +133 -21
- package/os/friction/friction.module.ts +140 -30
- package/os/friction/handlers/friction-add.ts +268 -0
- package/os/friction/handlers/friction-migrate.ts +206 -0
- package/os/friction/handlers/friction-validate.ts +238 -176
- package/os/friction/index.ts +14 -1
- package/os/friction/qa-log-shards.test.ts +111 -0
- package/os/friction/store.ts +284 -0
- package/os/friction/types.ts +11 -13
- package/os/gate/gate.module.ts +47 -6
- package/os/gate/handlers/gate-probe-catalog.test.ts +1 -1
- package/os/gate/handlers/gate-probe-catalog.ts +413 -42
- package/os/gate/handlers/gate-probe-ratchet.test.ts +329 -0
- package/os/gate/handlers/gate-probe.test.ts +27 -5
- package/os/gate/handlers/gate-probe.ts +110 -12
- package/os/gate/handlers/liveness.ts +113 -0
- package/os/gate/handlers/probe-runs-journal.ts +167 -0
- package/os/gate-run/gate-run.module.ts +3 -0
- package/os/gate-run/index.ts +11 -0
- package/os/gate-run/record.ts +8 -1
- package/os/gate-run/status.ts +9 -1
- package/os/gate-run/tests/gate-run-record.test.ts +11 -1
- package/os/gate-run/tests/gate-run-status.test.ts +2 -0
- package/os/gate-run/types.ts +8 -0
- package/os/instructions/budget.test.ts +32 -7
- package/os/instructions/handlers/scar-migrate.ts +55 -66
- package/os/instructions/instructions.module.ts +32 -5
- package/os/knowledge/handlers/knowledge-authz-probe.ts +38 -12
- package/os/knowledge/handlers/knowledge-rebuild.test.ts +5 -2
- package/os/knowledge/handlers/knowledge-rebuild.ts +39 -16
- package/os/knowledge/knowledge.module.ts +21 -4
- package/os/mission/handlers/archive.test.ts +47 -30
- package/os/mission/lockfile.ts +47 -20
- package/os/naming/naming-convention.test.ts +1 -0
- package/os/naming/naming-convention.ts +2 -2
- package/os/program/discovery.ts +70 -44
- package/os/program/handlers/complete.ts +28 -10
- package/os/program/handlers/lease.ts +11 -2
- package/os/program/handlers/seal.ts +3 -3
- package/os/program/handlers/validate.ts +3 -3
- package/os/queue/handlers/queue-decision.ts +253 -0
- package/os/queue/handlers/queue-validate.ts +24 -23
- package/os/queue/manifest.ts +1 -2
- package/os/queue/queue-decision.test.ts +262 -0
- package/os/queue/queue.module.ts +93 -4
- package/os/rfc/frontmatter-io.ts +6 -3
- package/os/rfc/handlers/implement-stamp-origin.ts +6 -3
- package/os/rfc/handlers/implement-stamp.ts +65 -46
- package/os/rfc/handlers/index-graph.ts +14 -0
- package/os/rfc/handlers/rfc-evidence-sync.ts +62 -22
- package/os/rfc/handlers/validate-moves.test.ts +221 -0
- package/os/rfc/handlers/validate-probe-meta.test.ts +21 -1
- package/os/rfc/handlers/validate-rules.ts +216 -60
- package/os/rfc/handlers/validate.ts +1 -5
- package/os/rfc/next-id.ts +155 -21
- package/os/rfc/outcome-probe.ts +13 -4
- package/os/rfc/reachable-symbol.ts +65 -43
- package/os/rfc/rfc-0000-template.md +10 -0
- package/os/rfc/rfc.module.ts +26 -4
- package/os/rfc/types.ts +31 -3
- package/os/rfc/verification-evidence.ts +74 -25
- package/os/rfc/verification-origin.ts +358 -62
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +1 -1
- package/os/rfc/verifier/rfc-1333/imp12-gate.acceptance.test.ts +1 -1
- package/os/rfc/verifier/rfc-1333/skills-and-types.acceptance.test.ts +1 -1
- package/os/rfc/verifier/rfc-1333/verify-workspace.acceptance.test.ts +1 -1
- package/os/rfc/verifier/rfc-1391/fixtures/no-report.proof.test.ts +1 -1
- package/os/rfc/verifier/rfc-1391/fixtures/small-domain.proof.test.ts +1 -1
- package/os/rfc/verifier/rfc-1391/support.ts +1 -1
- package/os/rfc/verify-workspace.ts +147 -53
- package/os/session/handlers/metrics-rfc.ts +42 -11
- package/os/session/handlers/save.ts +52 -28
- package/os/session/handlers/session-audit-detectors.test.ts +16 -6
- package/os/session/handlers/session-audit-report.test.ts +9 -3
- package/os/session/handlers/session-audit-report.ts +34 -8
- package/os/session/handlers/session-audit.test.ts +25 -7
- package/os/session/handlers/session-audit.ts +49 -23
- package/os/session/session.module.ts +31 -9
- package/os/system/handlers/system-outbox-scan.ts +45 -17
- package/os/system/handlers/system-task-dispatch.ts +17 -21
- package/os/system/handlers/system-versionset-record.ts +3 -3
- package/os/system/scenario-schemas.ts +1 -1
- package/os/system/system.module.ts +14 -9
- package/os/system/tests/scenario-pin-drift-check.test.ts +2 -0
- package/os/system/tests/scenario-validator-check.test.ts +2 -0
- package/os/system/tests/system-task-collect.test.ts +25 -15
- package/os/system/tests/system-task-dispatch.test.ts +18 -7
- package/os/system/tests/system-task-status.test.ts +7 -1
- package/os/system/tests/system-task.test.ts +15 -4
- package/os/system/tests/version-set-v2.test.ts +2 -0
- package/os/trajectory/handlers/extract-units.test.ts +11 -6
- package/os/trajectory/handlers/journal-io.ts +21 -7
- package/os/trajectory/handlers/outcome-record.test.ts +28 -8
- package/os/trajectory/handlers/outcome-record.ts +65 -18
- package/os/trajectory/handlers/producer-trust.test.ts +22 -8
- package/os/trajectory/handlers/trajectory-index.test.ts +75 -29
- package/os/trajectory/handlers/trajectory-index.ts +116 -38
- package/os/trajectory/handlers/trajectory-recall.test.ts +67 -19
- package/os/trajectory/handlers/trajectory-recall.ts +115 -41
- package/os/trajectory/handlers/trajectory.test.ts +19 -7
- package/os/trajectory/handlers/verdict-binding.test.ts +138 -33
- package/os/trajectory/trajectory.module.ts +35 -7
- package/os/yaml/scalars.test.ts +1 -1
- package/package.json +32 -2
- package/profiles/godot-game.yaml +4 -4
- package/skills/_shared/fo-pipeline-conventions.md +15 -13
- package/skills/fo/fo-handoff/SKILL.md +10 -2
- package/skills/fo/fo-idea-audit/SKILL.md +4 -0
- package/skills/fo/fo-idea-create-rfc/SKILL.md +21 -10
- package/skills/fo/fo-idea-implement/SKILL.md +2 -10
- package/skills/fo/fo-idea-plan/SKILL.md +7 -5
- package/skills/fo/fo-knowledge-distill/SKILL.md +15 -4
- package/skills/fo/fo-memory-sync/SKILL.md +7 -6
- package/skills/fo/fo-reproduce/SKILL.md +2 -1
- package/skills/fo/fo-session-retro/SKILL.md +87 -44
- package/skills/fo/fo-session-save/SKILL.md +4 -3
- package/skills/fo/fo-system-dispatch/SKILL.md +9 -0
- package/skills/meta/forge-bootstrap/SKILL.md +18 -12
- package/skills/shared/grilling/SKILL.md +17 -9
- package/skills/shared/knowledge/learned-principles.md +1 -1
- package/skills/shared/writing-great-skills/SKILL.md +4 -3
- package/src/adversarial/types.ts +100 -0
- package/src/authority/delegations.ts +9 -2
- package/src/command-modules.ts +6 -0
- package/src/config/forge-config.ts +146 -13
- package/src/correctness/policy-bundle.ts +187 -0
- package/src/knowledge/paths.ts +75 -0
- package/src/knowledge/sync.ts +42 -18
- package/src/migration-adapters/ignored-files.ts +64 -0
- package/src/migration-adapters/index.ts +19 -3
- package/src/migration-adapters/node-typescript-pnpm/index.ts +21 -5
- package/src/migration-adapters/phaser-pnpm/index.ts +21 -5
- package/src/migration-adapters/types.ts +36 -1
- package/src/onboarding/init.ts +20 -5
- package/src/onboarding/npm-token-check.ts +9 -1
- package/src/onboarding/scaffold-project.ts +16 -5
- package/src/onboarding/trust-boundary.test.ts +179 -0
- package/src/onboarding/trust-boundary.ts +825 -0
- package/src/onboarding/upgrade.ts +149 -9
- package/src/scaffold/github/CODEOWNERS.template +14 -0
- package/src/scaffold/github/forge-policy.template.yml +40 -0
- package/src/tests/bindings-schema.test.ts +5 -1
- package/src/tests/create.test.ts +74 -20
- package/src/tests/forge-config.test.ts +5 -2
- package/src/tests/knowledge-paths.test.ts +80 -0
- package/src/tests/migration-adapters.test.ts +73 -5
- package/src/tests/skill-validate.test.ts +76 -0
- package/src/types.ts +10 -5
- package/src/utils/verifier-git.ts +8684 -0
- package/src/validators/skill-validate.ts +17 -5
- /package/skills/fo/fo-memory-sync/{qa-log.md → qa-log/legacy.md} +0 -0
- /package/skills/fo/fo-session-save/{qa-log.md → qa-log/legacy.md} +0 -0
- /package/skills/shared/grilling/{qa-log.md → qa-log/legacy.md} +0 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
/*
|
|
2
|
+
RFC-1615 acceptance verification — round 12 (adversarial).
|
|
3
|
+
Every `it` asserts the EXPECTED contract; a failure is a counterexample.
|
|
4
|
+
Re-tests CX-68..72 fixes, then hunts new classes in the read/anchor layers.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { execFileSync } from "node:child_process";
|
|
8
|
+
import {
|
|
9
|
+
chmodSync,
|
|
10
|
+
existsSync,
|
|
11
|
+
mkdirSync,
|
|
12
|
+
mkdtempSync,
|
|
13
|
+
readFileSync,
|
|
14
|
+
rmSync,
|
|
15
|
+
symlinkSync,
|
|
16
|
+
writeFileSync,
|
|
17
|
+
} from "node:fs";
|
|
18
|
+
import os from "node:os";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
21
|
+
|
|
22
|
+
import { runCorrectnessGate, type GateOptions } from "./run.ts";
|
|
23
|
+
import { GateRepo } from "./repo.ts";
|
|
24
|
+
import {
|
|
25
|
+
makeGateFixture,
|
|
26
|
+
verifierCommit,
|
|
27
|
+
manifestYaml,
|
|
28
|
+
L1_ORACLE,
|
|
29
|
+
ORACLE_PATH,
|
|
30
|
+
type GateFixture,
|
|
31
|
+
} from "./tests/gate-fixture.ts";
|
|
32
|
+
|
|
33
|
+
const fixtures: GateFixture[] = [];
|
|
34
|
+
afterEach(() => fixtures.splice(0).forEach((f) => f.cleanup()));
|
|
35
|
+
const fx = (o: Parameters<typeof makeGateFixture>[0] = {}) => {
|
|
36
|
+
const f = makeGateFixture(o);
|
|
37
|
+
fixtures.push(f);
|
|
38
|
+
return f;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const run = (f: GateFixture, opts: Partial<GateOptions> = {}) =>
|
|
42
|
+
runCorrectnessGate(f.root, { base: f.base, bundleDir: `${f.root}/.bundles`, ...opts });
|
|
43
|
+
|
|
44
|
+
const gate = async (f: GateFixture, opts: Partial<GateOptions> = {}) => {
|
|
45
|
+
const out = await run(f, opts);
|
|
46
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
47
|
+
return out.result;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const msgs = (r: { violations: { rule: string; message: string }[] }) =>
|
|
51
|
+
r.violations.map((v) => `${v.rule}: ${v.message}`);
|
|
52
|
+
|
|
53
|
+
/** Overwrite the loose object for `rev:path` with garbage so content reads fail but tree entries still resolve. */
|
|
54
|
+
const corruptBlob = (f: GateFixture, revPath: string): string => {
|
|
55
|
+
const sha = f.git(["rev-parse", revPath]);
|
|
56
|
+
const obj = path.join(f.root, ".git", "objects", sha.slice(0, 2), sha.slice(2));
|
|
57
|
+
chmodSync(obj, 0o644);
|
|
58
|
+
writeFileSync(obj, "corrupt-loose-object-not-zlib");
|
|
59
|
+
return sha;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** Amend pending writes into the fixture's base commit (rewrite history) and return the new base sha. */
|
|
63
|
+
const amendBase = (f: GateFixture): string => {
|
|
64
|
+
f.git(["add", "-A"]);
|
|
65
|
+
f.git(["commit", "-q", "--amend", "--no-edit"]);
|
|
66
|
+
return f.git(["rev-parse", "HEAD"]);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const MARK = "@ai-" + "invariant";
|
|
70
|
+
const STMT = "dispatch moves an approved candidate to queued exactly once";
|
|
71
|
+
const anchorComment = (stmt = STMT) =>
|
|
72
|
+
`// ${MARK}[INV-dispatch-01]: ${stmt}\n// (checked-by: test:${ORACLE_PATH})\n`;
|
|
73
|
+
|
|
74
|
+
// ===========================================================================
|
|
75
|
+
// Round-12 fix verification — CX-68/70 multi-carrier + divergent copies
|
|
76
|
+
// ===========================================================================
|
|
77
|
+
|
|
78
|
+
describe("CX-68 multi-carrier anchor removal", () => {
|
|
79
|
+
const twoCarrier = () =>
|
|
80
|
+
fx({
|
|
81
|
+
extraFiles: {
|
|
82
|
+
"apps/api/src/helper.ts": `${anchorComment()}export function helper(): void {}\n`,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("drop marker from ONE of two carriers → NO anchor-removed (survives verbatim)", async () => {
|
|
87
|
+
const f = twoCarrier();
|
|
88
|
+
f.write(
|
|
89
|
+
"apps/api/src/dispatch.ts",
|
|
90
|
+
"export function dispatch(): void {\n // marker dropped here\n}\n",
|
|
91
|
+
);
|
|
92
|
+
f.commit("drop the marker from one carrier only");
|
|
93
|
+
const r = await gate(f);
|
|
94
|
+
expect(
|
|
95
|
+
r.weakenings.some((w) => w.kind === "anchor-removed"),
|
|
96
|
+
"anchor still exists verbatim in apps/api/src/helper.ts",
|
|
97
|
+
).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("drop marker from ALL carriers → anchor-removed fires", async () => {
|
|
101
|
+
const f = twoCarrier();
|
|
102
|
+
f.write("apps/api/src/dispatch.ts", "export function dispatch(): void {}\n");
|
|
103
|
+
f.write("apps/api/src/helper.ts", "export function helper(): void {}\n");
|
|
104
|
+
f.commit("drop both carriers");
|
|
105
|
+
const r = await gate(f);
|
|
106
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-removed")).toBe(true);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("git mv one carrier + drop its copy; sibling untouched → NO anchor-removed", async () => {
|
|
110
|
+
const f = twoCarrier();
|
|
111
|
+
const dropped = f
|
|
112
|
+
.read("apps/api/src/dispatch.ts")
|
|
113
|
+
.split("\n")
|
|
114
|
+
.filter((l) => !l.includes(MARK) && !l.includes("checked-by"))
|
|
115
|
+
.join("\n");
|
|
116
|
+
f.write("apps/api/src/dispatch2.ts", dropped);
|
|
117
|
+
f.git(["rm", "-q", "apps/api/src/dispatch.ts"]);
|
|
118
|
+
f.commit("rename carrier, drop its copy");
|
|
119
|
+
const r = await gate(f);
|
|
120
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-removed")).toBe(false);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("git mv of EVERY carrier + drop everywhere → anchor-removed", async () => {
|
|
124
|
+
const f = twoCarrier();
|
|
125
|
+
for (const rel of ["apps/api/src/dispatch.ts", "apps/api/src/helper.ts"]) {
|
|
126
|
+
const dropped = f
|
|
127
|
+
.read(rel)
|
|
128
|
+
.split("\n")
|
|
129
|
+
.filter((l) => !l.includes(MARK) && !l.includes("checked-by"))
|
|
130
|
+
.join("\n");
|
|
131
|
+
f.write(`${rel.replace(".ts", "2.ts")}`, dropped);
|
|
132
|
+
f.git(["rm", "-q", rel]);
|
|
133
|
+
}
|
|
134
|
+
f.commit("rename all carriers, drop all copies");
|
|
135
|
+
const r = await gate(f);
|
|
136
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-removed")).toBe(true);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
describe("CX-70 divergent base copies (frozen.anchors id→Set<sha>)", () => {
|
|
141
|
+
// aaaa.ts sorts before dispatch.ts and carries statement B; dispatch.ts carries the fixture's A.
|
|
142
|
+
const divergent = () =>
|
|
143
|
+
fx({
|
|
144
|
+
extraFiles: {
|
|
145
|
+
"apps/api/src/aaaa.ts": `${anchorComment("a different but base-frozen statement text")}export function a(): void {}\n`,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("cosmetic edit to the NON-first carrier (dispatch.ts, stmt A) → no anchor-reworded", async () => {
|
|
150
|
+
const f = divergent();
|
|
151
|
+
f.write(
|
|
152
|
+
"apps/api/src/dispatch.ts",
|
|
153
|
+
`${anchorComment()}export function dispatch(): void {\n // cosmetic change\n}\n`,
|
|
154
|
+
);
|
|
155
|
+
f.commit("cosmetic edit to dispatch carrier");
|
|
156
|
+
const r = await gate(f);
|
|
157
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-reworded")).toBe(false);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("cosmetic edit to the OTHER divergent carrier (aaaa.ts, stmt B) → no anchor-reworded", async () => {
|
|
161
|
+
const f = divergent();
|
|
162
|
+
f.write(
|
|
163
|
+
"apps/api/src/aaaa.ts",
|
|
164
|
+
`${anchorComment("a different but base-frozen statement text")}export function a(): void {\n // cosmetic\n}\n`,
|
|
165
|
+
);
|
|
166
|
+
f.commit("cosmetic edit to aaaa carrier");
|
|
167
|
+
const r = await gate(f);
|
|
168
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-reworded")).toBe(false);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it("genuine reword of ONE divergent copy → anchor-reworded", async () => {
|
|
172
|
+
const f = divergent();
|
|
173
|
+
f.write(
|
|
174
|
+
"apps/api/src/dispatch.ts",
|
|
175
|
+
`${anchorComment("a reworded statement not seen at base")}export function dispatch(): void {}\n`,
|
|
176
|
+
);
|
|
177
|
+
f.commit("reword one divergent copy");
|
|
178
|
+
const r = await gate(f);
|
|
179
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-reworded")).toBe(true);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// ===========================================================================
|
|
184
|
+
// Round-12 fix verification — CX-69 late unreadableReads re-check in finish()
|
|
185
|
+
// ===========================================================================
|
|
186
|
+
|
|
187
|
+
describe("CX-69 late-flag re-check in finish()", () => {
|
|
188
|
+
it("corrupt HEAD review-record blob → 'a git read failed' + fail", async () => {
|
|
189
|
+
const f = fx();
|
|
190
|
+
const rel = "docs/correctness/reviews/2026-11-13-base.yaml";
|
|
191
|
+
f.write(rel, f.read(rel) + "# touched\n");
|
|
192
|
+
verifierCommit(f.git, rel);
|
|
193
|
+
corruptBlob(f, `HEAD:${rel}`);
|
|
194
|
+
const r = await gate(f);
|
|
195
|
+
expect(r.status).toBe("fail");
|
|
196
|
+
expect(msgs(r).some((m) => m.includes("a git read failed"))).toBe(true);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("exempt×exempt with corrupt base files() → status fail, not exempt", async () => {
|
|
200
|
+
const f = fx({ mode: "exempt" });
|
|
201
|
+
corruptBlob(f, `${f.base}:test`); // test/ tree → files(base) fails inside readFrozenSet
|
|
202
|
+
const r = await gate(f);
|
|
203
|
+
expect(r.status).toBe("fail");
|
|
204
|
+
expect(msgs(r).some((m) => m.includes("a git read failed"))).toBe(true);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("bundle JSON carries unreadableReads", async () => {
|
|
208
|
+
const f = fx();
|
|
209
|
+
const rel = "docs/correctness/reviews/2026-11-13-base.yaml";
|
|
210
|
+
f.write(rel, f.read(rel) + "# touched\n");
|
|
211
|
+
verifierCommit(f.git, rel);
|
|
212
|
+
corruptBlob(f, `HEAD:${rel}`);
|
|
213
|
+
const out = await run(f);
|
|
214
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
215
|
+
expect(out.result.status).toBe("fail");
|
|
216
|
+
const bundle = JSON.parse(readFileSync(out.result.bundlePath, "utf8")) as {
|
|
217
|
+
unreadableReads?: string[];
|
|
218
|
+
};
|
|
219
|
+
expect(Array.isArray(bundle.unreadableReads)).toBe(true);
|
|
220
|
+
expect((bundle.unreadableReads ?? []).length).toBeGreaterThan(0);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// ===========================================================================
|
|
225
|
+
// Round-12 fix verification — CX-71 git log failure tri-state
|
|
226
|
+
// ===========================================================================
|
|
227
|
+
|
|
228
|
+
describe("CX-71 git log failure", () => {
|
|
229
|
+
it("corrupt mid-range tree → NO fabricated frozen-file weakening + flag", async () => {
|
|
230
|
+
const f = fx();
|
|
231
|
+
f.write(ORACLE_PATH, "// verifier-amended oracle v2\n" + L1_ORACLE);
|
|
232
|
+
verifierCommit(f.git, "docs/correctness/reviews/2026-11-14-v2.yaml");
|
|
233
|
+
f.write("test/other.ts", "export const y = 1;\n");
|
|
234
|
+
f.commit("unrelated test dir change");
|
|
235
|
+
f.write("test/another.ts", "export const z = 1;\n");
|
|
236
|
+
f.commit("second unrelated test dir change");
|
|
237
|
+
const c3 = f.git(["rev-parse", "HEAD~1"]);
|
|
238
|
+
corruptBlob(f, `${c3}:test`);
|
|
239
|
+
const r = await gate(f);
|
|
240
|
+
expect(r.weakenings.some((w) => w.kind === "frozen-file")).toBe(false);
|
|
241
|
+
expect(msgs(r).some((m) => m.includes("a git read failed"))).toBe(true);
|
|
242
|
+
expect(r.status).toBe("fail");
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it("origin derivation does NOT promote viaTrailer on unreadable history", async () => {
|
|
246
|
+
const f = fx();
|
|
247
|
+
f.write(ORACLE_PATH, "// verifier-amended oracle v2\n" + L1_ORACLE);
|
|
248
|
+
verifierCommit(f.git, "docs/correctness/reviews/2026-11-14-v2.yaml");
|
|
249
|
+
f.write("test/other.ts", "export const y = 1;\n");
|
|
250
|
+
f.commit("unrelated test dir change");
|
|
251
|
+
f.write("test/another.ts", "export const z = 1;\n");
|
|
252
|
+
f.commit("second unrelated test dir change");
|
|
253
|
+
const c3 = f.git(["rev-parse", "HEAD~1"]);
|
|
254
|
+
corruptBlob(f, `${c3}:test`);
|
|
255
|
+
const out = await run(f);
|
|
256
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
257
|
+
const oracle = out.bundle.entries[0]?.oracles[0];
|
|
258
|
+
expect(oracle?.origin === "verified" && oracle.originDetail.includes("trailer")).toBe(false);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
// ===========================================================================
|
|
263
|
+
// Round-12 fix verification — CX-72 byte-level UTF-8 validation
|
|
264
|
+
// ===========================================================================
|
|
265
|
+
|
|
266
|
+
describe("CX-72 byte-level UTF-8 in listings", () => {
|
|
267
|
+
const nameFF = Buffer.from([0x73, 0x63, 0x72, 0xff, 0x2e, 0x73, 0x68]); // "scr\xff.sh"
|
|
268
|
+
|
|
269
|
+
it("a filename with a REAL U+FFFD codepoint does NOT flag", async () => {
|
|
270
|
+
const f = fx();
|
|
271
|
+
f.write("nonutf8b/scr�.sh", "v1\n");
|
|
272
|
+
f.write(
|
|
273
|
+
"docs/correctness.yaml",
|
|
274
|
+
manifestYaml({}).replace("support: []", 'support: ["nonutf8b/**"]'),
|
|
275
|
+
);
|
|
276
|
+
const base = amendBase(f);
|
|
277
|
+
const r = await gate(f, { base });
|
|
278
|
+
expect(msgs(r).every((m) => !m.includes("non-UTF-8 path"))).toBe(true);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it("a genuinely non-UTF-8 filename (\\xff byte) DOES flag", async () => {
|
|
282
|
+
const f = fx();
|
|
283
|
+
mkdirSync(path.join(f.root, "nonutf8"), { recursive: true });
|
|
284
|
+
writeFileSync(
|
|
285
|
+
Buffer.concat([Buffer.from(`${path.join(f.root, "nonutf8")}/`), nameFF]),
|
|
286
|
+
"v1\n",
|
|
287
|
+
);
|
|
288
|
+
f.write(
|
|
289
|
+
"docs/correctness.yaml",
|
|
290
|
+
manifestYaml({}).replace("support: []", 'support: ["nonutf8/**"]'),
|
|
291
|
+
);
|
|
292
|
+
const base = amendBase(f);
|
|
293
|
+
const r = await gate(f, { base });
|
|
294
|
+
expect(r.status).toBe("fail");
|
|
295
|
+
expect(msgs(r).some((m) => m.includes("non-UTF-8 path") || m.includes("a git read failed"))).toBe(
|
|
296
|
+
true,
|
|
297
|
+
);
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it("documented degraded path: run-only OriginGit (no runExit) keeps the U+FFFD heuristic", async () => {
|
|
301
|
+
const f = fx();
|
|
302
|
+
f.write("nonutf8b/scr�.sh", "v1\n");
|
|
303
|
+
f.commit("add legal U+FFFD file");
|
|
304
|
+
const repo = new GateRepo(f.root);
|
|
305
|
+
delete (repo.git as { runExit?: unknown }).runExit;
|
|
306
|
+
const out = await repo.listing(["ls-tree", "-r", "-z", "--name-only", "HEAD"], "ls-tree HEAD");
|
|
307
|
+
expect(out).not.toBeNull();
|
|
308
|
+
// The decoded-string fallback flags a legal U+FFFD name — documented stub-port
|
|
309
|
+
// degradation (production createOriginGit always provides runExit + bytes).
|
|
310
|
+
expect(repo.unreadableReads.some((r) => r.includes("non-UTF-8"))).toBe(true);
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// ===========================================================================
|
|
315
|
+
// NEW counterexample hunts
|
|
316
|
+
// ===========================================================================
|
|
317
|
+
|
|
318
|
+
describe("multi-carrier edge residuals", () => {
|
|
319
|
+
const twoCarrier = () =>
|
|
320
|
+
fx({
|
|
321
|
+
extraFiles: {
|
|
322
|
+
"apps/api/src/helper.ts": `${anchorComment()}export function helper(): void {}\n`,
|
|
323
|
+
},
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it("anchor moved to a NEW non-carrier file while all old carriers touched → no weakening", async () => {
|
|
327
|
+
const f = twoCarrier();
|
|
328
|
+
// Both old carriers drop the marker; a brand-new file carries it verbatim.
|
|
329
|
+
f.write("apps/api/src/dispatch.ts", "export function dispatch(): void {}\n");
|
|
330
|
+
f.write("apps/api/src/helper.ts", "export function helper(): void {}\n");
|
|
331
|
+
f.write("apps/api/src/newhome.ts", `${anchorComment()}export function moved(): void {}\n`);
|
|
332
|
+
f.commit("move anchor to a new file, drop old copies");
|
|
333
|
+
const r = await gate(f);
|
|
334
|
+
expect(
|
|
335
|
+
r.weakenings.filter((w) => w.kind.startsWith("anchor-")),
|
|
336
|
+
"the anchor exists verbatim at HEAD (moved, not removed)",
|
|
337
|
+
).toEqual([]);
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
it("a NEW divergent copy added while the original carrier is untouched → anchor-reworded", async () => {
|
|
341
|
+
const f = fx();
|
|
342
|
+
// dispatch.ts (carrier) stays untouched; a changed file adds a divergent copy.
|
|
343
|
+
f.write(
|
|
344
|
+
"apps/api/src/extra.ts",
|
|
345
|
+
`${anchorComment("a divergent statement never seen at base")}export function e(): void {}\n`,
|
|
346
|
+
);
|
|
347
|
+
f.commit("add divergent copy in a new file");
|
|
348
|
+
const r = await gate(f);
|
|
349
|
+
// The contract: every changed copy must carry a base sha — a divergent addition weakens the id's statement set.
|
|
350
|
+
expect(r.weakenings.some((w) => w.kind === "anchor-reworded")).toBe(true);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it("cross-copy sha borrowing: rewording copy A to copy B's recorded sha is consistent (anchor survives verbatim)", async () => {
|
|
354
|
+
// Divergent base copies: aaaa.ts carries B, dispatch.ts carries A.
|
|
355
|
+
const f = fx({
|
|
356
|
+
extraFiles: {
|
|
357
|
+
"apps/api/src/aaaa.ts": `${anchorComment("a different but base-frozen statement text")}export function a(): void {}\n`,
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
// Reword the aaaa.ts copy from B to A — the id still exists verbatim (A) in dispatch.ts.
|
|
361
|
+
// Under the CX-68 rule dropping B's copy ENTIRELY is already legal (anchor survives);
|
|
362
|
+
// converging it to A is strictly less destructive, so no weakening is the consistent verdict.
|
|
363
|
+
f.write(
|
|
364
|
+
"apps/api/src/aaaa.ts",
|
|
365
|
+
`${anchorComment()}export function a(): void {}\n`,
|
|
366
|
+
);
|
|
367
|
+
f.commit("converge divergent copy onto the other recorded sha");
|
|
368
|
+
const r = await gate(f);
|
|
369
|
+
expect(r.weakenings.filter((w) => w.kind.startsWith("anchor-"))).toEqual([]);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
it("a bound-but-absent anchor at base appearing at head → no anchor weakening (nothing was frozen)", async () => {
|
|
373
|
+
const f = fx();
|
|
374
|
+
f.write(
|
|
375
|
+
"docs/correctness.yaml",
|
|
376
|
+
manifestYaml({}).replace("INV-dispatch-01", "INV-ghost-99"),
|
|
377
|
+
);
|
|
378
|
+
f.write("apps/api/src/dispatch.ts", "export function dispatch(): void {\n // no markers\n}\n");
|
|
379
|
+
const base = amendBase(f);
|
|
380
|
+
// HEAD: the ghost anchor now EXISTS.
|
|
381
|
+
f.write("apps/api/src/dispatch.ts", `${anchorComment().replace("INV-dispatch-01", "INV-ghost-99")}export function dispatch(): void {}\n`);
|
|
382
|
+
f.commit("add the previously-absent anchor");
|
|
383
|
+
const r = await gate(f, { base });
|
|
384
|
+
expect(r.weakenings.filter((w) => w.kind.startsWith("anchor-"))).toEqual([]);
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
describe("accept-path + late-flag ordering", () => {
|
|
389
|
+
it("acceptedWeakening granted, then origin-derivation read flags → fail + honest bundle", async () => {
|
|
390
|
+
// A proof: spec file (.yaml — not an anchor-source candidate) is shown ONLY
|
|
391
|
+
// inside deriveOrigin — AFTER the accept check. Corrupt its HEAD blob: no
|
|
392
|
+
// pre-accept read touches its content (blob/mode reads resolve shas only).
|
|
393
|
+
const f = fx({
|
|
394
|
+
oracle: L1_ORACLE,
|
|
395
|
+
extraFiles: { "specs/inv.spec.yaml": "kind: proof\nentry: apps/api/src/dispatch.ts\n" },
|
|
396
|
+
});
|
|
397
|
+
f.write(
|
|
398
|
+
"docs/correctness.yaml",
|
|
399
|
+
`schema: forge/correctness-manifest@1
|
|
400
|
+
entries:
|
|
401
|
+
- id: CM-dispatch-01
|
|
402
|
+
source: req
|
|
403
|
+
ref: REQ-01
|
|
404
|
+
seam: data
|
|
405
|
+
anchors: [INV-dispatch-01]
|
|
406
|
+
oracles:
|
|
407
|
+
- check: proof:specs/inv.spec.yaml
|
|
408
|
+
substrate: L1
|
|
409
|
+
support: []
|
|
410
|
+
exemptions: []
|
|
411
|
+
`,
|
|
412
|
+
);
|
|
413
|
+
// The anchor's checked-by must name the proof oracle (CORR-05).
|
|
414
|
+
f.write(
|
|
415
|
+
"apps/api/src/dispatch.ts",
|
|
416
|
+
`export function dispatch(): void {\n // ${MARK}[INV-dispatch-01]: ${STMT}\n // (checked-by: proof:specs/inv.spec.yaml)\n}\n`,
|
|
417
|
+
);
|
|
418
|
+
const base = amendBase(f);
|
|
419
|
+
f.write("specs/inv.spec.yaml", "kind: proof\nentry: apps/api/src/dispatch.ts\n# edited\n");
|
|
420
|
+
f.commit("edit the proof spec (frozen file)");
|
|
421
|
+
corruptBlob(f, "HEAD:specs/inv.spec.yaml");
|
|
422
|
+
const out = await run(f, { base, acceptWeakening: "operator reviewed" });
|
|
423
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
424
|
+
// The accept was honestly granted on a complete picture; the LATE read failure flips status to fail.
|
|
425
|
+
expect(out.result.status).toBe("fail");
|
|
426
|
+
expect(msgs(out.result).some((m) => m.includes("a git read failed"))).toBe(true);
|
|
427
|
+
const bundle = out.bundle;
|
|
428
|
+
expect((bundle.unreadableReads ?? []).length).toBeGreaterThan(0);
|
|
429
|
+
// The recorded accept must remain visible — the bundle is honest about what was accepted.
|
|
430
|
+
expect(out.result.acceptedWeakening).toBe("operator reviewed");
|
|
431
|
+
expect(bundle.weakenings.some((w) => w.accepted)).toBe(true);
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
it("early + late flags dedup to ONE 'a git read failed' violation; bundle lists all", async () => {
|
|
435
|
+
const f = fx();
|
|
436
|
+
f.write(ORACLE_PATH, "// weakened\n");
|
|
437
|
+
f.commit("weaken oracle");
|
|
438
|
+
// Early flag: corrupt base test/ tree → files(base) fails inside readFrozenSet.
|
|
439
|
+
corruptBlob(f, `${f.base}:test`);
|
|
440
|
+
// Late flag: corrupt HEAD review-record blob → read in readReviewRecords.
|
|
441
|
+
const rel = "docs/correctness/reviews/2026-11-13-base.yaml";
|
|
442
|
+
corruptBlob(f, `HEAD:${rel}`);
|
|
443
|
+
const out = await run(f);
|
|
444
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
445
|
+
const gitReadViolations = out.result.violations.filter((v) =>
|
|
446
|
+
v.message.includes("a git read failed"),
|
|
447
|
+
);
|
|
448
|
+
expect(gitReadViolations.length).toBe(1);
|
|
449
|
+
expect((out.bundle.unreadableReads ?? []).length).toBeGreaterThanOrEqual(2);
|
|
450
|
+
expect(out.result.status).toBe("fail");
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
describe("history-read flagging beyond lastCommitBody", () => {
|
|
455
|
+
it("a corrupt tree reachable only by the -G range walk denies requirement origin — must surface 'a git read failed'", async () => {
|
|
456
|
+
// Custom history: C1 draft rfc + files → C2 accept → C3 add rfc-0002 (unique docs/rfcs tree)
|
|
457
|
+
// → C4 remove rfc-0002 (=base) → C5 unrelated. Corrupt C3's docs/rfcs tree: only the
|
|
458
|
+
// --follow -G walk over docs/rfcs hits it; log -1 -- checkfile, ls-tree, diff all pass.
|
|
459
|
+
const root = mkdtempSync(path.join(os.tmpdir(), "forge-gate-req-"));
|
|
460
|
+
const git = (a: string[]) =>
|
|
461
|
+
execFileSync("git", a, { cwd: root, encoding: "utf8" }).trim();
|
|
462
|
+
const write = (rel: string, body: string) => {
|
|
463
|
+
mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
|
|
464
|
+
writeFileSync(path.join(root, rel), body);
|
|
465
|
+
};
|
|
466
|
+
const build = () => {
|
|
467
|
+
git(["init", "-q", "-b", "develop"]);
|
|
468
|
+
git(["config", "user.email", "t@t.t"]);
|
|
469
|
+
git(["config", "user.name", "t"]);
|
|
470
|
+
write(
|
|
471
|
+
"forge.yaml",
|
|
472
|
+
`schema: forge/config@1
|
|
473
|
+
project:
|
|
474
|
+
name: req-fixture
|
|
475
|
+
paths: {}
|
|
476
|
+
bindings:
|
|
477
|
+
schema: forge/bindings@1
|
|
478
|
+
commands:
|
|
479
|
+
checkRun: "node {file}"
|
|
480
|
+
paths:
|
|
481
|
+
compassDocs: [docs/requirements.xml]
|
|
482
|
+
correctnessManifest: docs/correctness.yaml
|
|
483
|
+
correctness:
|
|
484
|
+
mode: enforce
|
|
485
|
+
tier: standard
|
|
486
|
+
`,
|
|
487
|
+
);
|
|
488
|
+
write(
|
|
489
|
+
"docs/requirements.xml",
|
|
490
|
+
'<requirements>\n <meta><document-id>requirements</document-id></meta>\n <requirement id="REQ-01">x</requirement>\n</requirements>\n',
|
|
491
|
+
);
|
|
492
|
+
write(
|
|
493
|
+
"docs/rfcs/rfc-0001-foo.md",
|
|
494
|
+
`---
|
|
495
|
+
status: draft
|
|
496
|
+
---
|
|
497
|
+
# RFC-0001 Foo
|
|
498
|
+
|
|
499
|
+
## Acceptance criteria
|
|
500
|
+
|
|
501
|
+
- [x] AC-1: the check holds
|
|
502
|
+
`,
|
|
503
|
+
);
|
|
504
|
+
write(
|
|
505
|
+
"apps/api/src/dispatch.ts",
|
|
506
|
+
`export function dispatch(): void {\n // ${MARK}[INV-dispatch-01]: ${STMT}\n // (checked-by: test:test/check.ts)\n}\n`,
|
|
507
|
+
);
|
|
508
|
+
write("test/check.ts", "export const probe = 1;\n");
|
|
509
|
+
write("apps/x.txt", "x1\n");
|
|
510
|
+
write(
|
|
511
|
+
"docs/correctness.yaml",
|
|
512
|
+
`schema: forge/correctness-manifest@1
|
|
513
|
+
entries:
|
|
514
|
+
- id: CM-dispatch-01
|
|
515
|
+
source: rfc-ac
|
|
516
|
+
ref: RFC-0001/AC-1
|
|
517
|
+
seam: data
|
|
518
|
+
anchors: [INV-dispatch-01]
|
|
519
|
+
oracles:
|
|
520
|
+
- check: test:test/check.ts
|
|
521
|
+
substrate: L1
|
|
522
|
+
support: []
|
|
523
|
+
exemptions: []
|
|
524
|
+
`,
|
|
525
|
+
);
|
|
526
|
+
git(["add", "-A"]);
|
|
527
|
+
git(["commit", "-qm", "c1 draft rfc + files"]);
|
|
528
|
+
write(
|
|
529
|
+
"docs/rfcs/rfc-0001-foo.md",
|
|
530
|
+
readFileSync(path.join(root, "docs/rfcs/rfc-0001-foo.md"), "utf8").replace(
|
|
531
|
+
"status: draft",
|
|
532
|
+
"status: accepted",
|
|
533
|
+
),
|
|
534
|
+
);
|
|
535
|
+
// CX-79: governed provenance on the acceptance transition.
|
|
536
|
+
git(["commit", "-qam", "c2 accept rfc\n\nX-RFC: RFC-0001"]);
|
|
537
|
+
write("docs/rfcs/rfc-0002-tmp.md", "tmp\n");
|
|
538
|
+
git(["add", "-A"]);
|
|
539
|
+
git(["commit", "-qm", "c3 add rfc-0002 (unique docs/rfcs tree)"]);
|
|
540
|
+
git(["rm", "-q", "docs/rfcs/rfc-0002-tmp.md"]);
|
|
541
|
+
git(["commit", "-qm", "c4 remove rfc-0002"]);
|
|
542
|
+
const base = git(["rev-parse", "HEAD"]);
|
|
543
|
+
write("apps/x.txt", "x2\n");
|
|
544
|
+
git(["commit", "-qam", "c5 unrelated"]);
|
|
545
|
+
return base;
|
|
546
|
+
};
|
|
547
|
+
const base = build();
|
|
548
|
+
try {
|
|
549
|
+
// Control: uncorrupted — the -G range resolves and the oracle derives requirement origin.
|
|
550
|
+
const clean = await runCorrectnessGate(root, { base, bundleDir: `${root}/.bundles` });
|
|
551
|
+
if (!clean.ok) throw new Error(clean.usageError);
|
|
552
|
+
expect(
|
|
553
|
+
clean.bundle.entries[0]?.oracles[0]?.origin,
|
|
554
|
+
"control: without the corrupt tree the oracle derives requirement origin",
|
|
555
|
+
).toBe("requirement");
|
|
556
|
+
|
|
557
|
+
// Corrupt C3's docs/rfcs tree — reachable only from the -G walk of the rfc path.
|
|
558
|
+
const t = git(["rev-parse", "HEAD~2:docs/rfcs"]);
|
|
559
|
+
const obj = path.join(root, ".git", "objects", t.slice(0, 2), t.slice(2));
|
|
560
|
+
chmodSync(obj, 0o644);
|
|
561
|
+
writeFileSync(obj, "corrupt-tree-not-zlib");
|
|
562
|
+
const out = await runCorrectnessGate(root, {
|
|
563
|
+
base,
|
|
564
|
+
bundleDir: `${root}/.bundles2`,
|
|
565
|
+
});
|
|
566
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
567
|
+
// Expected: the failed -G log read is surfaced — a silent map to null denies
|
|
568
|
+
// requirement origin AND invisibly mis-attributes the verdict to "self".
|
|
569
|
+
expect(
|
|
570
|
+
msgs(out.result).some((m) => m.includes("a git read failed")),
|
|
571
|
+
`violations: ${JSON.stringify(msgs(out.result))}`,
|
|
572
|
+
).toBe(true);
|
|
573
|
+
} finally {
|
|
574
|
+
rmSync(root, { recursive: true, force: true });
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
describe("frozen-glob path-type edges", () => {
|
|
580
|
+
it("a directory→file flip inside a frozen support glob reports ONE weakening, not two", async () => {
|
|
581
|
+
const f = fx();
|
|
582
|
+
// Base: directory `scripts/tool/` with a file — support glob `scripts/tool` matches nothing yet.
|
|
583
|
+
f.write("scripts/tool/inner.sh", "echo hi\n");
|
|
584
|
+
f.write(
|
|
585
|
+
"docs/correctness.yaml",
|
|
586
|
+
manifestYaml({}).replace("support: []", 'support: ["scripts/tool"]'),
|
|
587
|
+
);
|
|
588
|
+
const base = amendBase(f);
|
|
589
|
+
// HEAD: dir replaced by a FILE at the glob-matched path.
|
|
590
|
+
f.git(["rm", "-q", "scripts/tool/inner.sh"]);
|
|
591
|
+
f.write("scripts/tool", "#!/bin/sh\necho tool\n");
|
|
592
|
+
f.commit("dir to file at glob path");
|
|
593
|
+
const r = await gate(f, { base });
|
|
594
|
+
const forPath = r.weakenings.filter((w) => w.subject === "scripts/tool");
|
|
595
|
+
expect(
|
|
596
|
+
forPath.length,
|
|
597
|
+
`expected exactly one weakening for scripts/tool, got ${JSON.stringify(forPath)}`,
|
|
598
|
+
).toBe(1);
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
it("a file→directory flip at a frozen glob path reports ONE weakening (the file is gone)", async () => {
|
|
602
|
+
const f = fx();
|
|
603
|
+
// Base: a real FILE at the glob path → frozen by the glob.
|
|
604
|
+
f.write("scripts/tool", "#!/bin/sh\necho tool\n");
|
|
605
|
+
f.write(
|
|
606
|
+
"docs/correctness.yaml",
|
|
607
|
+
manifestYaml({}).replace("support: []", 'support: ["scripts/tool"]'),
|
|
608
|
+
);
|
|
609
|
+
const base = amendBase(f);
|
|
610
|
+
// HEAD: the file is replaced by a directory.
|
|
611
|
+
f.git(["rm", "-q", "scripts/tool"]);
|
|
612
|
+
f.write("scripts/tool/inner.sh", "echo hi\n");
|
|
613
|
+
f.commit("file to dir at glob path");
|
|
614
|
+
const r = await gate(f, { base });
|
|
615
|
+
const forPath = r.weakenings.filter((w) => w.subject === "scripts/tool");
|
|
616
|
+
expect(
|
|
617
|
+
forPath.length,
|
|
618
|
+
`expected exactly one weakening for scripts/tool, got ${JSON.stringify(forPath)}`,
|
|
619
|
+
).toBe(1);
|
|
620
|
+
});
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
describe("linked worktree (.git FILE)", () => {
|
|
624
|
+
it("gate in a linked worktree: commonDir resolves to main .git; bundle written, no crash", async () => {
|
|
625
|
+
const f = fx();
|
|
626
|
+
const wt = `${f.root}-wt`;
|
|
627
|
+
f.git(["worktree", "add", wt, "-b", "gate-wt"]);
|
|
628
|
+
try {
|
|
629
|
+
const out = await runCorrectnessGate(wt, { base: f.base });
|
|
630
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
631
|
+
// .git is a FILE here — the bundle must land under the real common dir, never crash ENOTDIR.
|
|
632
|
+
expect(existsSync(out.result.bundlePath)).toBe(true);
|
|
633
|
+
expect(out.result.bundlePath).toContain(path.join(".git", "forge", "gate-reports"));
|
|
634
|
+
} finally {
|
|
635
|
+
f.git(["worktree", "remove", "--force", wt]);
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
describe("path/object-type conflations", () => {
|
|
641
|
+
it("manifest binding pointing at a DIRECTORY → judged, no crash", async () => {
|
|
642
|
+
const f = fx();
|
|
643
|
+
f.write(
|
|
644
|
+
"forge.yaml",
|
|
645
|
+
f.read("forge.yaml").replace("docs/correctness.yaml", "docs"),
|
|
646
|
+
);
|
|
647
|
+
f.commit("manifest binding to a dir");
|
|
648
|
+
const r = await gate(f);
|
|
649
|
+
expect(r.status).toBe("fail");
|
|
650
|
+
expect(r.weakenings.some((w) => w.kind === "binding" || w.kind === "entry-deleted")).toBe(true);
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
it("forge.yaml as a symlink at HEAD → forgeYamlUnreadable refuse, no crash", async () => {
|
|
654
|
+
const f = fx();
|
|
655
|
+
f.git(["rm", "-q", "forge.yaml"]);
|
|
656
|
+
symlinkSync("apps/api/src/dispatch.ts", path.join(f.root, "forge.yaml"));
|
|
657
|
+
f.commit("forge.yaml to symlink");
|
|
658
|
+
const r = await gate(f);
|
|
659
|
+
expect(r.status).toBe("fail");
|
|
660
|
+
expect(msgs(r).some((m) => m.includes("forge.yaml"))).toBe(true);
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
it("a corrupt HEAD carrier blob must NOT fabricate anchor-removed — only the read flag", async () => {
|
|
664
|
+
const f = fx();
|
|
665
|
+
// Touch the carrier cosmetically, commit, then corrupt its HEAD blob:
|
|
666
|
+
// show() fails while the tree entry resolves — the copy cannot be READ,
|
|
667
|
+
// which is not the same as the marker being gone.
|
|
668
|
+
f.write(
|
|
669
|
+
"apps/api/src/dispatch.ts",
|
|
670
|
+
`${anchorComment()}export function dispatch(): void {\n // cosmetic\n}\n`,
|
|
671
|
+
);
|
|
672
|
+
f.commit("touch the carrier");
|
|
673
|
+
corruptBlob(f, "HEAD:apps/api/src/dispatch.ts");
|
|
674
|
+
const out = await run(f);
|
|
675
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
676
|
+
expect(out.result.status).toBe("fail");
|
|
677
|
+
expect(msgs(out.result).some((m) => m.includes("a git read failed"))).toBe(true);
|
|
678
|
+
expect(
|
|
679
|
+
out.result.weakenings.some((w) => w.kind === "anchor-removed"),
|
|
680
|
+
"an unreadable copy is not a removed anchor — 'removed' is a claim the failed read cannot support",
|
|
681
|
+
).toBe(false);
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
it("forge.yaml as a gitlink → fail closed, no crash", async () => {
|
|
685
|
+
const f = fx();
|
|
686
|
+
// Plant a gitlink at forge.yaml (simulated submodule pointer).
|
|
687
|
+
f.git(["rm", "-q", "forge.yaml"]);
|
|
688
|
+
const fakeSubSha = f.git(["rev-parse", "HEAD"]);
|
|
689
|
+
f.git(["update-index", "--add", "--cacheinfo", `160000,${fakeSubSha},forge.yaml`]);
|
|
690
|
+
f.commit("forge.yaml to gitlink");
|
|
691
|
+
const r = await gate(f);
|
|
692
|
+
expect(r.status).toBe("fail");
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
describe("read-flag labels", () => {
|
|
697
|
+
it("a failed git log records 'log <rel>' in unreadableReads", async () => {
|
|
698
|
+
const f = fx();
|
|
699
|
+
f.write(ORACLE_PATH, "// verifier-amended oracle v2\n" + L1_ORACLE);
|
|
700
|
+
verifierCommit(f.git, "docs/correctness/reviews/2026-11-14-v2.yaml");
|
|
701
|
+
f.write("test/other.ts", "export const y = 1;\n");
|
|
702
|
+
f.commit("unrelated test dir change");
|
|
703
|
+
f.write("test/another.ts", "export const z = 1;\n");
|
|
704
|
+
f.commit("second unrelated test dir change");
|
|
705
|
+
const c3 = f.git(["rev-parse", "HEAD~1"]);
|
|
706
|
+
corruptBlob(f, `${c3}:test`);
|
|
707
|
+
const out = await run(f);
|
|
708
|
+
if (!out.ok) throw new Error(out.usageError);
|
|
709
|
+
const reads = out.bundle.unreadableReads ?? [];
|
|
710
|
+
expect(reads.some((r) => r.startsWith("log ") && r.includes(ORACLE_PATH))).toBe(true);
|
|
711
|
+
});
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
// ---------------------------------------------------------------------------
|
|
715
|
+
// Baseline sanity
|
|
716
|
+
// ---------------------------------------------------------------------------
|
|
717
|
+
|
|
718
|
+
describe("baseline sanity", () => {
|
|
719
|
+
it("frozen oracle edit without verifier trailers refuses CORR-GATE-02", async () => {
|
|
720
|
+
const f = fx();
|
|
721
|
+
f.write(ORACLE_PATH, "// weakened oracle\n");
|
|
722
|
+
f.commit("weaken oracle");
|
|
723
|
+
const r = await gate(f);
|
|
724
|
+
expect(r.status).toBe("fail");
|
|
725
|
+
expect(msgs(r).some((m) => m.includes("CORR-GATE-02"))).toBe(true);
|
|
726
|
+
});
|
|
727
|
+
|
|
728
|
+
it("healthy run with bundleDir set emits no new commonDir flag", async () => {
|
|
729
|
+
const f = fx();
|
|
730
|
+
const r = await gate(f);
|
|
731
|
+
expect(r.status).toBe("pass");
|
|
732
|
+
expect(msgs(r).every((m) => !m.includes("git-common-dir"))).toBe(true);
|
|
733
|
+
});
|
|
734
|
+
});
|