@warpgogol/forge 9.6.3 → 9.7.1
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 +59 -0
- package/README.md +12 -0
- 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/archive.d.ts.map +1 -1
- package/dist/os/adr/handlers/archive.js +3 -7
- package/dist/os/adr/handlers/archive.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +55 -19
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
- package/dist/os/adr/handlers/list-create.js +8 -6
- package/dist/os/adr/handlers/list-create.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/audit/handlers/archive.d.ts.map +1 -1
- package/dist/os/audit/handlers/archive.js +3 -7
- package/dist/os/audit/handlers/archive.js.map +1 -1
- 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 +56 -4
- package/dist/os/core/archive-regen.d.ts.map +1 -1
- package/dist/os/core/archive-regen.js +173 -15
- 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 +187 -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/pinned-check.d.ts +13 -0
- package/dist/os/core/handlers/pinned-check.d.ts.map +1 -1
- package/dist/os/core/handlers/pinned-check.js +25 -0
- package/dist/os/core/handlers/pinned-check.js.map +1 -1
- package/dist/os/core/handlers/pinned-types.d.ts +7 -0
- package/dist/os/core/handlers/pinned-types.d.ts.map +1 -1
- package/dist/os/core/handlers/pinned-validate.d.ts.map +1 -1
- package/dist/os/core/handlers/pinned-validate.js +24 -1
- package/dist/os/core/handlers/pinned-validate.js.map +1 -1
- 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 +98 -9
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +802 -185
- 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/evidence-lock.d.ts +36 -0
- package/dist/os/flow/evidence-lock.d.ts.map +1 -0
- package/dist/os/flow/evidence-lock.js +156 -0
- package/dist/os/flow/evidence-lock.js.map +1 -0
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +155 -19
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/git.d.ts +124 -11
- package/dist/os/flow/git.d.ts.map +1 -1
- package/dist/os/flow/git.js +793 -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 +5 -6
- 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 +91 -2
- package/dist/os/flow/handlers/flow-push.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-push.js +806 -52
- 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 +15 -0
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +20 -7
- 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 +87 -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 +21 -9
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +16 -9
- 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 +160 -31
- 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 +189 -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 +354 -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 +72 -0
- package/dist/os/friction/store.d.ts.map +1 -0
- package/dist/os/friction/store.js +251 -0
- package/dist/os/friction/store.js.map +1 -0
- package/dist/os/friction/types.d.ts +13 -1
- package/dist/os/friction/types.d.ts.map +1 -1
- package/dist/os/friction/types.js +19 -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 +376 -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/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +3 -7
- package/dist/os/mission/handlers/archive.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/plan/handlers/archive.d.ts.map +1 -1
- package/dist/os/plan/handlers/archive.js +3 -7
- package/dist/os/plan/handlers/archive.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/archive.d.ts.map +1 -1
- package/dist/os/rfc/handlers/archive.js +3 -7
- package/dist/os/rfc/handlers/archive.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/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +15 -7
- package/dist/os/rfc/handlers/list-create.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/archive.d.ts.map +1 -1
- package/dist/os/session/handlers/archive.js +3 -7
- package/dist/os/session/handlers/archive.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-product-register.d.ts +24 -0
- package/dist/os/system/handlers/system-product-register.d.ts.map +1 -0
- package/dist/os/system/handlers/system-product-register.js +322 -0
- package/dist/os/system/handlers/system-product-register.js.map +1 -0
- package/dist/os/system/handlers/system-products-status.d.ts +23 -0
- package/dist/os/system/handlers/system-products-status.d.ts.map +1 -0
- package/dist/os/system/handlers/system-products-status.js +235 -0
- package/dist/os/system/handlers/system-products-status.js.map +1 -0
- 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/schemas.d.ts +13 -0
- package/dist/os/system/schemas.d.ts.map +1 -1
- package/dist/os/system/schemas.js +15 -0
- package/dist/os/system/schemas.js.map +1 -1
- package/dist/os/system/system.module.d.ts.map +1 -1
- package/dist/os/system/system.module.js +126 -11
- 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 +67 -1
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +116 -13
- 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/onboarding/create.d.ts.map +1 -1
- package/dist/src/onboarding/create.js +27 -2
- package/dist/src/onboarding/create.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/profiles/stack-profile.js +2 -2
- package/dist/src/types.d.ts +6 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +4 -4
- package/dist/src/utils/verifier-git.d.ts +1329 -0
- package/dist/src/utils/verifier-git.d.ts.map +1 -0
- package/dist/src/utils/verifier-git.js +7827 -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/maintainers/publishing.md +1 -1
- package/docs/reference/correctness-gate.md +35 -5
- package/docs/reference/forge-yaml.md +16 -0
- package/docs/reference/system-hub.md +104 -0
- package/docs/reference/trust-boundary.md +36 -0
- package/os/adr/handlers/archive.ts +3 -11
- package/os/adr/handlers/implement-stamp.ts +56 -26
- package/os/adr/handlers/list-create.test.ts +174 -0
- package/os/adr/handlers/list-create.ts +16 -8
- 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/audit/handlers/archive.ts +3 -11
- 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 +209 -18
- package/os/core/core.module.ts +215 -51
- package/os/core/docs-archive.test.ts +159 -37
- package/os/core/handlers/forge-autonomy-validate.ts +104 -2
- package/os/core/handlers/package-health.ts +6 -6
- package/os/core/handlers/pinned-check.ts +30 -0
- package/os/core/handlers/pinned-types.ts +7 -0
- package/os/core/handlers/pinned-validate.ts +28 -3
- 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 +962 -201
- package/os/flow/dup-id-scan.ts +187 -0
- package/os/flow/evidence-lock.ts +184 -0
- package/os/flow/flow.module.ts +162 -19
- package/os/flow/git.ts +952 -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 +14 -9
- 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 +925 -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 +44 -16
- 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 +110 -17
- package/os/flow/primary-dirt.ts +319 -0
- package/os/flow/publish.ts +35 -17
- package/os/flow/registry.ts +29 -15
- 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/digest-id-inputs.test.ts +106 -0
- package/os/flow/tests/digest-persist.test.ts +243 -0
- package/os/flow/tests/evidence-preflight-surface-skip.test.ts +218 -0
- 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-attest.test.ts +137 -0
- package/os/flow/tests/flow-push-publish.test.ts +45 -19
- package/os/flow/tests/flow-push-review-baseline.test.ts +339 -0
- package/os/flow/tests/flow-push-supersede.test.ts +37 -34
- package/os/flow/tests/flow-push-verifier-batch.test.ts +134 -0
- 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 +183 -0
- package/os/friction/friction-migrate.test.ts +203 -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 +169 -31
- package/os/friction/handlers/friction-add.ts +263 -0
- package/os/friction/handlers/friction-migrate.ts +425 -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 +303 -0
- package/os/friction/types.ts +19 -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 +445 -42
- package/os/gate/handlers/gate-probe-ratchet.test.ts +364 -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/handlers/archive.ts +3 -11
- 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/plan/handlers/archive.ts +3 -11
- 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/archive.ts +3 -11
- 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/list-create.ts +22 -17
- 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/archive.ts +3 -11
- 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-product-register.ts +492 -0
- package/os/system/handlers/system-products-status.ts +395 -0
- 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/schemas.ts +17 -0
- package/os/system/system.module.ts +130 -11
- 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-product-register.test.ts +304 -0
- package/os/system/tests/system-products-status.test.ts +154 -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 +30 -1
- package/profiles/godot-game.yaml +4 -4
- package/profiles/root-agents-system.md +82 -0
- package/profiles/system.yaml +1 -0
- 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/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 +151 -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/onboarding/create-superfolder-guard.test.ts +73 -0
- package/src/onboarding/create.ts +28 -2
- 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/profiles/stack-profile.ts +2 -2
- 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/evidence-consult-serialization.test.ts +202 -0
- package/src/tests/forge-config.test.ts +5 -2
- package/src/tests/knowledge-paths.test.ts +80 -0
- package/src/tests/pinned-validate.test.ts +194 -0
- package/src/tests/profile-flow-hooks.test.ts +1 -0
- package/src/tests/profile-schema.test.ts +1 -0
- package/src/tests/skill-validate.test.ts +76 -0
- package/src/tests/stack-profile.test.ts +1 -0
- package/src/types.ts +11 -6
- package/src/utils/verifier-git.ts +8732 -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,755 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1616 acceptance probes — independent round-10 adversarial verification of
|
|
5
|
+
the external-verification trust boundary. Every probe FAILS while its
|
|
6
|
+
counterexample is live and PASSES once closed; numbering continues from
|
|
7
|
+
CX-122 (round 9 reported CX-113..CX-122 + six holds).
|
|
8
|
+
|
|
9
|
+
Round-10 attack surfaces (assumptions the r9 remediation left open):
|
|
10
|
+
- The `core.hooksPath` pin target (`evidenceHooksDir`) was a mkdtemp dir
|
|
11
|
+
created ONCE per process and reused for the process lifetime — a
|
|
12
|
+
concurrent session (same uid, the boundary's own threat model) could
|
|
13
|
+
discover it by polling the OS temp dir AFTER creation and plant an
|
|
14
|
+
executable hook file into it at leisure (CX-123). CLOSED: the pin now
|
|
15
|
+
aims at the null device — no verifier hooks dir exists, a char device
|
|
16
|
+
has no plantable entries, and the ENOTDIR hook stat skips every hook.
|
|
17
|
+
- `prepareEvidenceIndex` returned `{}` (no `GIT_INDEX_FILE`) whenever its
|
|
18
|
+
`update-index --index-info` rebuild failed — routing index-consulting
|
|
19
|
+
reads at the AMBIENT session index, which can be a perfectly valid
|
|
20
|
+
CX-121 forged-stat index answering CLEAN on dirty bytes (CX-124).
|
|
21
|
+
CLOSED: a failed enumeration/rebuild is now a preflight shape
|
|
22
|
+
violation — every index-consulting trusted read refuses outright
|
|
23
|
+
(EVIDENCE-REFUSED / null) instead of consulting the ambient index.
|
|
24
|
+
- The pack-integrity memo is keyed on the `.idx` stat triple only — the
|
|
25
|
+
`.pack` sibling is never stat'd. A `.pack` rewrite after an honest
|
|
26
|
+
`verify-pack -s` would be invisible to the memo, BUT git itself binds
|
|
27
|
+
the pair: the idx trailer records the pack's sha1 and every object
|
|
28
|
+
read refuses a pack whose trailer does not match ("packfile does not
|
|
29
|
+
match index"). The TOCTOU is defended by git, not by the memo —
|
|
30
|
+
recorded as a control (R10-R2), not a counterexample.
|
|
31
|
+
- Freshly forged pack+idx pairs still refuse (verify-pack -s validates
|
|
32
|
+
object names — R10-R1), the argv table still refuses abbreviated
|
|
33
|
+
forbidden flags and the ext transport, the heredoc lexer stays
|
|
34
|
+
quote-aware, and ambient GIT_* (including GIT_CONFIG_* injection)
|
|
35
|
+
stays stripped — all re-verified as controls.
|
|
36
|
+
</purpose>
|
|
37
|
+
<non-goals>
|
|
38
|
+
<item>Not a contract source of truth — the boundary implementation owns behaviour.</item>
|
|
39
|
+
<item>Windows-only path shapes (exportTree backslash traversal), post-export
|
|
40
|
+
mutation of the review export by a concurrent session, and remote-side
|
|
41
|
+
config on the operator's real remote — noted, not probed.</item>
|
|
42
|
+
</non-goals>
|
|
43
|
+
</MODULE_CONTRACT>
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
import { execFileSync, spawn } from "node:child_process";
|
|
47
|
+
import net from "node:net";
|
|
48
|
+
import {
|
|
49
|
+
chmodSync,
|
|
50
|
+
existsSync,
|
|
51
|
+
mkdirSync,
|
|
52
|
+
mkdtempSync,
|
|
53
|
+
readdirSync,
|
|
54
|
+
readFileSync,
|
|
55
|
+
rmSync,
|
|
56
|
+
statSync,
|
|
57
|
+
utimesSync,
|
|
58
|
+
writeFileSync,
|
|
59
|
+
} from "node:fs";
|
|
60
|
+
import { createHash } from "node:crypto";
|
|
61
|
+
import { deflateSync } from "node:zlib";
|
|
62
|
+
import os from "node:os";
|
|
63
|
+
import path from "node:path";
|
|
64
|
+
|
|
65
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
66
|
+
|
|
67
|
+
import { ambientIo } from "../../../src/utils/io.ts";
|
|
68
|
+
import { scaffoldTrustBoundary } from "../../../src/onboarding/trust-boundary.ts";
|
|
69
|
+
import { verifierGit } from "../../../src/utils/verifier-git.ts";
|
|
70
|
+
import { gitEvidence } from "../../flow/git.ts";
|
|
71
|
+
import { createOriginGit } from "../../rfc/verification-origin.ts";
|
|
72
|
+
import { listWorkspaceFiles } from "../workspace.ts";
|
|
73
|
+
import { runPolicyDigest } from "../../core/handlers/policy-digest.ts";
|
|
74
|
+
import type { ForgeCommandInput, ForgeRuntimeContext } from "../../../src/types.ts";
|
|
75
|
+
|
|
76
|
+
const dirs: string[] = [];
|
|
77
|
+
afterEach(() => {
|
|
78
|
+
for (const d of dirs.splice(0)) rmSync(d, { recursive: true, force: true });
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const CLEAN_PATH = (process.env["PATH"] ?? "")
|
|
82
|
+
.split(path.delimiter)
|
|
83
|
+
.filter((d) => d.length > 0 && !existsSync(path.join(d, "git-wrapper.sh")))
|
|
84
|
+
.join(path.delimiter);
|
|
85
|
+
beforeAll(() => {
|
|
86
|
+
process.env["PATH"] = CLEAN_PATH;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Module-load snapshot of the verifier's own OS-temp hooks state. Any
|
|
91
|
+
* `forge-evidence-hooks-*` dir appearing after this point was created by
|
|
92
|
+
* THIS process — the "session" in CX-123 discovers and plants into exactly
|
|
93
|
+
* those (the concurrent-session attack needs no race: the dir persists for
|
|
94
|
+
* the process lifetime).
|
|
95
|
+
*/
|
|
96
|
+
const hooksDirsBefore = new Set(
|
|
97
|
+
readdirSync(os.tmpdir()).filter((d) => d.startsWith("forge-evidence-hooks-")),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const gitIn = (root: string, args: string[], input?: string | Buffer) =>
|
|
101
|
+
execFileSync("git", args, {
|
|
102
|
+
cwd: root,
|
|
103
|
+
encoding: "utf8",
|
|
104
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
105
|
+
input,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
/** `gitIn` with the failure captured — for premises where git must refuse. */
|
|
109
|
+
const gitInSoft = (root: string, args: string[]): { ok: boolean; out: string } => {
|
|
110
|
+
try {
|
|
111
|
+
return { ok: true, out: gitIn(root, args) };
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return { ok: false, out: String(e) };
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
function repo(prefix: string): string {
|
|
118
|
+
const root = mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
119
|
+
dirs.push(root);
|
|
120
|
+
gitIn(root, ["init", "-q"]);
|
|
121
|
+
gitIn(root, ["config", "user.email", "t@t"]);
|
|
122
|
+
gitIn(root, ["config", "user.name", "t"]);
|
|
123
|
+
gitIn(root, ["config", "commit.gpgsign", "false"]);
|
|
124
|
+
return root;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const digestCtx = (root: string): ForgeRuntimeContext => ({
|
|
128
|
+
workspaceRoot: root,
|
|
129
|
+
logger: { section: () => {}, info: () => {}, warn: () => {}, error: () => {}, success: () => {} },
|
|
130
|
+
dryRun: false,
|
|
131
|
+
outputFormat: "json",
|
|
132
|
+
io: ambientIo,
|
|
133
|
+
});
|
|
134
|
+
const digestInp = (flags: Record<string, unknown>): ForgeCommandInput => ({
|
|
135
|
+
argv: [],
|
|
136
|
+
flags: flags as ForgeCommandInput["flags"],
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// ─── forged-pack primitives (single object at offset 12) ───────────────────
|
|
140
|
+
|
|
141
|
+
const CRC_TABLE = (() => {
|
|
142
|
+
const t = new Uint32Array(256);
|
|
143
|
+
for (let n = 0; n < 256; n++) {
|
|
144
|
+
let c = n;
|
|
145
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
146
|
+
t[n] = c >>> 0;
|
|
147
|
+
}
|
|
148
|
+
return t;
|
|
149
|
+
})();
|
|
150
|
+
function crc32(buf: Buffer): number {
|
|
151
|
+
let c = 0xffffffff;
|
|
152
|
+
for (const b of buf) c = CRC_TABLE[(c ^ b) & 0xff]! ^ (c >>> 8);
|
|
153
|
+
return (c ^ 0xffffffff) >>> 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** git pack object header: (type<<4 | size&15) then 7-bit size groups. */
|
|
157
|
+
function packObjHeader(type: number, size: number): Buffer {
|
|
158
|
+
const out = [(type << 4) | (size & 0x0f)];
|
|
159
|
+
size = Math.floor(size / 16);
|
|
160
|
+
while (size) {
|
|
161
|
+
out[out.length - 1]! |= 0x80;
|
|
162
|
+
out.push(size & 0x7f);
|
|
163
|
+
size = Math.floor(size / 128);
|
|
164
|
+
}
|
|
165
|
+
return Buffer.from(out);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Build a self-consistent single-object pack + v2 idx: object at offset 12,
|
|
170
|
+
* fanout/CRC/offsets/trailer all structurally valid. When `content` does not
|
|
171
|
+
* hash to `sha` the pair is a verbatim forgery git serves by idx name — and
|
|
172
|
+
* `verify-pack -s` refuses it (R10-R1); when it does, the pair is honest and
|
|
173
|
+
* verify-pack passes.
|
|
174
|
+
*/
|
|
175
|
+
function buildSinglePack(sha: string, type: 1 | 2 | 3 | 4, content: Buffer) {
|
|
176
|
+
const body = Buffer.concat([packObjHeader(type, content.length), deflateSync(content)]);
|
|
177
|
+
let pack = Buffer.concat([Buffer.from("PACK"), Buffer.from([0, 0, 0, 2, 0, 0, 0, 1]), body]);
|
|
178
|
+
const packSha = createHash("sha1").update(pack).digest();
|
|
179
|
+
pack = Buffer.concat([pack, packSha]);
|
|
180
|
+
const first = parseInt(sha.slice(0, 2), 16);
|
|
181
|
+
const fanout = new Array<number>(256).fill(0);
|
|
182
|
+
for (let i = first; i < 256; i++) fanout[i] = 1;
|
|
183
|
+
const u32 = (v: number): Buffer => {
|
|
184
|
+
const u = Buffer.alloc(4);
|
|
185
|
+
u.writeUInt32BE(v);
|
|
186
|
+
return u;
|
|
187
|
+
};
|
|
188
|
+
const idxBody = Buffer.concat([
|
|
189
|
+
Buffer.from([0xff, 0x74, 0x4f, 0x63, 0, 0, 0, 2]),
|
|
190
|
+
Buffer.from(
|
|
191
|
+
fanout.flatMap((n) => [(n >>> 24) & 255, (n >>> 16) & 255, (n >>> 8) & 255, n & 255]),
|
|
192
|
+
),
|
|
193
|
+
Buffer.from(sha, "hex"),
|
|
194
|
+
u32(crc32(body)),
|
|
195
|
+
u32(12),
|
|
196
|
+
packSha,
|
|
197
|
+
]);
|
|
198
|
+
const idx = Buffer.concat([idxBody, createHash("sha1").update(idxBody).digest()]);
|
|
199
|
+
return { pack, idx };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Drop a forged single-object pack+idx pair into `root`'s object store. */
|
|
203
|
+
function forgePack(root: string, sha: string, content: Buffer): string {
|
|
204
|
+
const { pack, idx } = buildSinglePack(sha, 3, content);
|
|
205
|
+
const pdir = path.join(root, ".git/objects/pack");
|
|
206
|
+
mkdirSync(pdir, { recursive: true });
|
|
207
|
+
const name = `pack-${createHash("sha1").update(pack).digest("hex").slice(0, 16)}`;
|
|
208
|
+
writeFileSync(path.join(pdir, `${name}.pack`), pack);
|
|
209
|
+
writeFileSync(path.join(pdir, `${name}.idx`), idx);
|
|
210
|
+
return path.join(pdir, `${name}.pack`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Hand-write `.git/index` with ONE entry carrying the worktree file's live
|
|
215
|
+
* stat tuple but HEAD's blob sha — the CX-121 fabrication primitive: raw
|
|
216
|
+
* `status --porcelain` answers clean while the worktree bytes differ.
|
|
217
|
+
*/
|
|
218
|
+
function forgeIndexEntry(root: string, file: string): void {
|
|
219
|
+
const st = statSync(path.join(root, file), { bigint: true });
|
|
220
|
+
const headBlob = gitIn(root, ["rev-parse", `HEAD:${file}`]).trim();
|
|
221
|
+
const name = Buffer.from(file);
|
|
222
|
+
const entry = Buffer.alloc(40);
|
|
223
|
+
const wr = (v: bigint | number, o: number) =>
|
|
224
|
+
entry.writeUInt32BE(Number(BigInt(v) & 0xffffffffn), o);
|
|
225
|
+
wr(st.ctimeNs / 1_000_000_000n, 0);
|
|
226
|
+
wr(st.ctimeNs % 1_000_000_000n, 4);
|
|
227
|
+
wr(st.mtimeNs / 1_000_000_000n, 8);
|
|
228
|
+
wr(st.mtimeNs % 1_000_000_000n, 12);
|
|
229
|
+
wr(st.dev, 16);
|
|
230
|
+
wr(st.ino, 20);
|
|
231
|
+
wr(0o100644, 24);
|
|
232
|
+
wr(st.uid, 28);
|
|
233
|
+
wr(st.gid, 32);
|
|
234
|
+
wr(st.size, 36);
|
|
235
|
+
const full = Buffer.concat([
|
|
236
|
+
entry,
|
|
237
|
+
Buffer.from(headBlob, "hex"),
|
|
238
|
+
Buffer.from([0, name.length]),
|
|
239
|
+
name,
|
|
240
|
+
]);
|
|
241
|
+
const pad = Buffer.alloc((8 - (full.length % 8)) % 8);
|
|
242
|
+
const idxBody = Buffer.concat([
|
|
243
|
+
Buffer.from("DIRC"),
|
|
244
|
+
Buffer.from([0, 0, 0, 2, 0, 0, 0, 1]),
|
|
245
|
+
full,
|
|
246
|
+
pad,
|
|
247
|
+
]);
|
|
248
|
+
const idx = Buffer.concat([idxBody, createHash("sha1").update(idxBody).digest()]);
|
|
249
|
+
writeFileSync(path.join(root, ".git/index"), idx);
|
|
250
|
+
// mtime ordering: index newer than the file entry → not racily clean.
|
|
251
|
+
utimesSync(path.join(root, ".git/index"), new Date(), new Date());
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// ─── workflow adoption plumbing (mirrors the r9 file) ──────────────────────
|
|
255
|
+
|
|
256
|
+
const adoptedWorkflow = (body: string): boolean => {
|
|
257
|
+
const root = mkdtempSync(path.join(os.tmpdir(), "cx10-scaffold-"));
|
|
258
|
+
dirs.push(root);
|
|
259
|
+
const rel = ".github/workflows/forge-policy.yml";
|
|
260
|
+
const p = path.join(root, rel);
|
|
261
|
+
mkdirSync(path.dirname(p), { recursive: true });
|
|
262
|
+
writeFileSync(p, body);
|
|
263
|
+
return scaffoldTrustBoundary(root, "@operator").skipped.some((s) => s.includes(rel));
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const WORKFLOW_HEAD = `name: forge-policy
|
|
267
|
+
on: [push, pull_request]
|
|
268
|
+
jobs:
|
|
269
|
+
policy-surface:
|
|
270
|
+
runs-on: ubuntu-latest
|
|
271
|
+
steps:
|
|
272
|
+
`;
|
|
273
|
+
|
|
274
|
+
const workflowWithRun = (run: string): string =>
|
|
275
|
+
`${WORKFLOW_HEAD} - run: |\n${run
|
|
276
|
+
.split("\n")
|
|
277
|
+
.map((l) => ` ${l}`)
|
|
278
|
+
.join("\n")}\n`;
|
|
279
|
+
|
|
280
|
+
// ===========================================================================
|
|
281
|
+
// CX-123 — the hooks pin target must not be a plantable temp dir
|
|
282
|
+
// (closed: core.hooksPath pins at the null device — no verifier hooks dir
|
|
283
|
+
// exists, and a char device has no plantable entries)
|
|
284
|
+
// ===========================================================================
|
|
285
|
+
|
|
286
|
+
describe("RFC-1616 r10 — the hooks pin target is dead, not a persistent plantable dir", () => {
|
|
287
|
+
it(
|
|
288
|
+
"CX-123 (closed): trusted spawns create no `forge-evidence-hooks-*` dir under the session-writable OS temp root, and the strongest session lever — repo-config `core.hooksPath` aimed at a planted hook dir — cannot fire a `reference-transaction` inside the pinned fetch because the pin overrides it with the dead path while the fetch itself still succeeds",
|
|
289
|
+
{ timeout: 120_000 },
|
|
290
|
+
async () => {
|
|
291
|
+
const root = repo("cx10-hook-");
|
|
292
|
+
// A remote with one commit the local repo lacks, so the pinned fetch
|
|
293
|
+
// performs a real ref update (the transaction the hook fires on).
|
|
294
|
+
const remote = repo("cx10-remote-");
|
|
295
|
+
writeFileSync(path.join(remote, "r.txt"), "remote\n");
|
|
296
|
+
gitIn(remote, ["add", "-A"]);
|
|
297
|
+
gitIn(remote, ["commit", "-qm", "remote commit"]);
|
|
298
|
+
// The remote must ride a transport the session cannot author — a
|
|
299
|
+
// `remote.origin.url` naming a PATH is session-servable and the
|
|
300
|
+
// r11 transport judgment refuses it (CX-131), so the fixture
|
|
301
|
+
// serves the repo over loopback git://.
|
|
302
|
+
const daemonPort = await new Promise<number>((resolve, reject) => {
|
|
303
|
+
const srv = net.createServer();
|
|
304
|
+
srv.once("error", reject);
|
|
305
|
+
srv.listen(0, "127.0.0.1", () => {
|
|
306
|
+
const p = (srv.address() as net.AddressInfo).port;
|
|
307
|
+
srv.close(() => resolve(p));
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
const daemon = spawn("git", [
|
|
311
|
+
"daemon",
|
|
312
|
+
"--export-all",
|
|
313
|
+
"--reuseaddr",
|
|
314
|
+
`--base-path=${path.dirname(remote)}`,
|
|
315
|
+
"--listen=127.0.0.1",
|
|
316
|
+
`--port=${daemonPort}`,
|
|
317
|
+
]);
|
|
318
|
+
try {
|
|
319
|
+
for (let i = 0; ; i++) {
|
|
320
|
+
try {
|
|
321
|
+
gitIn(root, ["ls-remote", `git://127.0.0.1:${daemonPort}/${path.basename(remote)}`]);
|
|
322
|
+
break;
|
|
323
|
+
} catch (e) {
|
|
324
|
+
if (i > 50) throw e;
|
|
325
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
gitIn(root, [
|
|
329
|
+
"config",
|
|
330
|
+
"remote.origin.url",
|
|
331
|
+
`git://127.0.0.1:${daemonPort}/${path.basename(remote)}`,
|
|
332
|
+
]);
|
|
333
|
+
gitIn(root, ["config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"]);
|
|
334
|
+
|
|
335
|
+
// Trusted spawns must not materialize a hooks dir the session can
|
|
336
|
+
// discover by polling the temp root and plant hooks into (CX-123).
|
|
337
|
+
const s = await verifierGit(root, ["status", "--porcelain"]);
|
|
338
|
+
expect(s.exitCode).toBe(0);
|
|
339
|
+
const fresh = readdirSync(os.tmpdir()).filter(
|
|
340
|
+
(d) => d.startsWith("forge-evidence-hooks-") && !hooksDirsBefore.has(d),
|
|
341
|
+
);
|
|
342
|
+
expect(
|
|
343
|
+
fresh,
|
|
344
|
+
"the verifier still materializes a plantable hooks dir under the session-owned temp root",
|
|
345
|
+
).toEqual([]);
|
|
346
|
+
|
|
347
|
+
// The session's strongest lever: repo-config `core.hooksPath` aimed
|
|
348
|
+
// at a dir holding an executable reference-transaction hook. The
|
|
349
|
+
// pin must override it with the dead path — the ref update fires
|
|
350
|
+
// nothing — while the fetch itself still succeeds.
|
|
351
|
+
const planted = path.join(root, ".planted-hooks");
|
|
352
|
+
mkdirSync(planted, { recursive: true });
|
|
353
|
+
const marker = path.join(root, ".ref-tx-marker");
|
|
354
|
+
const hook = path.join(planted, "reference-transaction");
|
|
355
|
+
writeFileSync(
|
|
356
|
+
hook,
|
|
357
|
+
`#!/bin/sh\necho HOOK-RAN > ${JSON.stringify(marker).slice(1, -1)}\nexit 0\n`,
|
|
358
|
+
);
|
|
359
|
+
chmodSync(hook, 0o755);
|
|
360
|
+
gitIn(root, ["config", "core.hooksPath", planted]);
|
|
361
|
+
// Control: the repo's own hooks dir carries no such hook — the exec
|
|
362
|
+
// could only have come from the configured path.
|
|
363
|
+
expect(existsSync(path.join(root, ".git/hooks/reference-transaction"))).toBe(false);
|
|
364
|
+
|
|
365
|
+
// CX-132: fetch is refused at the argv layer — the configured
|
|
366
|
+
// hooksPath is unreachable through a transport op (the /dev/null
|
|
367
|
+
// pin already covered every spawn; this lever is dead at two
|
|
368
|
+
// layers now).
|
|
369
|
+
const f = await gitEvidence(root, ["fetch", "origin"]);
|
|
370
|
+
expect(f.exitCode !== 0, "the evidence channel ran a transport op").toBe(true);
|
|
371
|
+
expect(
|
|
372
|
+
!existsSync(marker),
|
|
373
|
+
"the session-configured hook executed inside the trusted channel",
|
|
374
|
+
).toBe(true);
|
|
375
|
+
} finally {
|
|
376
|
+
daemon.kill();
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
);
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
// ===========================================================================
|
|
383
|
+
// CX-124 — prepareEvidenceIndex must fail CLOSED, never at the ambient index
|
|
384
|
+
// (closed: a failed claims rebuild is a preflight shape violation, so every
|
|
385
|
+
// index-consulting trusted read refuses outright)
|
|
386
|
+
// ===========================================================================
|
|
387
|
+
|
|
388
|
+
describe("RFC-1616 r10 — the claims-rebuild failure refuses, never falls back to the forged ambient index", () => {
|
|
389
|
+
it(
|
|
390
|
+
"CX-124 (closed): a session-corrupted `.git/index` makes every claims rebuild fail (the verifier's own index is a nameless O_TMPFILE inode), and the channels now REFUSE the read (EVIDENCE-REFUSED / null) instead of consulting the ambient session-writable `.git/index` — a hand-written CX-121 stat-forged index can no longer answer clean on dirty bytes; the healthy-path control still reports the dirt",
|
|
391
|
+
{ timeout: 120_000 },
|
|
392
|
+
async () => {
|
|
393
|
+
const root = repo("cx10-idx-");
|
|
394
|
+
writeFileSync(path.join(root, "a.txt"), "good\n");
|
|
395
|
+
gitIn(root, ["add", "-A"]);
|
|
396
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
397
|
+
// Same-size dirty edit so every stat field still matches.
|
|
398
|
+
writeFileSync(path.join(root, "a.txt"), "evil\n");
|
|
399
|
+
// Racy-clean defeat: the file's mtime must be strictly OLDER than the
|
|
400
|
+
// .git/index write that follows.
|
|
401
|
+
const past = new Date(Date.now() - 60_000);
|
|
402
|
+
utimesSync(path.join(root, "a.txt"), past, past);
|
|
403
|
+
forgeIndexEntry(root, "a.txt");
|
|
404
|
+
|
|
405
|
+
// Premise: raw git answers clean while the worktree byte differs.
|
|
406
|
+
expect(gitIn(root, ["status", "--porcelain"])).toBe("");
|
|
407
|
+
expect(gitIn(root, ["show", "HEAD:a.txt"])).not.toBe(
|
|
408
|
+
readFileSync(path.join(root, "a.txt"), "utf8"),
|
|
409
|
+
);
|
|
410
|
+
|
|
411
|
+
// Control: with the rebuild intact the channel content-hashes and
|
|
412
|
+
// reports the dirt (CX-121 stays closed on the healthy path).
|
|
413
|
+
const honest = await gitEvidence(root, ["status", "--porcelain"]);
|
|
414
|
+
expect(
|
|
415
|
+
honest.exitCode === 0 && honest.stdout.includes("M"),
|
|
416
|
+
`control: the rebuilt claims index must show the dirt (exit=${honest.exitCode}, out=${JSON.stringify(honest.stdout)})`,
|
|
417
|
+
).toBe(true);
|
|
418
|
+
|
|
419
|
+
// Sabotage: the verifier index is a nameless O_TMPFILE inode the
|
|
420
|
+
// session cannot discover or chmod — but `.git/index` is
|
|
421
|
+
// session-writable too. Garbage bytes make the claims enumeration
|
|
422
|
+
// (`git ls-files --stage`) die with `index file corrupt`, the
|
|
423
|
+
// rebuild fails, and the channels must FAIL CLOSED: refuse the
|
|
424
|
+
// read (EVIDENCE-REFUSED / null) — never consult the ambient
|
|
425
|
+
// forged index. CX-r37: the judged index is mode-barriered — the
|
|
426
|
+
// session must `chmod +w` first (a ctime-visible act), then its
|
|
427
|
+
// in-place write lands.
|
|
428
|
+
const idx = path.join(root, ".git", "index");
|
|
429
|
+
chmodSync(idx, 0o600);
|
|
430
|
+
writeFileSync(idx, "garbage-not-an-index");
|
|
431
|
+
const ev = await gitEvidence(root, ["status", "--porcelain"]);
|
|
432
|
+
expect(
|
|
433
|
+
ev.exitCode !== 0 && ev.stderr.includes("EVIDENCE-REFUSED"),
|
|
434
|
+
`the sabotaged rebuild did not refuse the evidence read (exit=${ev.exitCode}, out=${JSON.stringify(ev.stdout)})`,
|
|
435
|
+
).toBe(true);
|
|
436
|
+
const og = await createOriginGit(root).run(["status", "--porcelain", "--untracked-files=no"]);
|
|
437
|
+
expect(
|
|
438
|
+
og === null,
|
|
439
|
+
`the sabotaged rebuild let the origin channel answer from the ambient forged index (${JSON.stringify(og)})`,
|
|
440
|
+
).toBe(true);
|
|
441
|
+
// The degradation is scoped: reads that never consult the index
|
|
442
|
+
// still answer — only index-consulting ops refuse (CX-124's rule).
|
|
443
|
+
const rev = await gitEvidence(root, ["rev-parse", "HEAD"]);
|
|
444
|
+
expect(
|
|
445
|
+
rev.exitCode === 0 && rev.stdout.trim().length > 0,
|
|
446
|
+
`a non-index read was refused under the unproven index (exit=${rev.exitCode})`,
|
|
447
|
+
).toBe(true);
|
|
448
|
+
},
|
|
449
|
+
);
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
// ===========================================================================
|
|
453
|
+
// R10 controls — prior-round remediations re-verified live
|
|
454
|
+
// ===========================================================================
|
|
455
|
+
|
|
456
|
+
describe("RFC-1616 r10 — prior-round controls re-verified", () => {
|
|
457
|
+
it(
|
|
458
|
+
"R10-R1: a FRESHLY forged pack+idx pair (cold memo) still refuses the evidence channel — verify-pack -s validates object names, so the CX-113 anchor holds",
|
|
459
|
+
{ timeout: 90_000 },
|
|
460
|
+
async () => {
|
|
461
|
+
const root = repo("cx10-pack-");
|
|
462
|
+
writeFileSync(path.join(root, "a.txt"), "x\n");
|
|
463
|
+
gitIn(root, ["add", "-A"]);
|
|
464
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
465
|
+
const BF = `deadbee${"3".repeat(33)}`;
|
|
466
|
+
forgePack(root, BF, Buffer.from("FORGED-POLICY-BYTES\n"));
|
|
467
|
+
// Premise: raw git serves the forged bytes for the fabricated sha.
|
|
468
|
+
expect(gitIn(root, ["cat-file", "-p", BF])).toBe("FORGED-POLICY-BYTES\n");
|
|
469
|
+
const r = await gitEvidence(root, ["cat-file", "-p", BF]);
|
|
470
|
+
expect(
|
|
471
|
+
r.exitCode !== 0 && r.stderr.startsWith("EVIDENCE-REFUSED"),
|
|
472
|
+
`a fresh forged pack was not refused (exit=${r.exitCode}, out=${JSON.stringify(r.stdout.slice(0, 40))})`,
|
|
473
|
+
).toBe(true);
|
|
474
|
+
},
|
|
475
|
+
);
|
|
476
|
+
|
|
477
|
+
it(
|
|
478
|
+
"R10-R2: the pack-memo TOCTOU is defended by git itself — an honestly verified pack whose .pack sibling is rewritten in place cannot serve forged bytes, because the idx trailer records the pack sha1 and every object read refuses the mismatched pair (the memo keys the .idx only, but the swap dies in git before any read answers)",
|
|
479
|
+
{ timeout: 90_000 },
|
|
480
|
+
async () => {
|
|
481
|
+
const root = repo("cx10-swap-");
|
|
482
|
+
writeFileSync(path.join(root, "policy.txt"), "placeholder\n");
|
|
483
|
+
gitIn(root, ["add", "-A"]);
|
|
484
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
485
|
+
const REAL = "real policy content\n";
|
|
486
|
+
const FORGED = "FORGED policy content\n";
|
|
487
|
+
// An honest single-object pack built by git itself.
|
|
488
|
+
const S = gitIn(root, ["hash-object", "-w", "--stdin", "-t", "blob"], REAL).trim();
|
|
489
|
+
const packBytes = execFileSync("git", ["pack-objects", "--stdout"], {
|
|
490
|
+
cwd: root,
|
|
491
|
+
input: `${S}\n`,
|
|
492
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
493
|
+
});
|
|
494
|
+
const pdir = path.join(root, ".git/objects/pack");
|
|
495
|
+
mkdirSync(pdir, { recursive: true });
|
|
496
|
+
const packPath = path.join(pdir, "pack-honest.pack");
|
|
497
|
+
writeFileSync(packPath, packBytes);
|
|
498
|
+
execFileSync("git", ["index-pack", packPath], { cwd: root });
|
|
499
|
+
rmSync(path.join(root, ".git/objects", S.slice(0, 2), S.slice(2)));
|
|
500
|
+
// First read — preflight verify-packs the honest pair, memoizes.
|
|
501
|
+
const first = await gitEvidence(root, ["cat-file", "-p", S]);
|
|
502
|
+
expect(first.exitCode).toBe(0);
|
|
503
|
+
expect(first.stdout).toBe(REAL);
|
|
504
|
+
// Rewrite the .pack in place (idx untouched — the memo tuple
|
|
505
|
+
// matches). CX-r37: judged objects are mode-barriered — the swap
|
|
506
|
+
// needs a `chmod +w` first, exactly the ctime-visible act a real
|
|
507
|
+
// same-UID rewrite must perform now.
|
|
508
|
+
const forged = buildSinglePack(S, 3, Buffer.from(FORGED));
|
|
509
|
+
chmodSync(packPath, 0o600);
|
|
510
|
+
writeFileSync(packPath, forged.pack);
|
|
511
|
+
// Premise: git itself refuses the swapped pair on a raw read.
|
|
512
|
+
const raw = gitInSoft(root, ["cat-file", "-p", S]);
|
|
513
|
+
expect(raw.ok, "premise: git's idx↔pack sha1 binding refuses the swapped pack").toBe(false);
|
|
514
|
+
// The trusted channel fails closed — never serves the forgery.
|
|
515
|
+
const second = await gitEvidence(root, ["cat-file", "-p", S]);
|
|
516
|
+
expect(
|
|
517
|
+
second.exitCode !== 0 || second.stdout !== FORGED,
|
|
518
|
+
`a pack swap after verification served forged bytes (exit=${second.exitCode}, out=${JSON.stringify(second.stdout.slice(0, 40))})`,
|
|
519
|
+
).toBe(true);
|
|
520
|
+
},
|
|
521
|
+
);
|
|
522
|
+
|
|
523
|
+
it(
|
|
524
|
+
"R10-R3: `reflog`/`stash`/caller `-c`/`--git-dir`/config writes/update-ref stay refused on the verifier channel (CX-108/109 hold)",
|
|
525
|
+
{ timeout: 60_000 },
|
|
526
|
+
async () => {
|
|
527
|
+
const root = repo("cx10-argv-");
|
|
528
|
+
writeFileSync(path.join(root, "a"), "x\n");
|
|
529
|
+
gitIn(root, ["add", "-A"]);
|
|
530
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
531
|
+
for (const argv of [
|
|
532
|
+
["reflog"],
|
|
533
|
+
["stash", "list"],
|
|
534
|
+
["-c", "x=y", "status"],
|
|
535
|
+
["--git-dir", root, "status"],
|
|
536
|
+
["config", "core.evil", "x"],
|
|
537
|
+
["update-ref", "refs/heads/master", "HEAD"],
|
|
538
|
+
]) {
|
|
539
|
+
const r = await verifierGit(root, argv);
|
|
540
|
+
expect(
|
|
541
|
+
r.exitCode !== 0 && r.stderr.includes("EVIDENCE-REFUSED"),
|
|
542
|
+
`${JSON.stringify(argv)} slipped the argv table (exit=${r.exitCode})`,
|
|
543
|
+
).toBe(true);
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
it(
|
|
549
|
+
"R10-R4: abbreviated forbidden flags and the ext transport stay refused — `--out=` (abbrev of --output), `--ext` (abbrev of --ext-diff), `--reflog=`, `--batch-check`, `-u` on ls-remote, `--open-files-in-pager`, and `ext::` transport (protocol.ext.allow=never pin)",
|
|
550
|
+
{ timeout: 60_000 },
|
|
551
|
+
async () => {
|
|
552
|
+
const root = repo("cx10-abbrev-");
|
|
553
|
+
writeFileSync(path.join(root, "a"), "x\n");
|
|
554
|
+
gitIn(root, ["add", "-A"]);
|
|
555
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
556
|
+
const marker = path.join(root, ".ext-marker");
|
|
557
|
+
for (const argv of [
|
|
558
|
+
["log", "--out=/tmp/cx10-out.txt"],
|
|
559
|
+
["log", "--ext"],
|
|
560
|
+
["show", "--output=/tmp/cx10-out2.txt"],
|
|
561
|
+
["rev-list", "--reflog=all"],
|
|
562
|
+
["cat-file", "--batch-check"],
|
|
563
|
+
["ls-remote", "-u", "x"],
|
|
564
|
+
["grep", "--open-files-in-pager"],
|
|
565
|
+
]) {
|
|
566
|
+
const r = await verifierGit(root, argv);
|
|
567
|
+
expect(
|
|
568
|
+
r.exitCode !== 0 && r.stderr.includes("EVIDENCE-REFUSED"),
|
|
569
|
+
`${JSON.stringify(argv)} slipped the argv table (exit=${r.exitCode})`,
|
|
570
|
+
).toBe(true);
|
|
571
|
+
}
|
|
572
|
+
const ext = await gitEvidence(root, ["ls-remote", `ext::sh -c echo > ${marker}`]);
|
|
573
|
+
expect(ext.exitCode !== 0, "the ext transport rode the pinned spawn").toBe(true);
|
|
574
|
+
expect(existsSync(marker)).toBe(false);
|
|
575
|
+
},
|
|
576
|
+
);
|
|
577
|
+
|
|
578
|
+
it(
|
|
579
|
+
"R10-R5: a forged LOOSE object still refuses the evidence channel (CX-104a remediation holds)",
|
|
580
|
+
{ timeout: 60_000 },
|
|
581
|
+
async () => {
|
|
582
|
+
const root = repo("cx10-loose-");
|
|
583
|
+
writeFileSync(path.join(root, "a"), "x\n");
|
|
584
|
+
gitIn(root, ["add", "-A"]);
|
|
585
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
586
|
+
const sha = gitIn(
|
|
587
|
+
root,
|
|
588
|
+
["hash-object", "-w", "--stdin", "-t", "blob"],
|
|
589
|
+
"real-bytes\n",
|
|
590
|
+
).trim();
|
|
591
|
+
const obj = path.join(root, ".git/objects", sha.slice(0, 2), sha.slice(2));
|
|
592
|
+
chmodSync(obj, 0o644);
|
|
593
|
+
writeFileSync(obj, deflateSync(Buffer.from("blob 6\0forged")));
|
|
594
|
+
const r = await gitEvidence(root, ["cat-file", "-p", sha]);
|
|
595
|
+
expect(
|
|
596
|
+
r.exitCode !== 0 && r.stderr.startsWith("EVIDENCE-REFUSED"),
|
|
597
|
+
`forged loose object not refused (exit=${r.exitCode}, out=${JSON.stringify(r.stdout.slice(0, 30))})`,
|
|
598
|
+
).toBe(true);
|
|
599
|
+
},
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
it(
|
|
603
|
+
"R10-R6: ambient GIT_INDEX_FILE/GIT_DIR stay stripped from listWorkspaceFiles (CX-122) and ambient GIT_CONFIG_* injection cannot arm core.fsmonitor on the verifier channel",
|
|
604
|
+
{ timeout: 90_000 },
|
|
605
|
+
async () => {
|
|
606
|
+
const root = repo("cx10-amb-");
|
|
607
|
+
writeFileSync(path.join(root, "a.txt"), "a\n");
|
|
608
|
+
writeFileSync(path.join(root, ".gitignore"), "hidden.md\n");
|
|
609
|
+
gitIn(root, ["add", "-A"]);
|
|
610
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
611
|
+
writeFileSync(path.join(root, "hidden.md"), "secret\n");
|
|
612
|
+
const foreign = repo("cx10-foreign-");
|
|
613
|
+
writeFileSync(path.join(foreign, "hidden.md"), "secret\n");
|
|
614
|
+
gitIn(foreign, ["add", "hidden.md"]);
|
|
615
|
+
|
|
616
|
+
const baseline = await listWorkspaceFiles(root);
|
|
617
|
+
// CX-142: ignore rules never hide files from the trusted
|
|
618
|
+
// enumeration — `hidden.md` is a worktree file, so it lists.
|
|
619
|
+
expect(baseline.includes("hidden.md")).toBe(true);
|
|
620
|
+
const prevIdx = process.env["GIT_INDEX_FILE"];
|
|
621
|
+
const prevDir = process.env["GIT_DIR"];
|
|
622
|
+
process.env["GIT_INDEX_FILE"] = path.join(foreign, ".git", "index");
|
|
623
|
+
process.env["GIT_DIR"] = path.join(foreign, ".git");
|
|
624
|
+
try {
|
|
625
|
+
const listed = await listWorkspaceFiles(root);
|
|
626
|
+
// The ambient env must not move the answer at all: a leaked
|
|
627
|
+
// GIT_DIR would walk the foreign worktree (losing `a.txt`), a
|
|
628
|
+
// leaked GIT_INDEX_FILE would answer foreign index claims.
|
|
629
|
+
expect(
|
|
630
|
+
listed.sort(),
|
|
631
|
+
`ambient GIT_* redirected the workspace listing (got ${JSON.stringify(listed)})`,
|
|
632
|
+
).toEqual(baseline.sort());
|
|
633
|
+
} finally {
|
|
634
|
+
if (prevIdx === undefined) delete process.env["GIT_INDEX_FILE"];
|
|
635
|
+
else process.env["GIT_INDEX_FILE"] = prevIdx;
|
|
636
|
+
if (prevDir === undefined) delete process.env["GIT_DIR"];
|
|
637
|
+
else process.env["GIT_DIR"] = prevDir;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// Ambient GIT_CONFIG_* injection: a session-exported config pair
|
|
641
|
+
// arming core.fsmonitor must be stripped by verifierGitEnv.
|
|
642
|
+
const marker = path.join(root, ".fsm-marker");
|
|
643
|
+
const hook = path.join(root, "fsm.sh");
|
|
644
|
+
writeFileSync(
|
|
645
|
+
hook,
|
|
646
|
+
`#!/bin/sh\necho EXEC-FSMONITOR > ${JSON.stringify(marker).slice(1, -1)}\nexit 0\n`,
|
|
647
|
+
);
|
|
648
|
+
chmodSync(hook, 0o755);
|
|
649
|
+
const prevCount = process.env["GIT_CONFIG_COUNT"];
|
|
650
|
+
const prevKey = process.env["GIT_CONFIG_KEY_0"];
|
|
651
|
+
const prevVal = process.env["GIT_CONFIG_VALUE_0"];
|
|
652
|
+
process.env["GIT_CONFIG_COUNT"] = "1";
|
|
653
|
+
process.env["GIT_CONFIG_KEY_0"] = "core.fsmonitor";
|
|
654
|
+
process.env["GIT_CONFIG_VALUE_0"] = hook;
|
|
655
|
+
try {
|
|
656
|
+
const r = await verifierGit(root, ["status", "--porcelain"]);
|
|
657
|
+
expect(r.exitCode).toBe(0);
|
|
658
|
+
expect(
|
|
659
|
+
!existsSync(marker),
|
|
660
|
+
"ambient GIT_CONFIG_* injection armed core.fsmonitor inside the trusted spawn",
|
|
661
|
+
).toBe(true);
|
|
662
|
+
} finally {
|
|
663
|
+
if (prevCount === undefined) delete process.env["GIT_CONFIG_COUNT"];
|
|
664
|
+
else process.env["GIT_CONFIG_COUNT"] = prevCount;
|
|
665
|
+
if (prevKey === undefined) delete process.env["GIT_CONFIG_KEY_0"];
|
|
666
|
+
else process.env["GIT_CONFIG_KEY_0"] = prevKey;
|
|
667
|
+
if (prevVal === undefined) delete process.env["GIT_CONFIG_VALUE_0"];
|
|
668
|
+
else process.env["GIT_CONFIG_VALUE_0"] = prevVal;
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
);
|
|
672
|
+
|
|
673
|
+
it(
|
|
674
|
+
"R10-R7: the heredoc lexer stays quote-aware and bash-faithful — a quoted `<<` arms nothing (CX-119), `<<~EOF`/`<<'E'OF`/`<<$EOF` keep body lines stdin (CX-105/106/107), a real invocation still counts",
|
|
675
|
+
{ timeout: 60_000 },
|
|
676
|
+
() => {
|
|
677
|
+
// Quoted `<<` must not arm a fake heredoc that hides a real opener.
|
|
678
|
+
const quoted = workflowWithRun(
|
|
679
|
+
["echo '<<A x'", "cat <<B", "A", "forge correctness.gate", "B"].join("\n"),
|
|
680
|
+
);
|
|
681
|
+
expect(!adoptedWorkflow(quoted), "a quoted `<<` armed a fake heredoc").toBe(true);
|
|
682
|
+
// r8 grammar trio.
|
|
683
|
+
const t1 = workflowWithRun(
|
|
684
|
+
["cat <<~EOF", "forge correctness.gate", "EOF", "~EOF"].join("\n"),
|
|
685
|
+
);
|
|
686
|
+
const t2 = workflowWithRun(["cat <<'E'OF", "forge correctness.gate", "EOF"].join("\n"));
|
|
687
|
+
const t3 = workflowWithRun(["cat <<$EOF", "forge correctness.gate", "EOF"].join("\n"));
|
|
688
|
+
for (const [name, body] of [
|
|
689
|
+
["<<~EOF", t1],
|
|
690
|
+
["<<'E'OF", t2],
|
|
691
|
+
["<<$EOF", t3],
|
|
692
|
+
] as const) {
|
|
693
|
+
expect(!adoptedWorkflow(body), `${name} let dead CI count as adopted`).toBe(true);
|
|
694
|
+
}
|
|
695
|
+
// Positive control: a real invocation still counts.
|
|
696
|
+
const real = workflowWithRun(
|
|
697
|
+
[
|
|
698
|
+
"forge correctness.gate --base HEAD~1",
|
|
699
|
+
"forge policy.digest --verify",
|
|
700
|
+
"forge pinned.validate",
|
|
701
|
+
].join("\n"),
|
|
702
|
+
);
|
|
703
|
+
expect(adoptedWorkflow(real), "a real invocation must still count").toBe(true);
|
|
704
|
+
},
|
|
705
|
+
);
|
|
706
|
+
|
|
707
|
+
it(
|
|
708
|
+
"R10-R8: `policy.digest --verify --base` still refuses dynamic revspecs and a fabricated base blob still fails the anchored verify (CX-103/CX-113 hold end to end)",
|
|
709
|
+
{ timeout: 90_000 },
|
|
710
|
+
async () => {
|
|
711
|
+
const root = repo("cx10-digest-");
|
|
712
|
+
writeFileSync(
|
|
713
|
+
path.join(root, "forge.yaml"),
|
|
714
|
+
`schema: forge/config@1\nproject:\n name: demo\npolicy:\n mutable: [project]\n freezeFiles:\n - "hooks/**"\n`,
|
|
715
|
+
);
|
|
716
|
+
mkdirSync(path.join(root, "hooks"), { recursive: true });
|
|
717
|
+
writeFileSync(path.join(root, "hooks", "pre-commit.sh"), "#!/bin/sh\nexit 0\n");
|
|
718
|
+
gitIn(root, ["add", "-A"]);
|
|
719
|
+
gitIn(root, ["commit", "-qm", "seed"]);
|
|
720
|
+
for (const rev of ["HEAD", "master", ":/seed"]) {
|
|
721
|
+
const r = await runPolicyDigest(digestInp({ verify: true, base: rev }), digestCtx(root));
|
|
722
|
+
expect(r.exitCode !== 0, `--base ${rev} was accepted (status=${r.data?.status})`).toBe(
|
|
723
|
+
true,
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
// A forged pack serving the base's forge.yaml cannot pass the verify:
|
|
727
|
+
// first assert the honest verify passes on the clean store (base below
|
|
728
|
+
// the tip, surface unchanged since the base commit)…
|
|
729
|
+
writeFileSync(path.join(root, "a.txt"), "advance\n");
|
|
730
|
+
gitIn(root, ["add", "-A"]);
|
|
731
|
+
gitIn(root, ["commit", "-qm", "advance"]);
|
|
732
|
+
await runPolicyDigest(digestInp({ write: true }), digestCtx(root));
|
|
733
|
+
gitIn(root, ["add", ".forge/policy.digest"]);
|
|
734
|
+
gitIn(root, ["commit", "-qm", "digest"]);
|
|
735
|
+
const base = gitIn(root, ["rev-parse", "HEAD~2"]).trim();
|
|
736
|
+
const honest = await runPolicyDigest(digestInp({ verify: true, base }), digestCtx(root));
|
|
737
|
+
expect(
|
|
738
|
+
honest.exitCode === 0,
|
|
739
|
+
`honest verify must pass (violations=${JSON.stringify(honest.data?.violations)})`,
|
|
740
|
+
).toBe(true);
|
|
741
|
+
// …then drop a fresh forged pack+idx pair and confirm the anchor
|
|
742
|
+
// refuses the channel wholesale (CX-113's remediation holds).
|
|
743
|
+
const BF = `deadbee${"9".repeat(33)}`;
|
|
744
|
+
forgePack(
|
|
745
|
+
root,
|
|
746
|
+
BF,
|
|
747
|
+
Buffer.from(
|
|
748
|
+
`schema: forge/config@1\nproject:\n name: demo\npolicy:\n mutable: [project]\n freezeFiles:\n - "hooks/**"\n`,
|
|
749
|
+
),
|
|
750
|
+
);
|
|
751
|
+
const r2 = await gitEvidence(root, ["cat-file", "-p", BF]);
|
|
752
|
+
expect(r2.exitCode !== 0 && r2.stderr.startsWith("EVIDENCE-REFUSED")).toBe(true);
|
|
753
|
+
},
|
|
754
|
+
);
|
|
755
|
+
});
|