@warpgogol/forge 9.4.1 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +30 -0
- package/README.uk.md +30 -0
- package/bin/cli.ts +163 -53
- package/dist/bin/cli.js +137 -42
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/codebase/codebase.module.d.ts +3 -0
- package/dist/os/codebase/codebase.module.d.ts.map +1 -0
- package/dist/os/codebase/codebase.module.js +53 -0
- package/dist/os/codebase/codebase.module.js.map +1 -0
- package/dist/os/codebase/handlers/codebase-measure-symbols.d.ts +15 -0
- package/dist/os/codebase/handlers/codebase-measure-symbols.d.ts.map +1 -0
- package/dist/os/codebase/handlers/codebase-measure-symbols.js +97 -0
- package/dist/os/codebase/handlers/codebase-measure-symbols.js.map +1 -0
- package/dist/os/codebase/handlers/codebase-measure.d.ts +22 -0
- package/dist/os/codebase/handlers/codebase-measure.d.ts.map +1 -0
- package/dist/os/codebase/handlers/codebase-measure.js +435 -0
- package/dist/os/codebase/handlers/codebase-measure.js.map +1 -0
- package/dist/os/codebase/index.d.ts +4 -0
- package/dist/os/codebase/index.d.ts.map +1 -0
- package/dist/os/codebase/index.js +13 -0
- package/dist/os/codebase/index.js.map +1 -0
- package/dist/os/codebase/types.d.ts +35 -0
- package/dist/os/codebase/types.d.ts.map +1 -0
- package/dist/os/codebase/types.js +17 -0
- package/dist/os/codebase/types.js.map +1 -0
- package/dist/os/core/handlers/package-health.d.ts +6 -4
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +15 -20
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/correctness/anchors.d.ts +24 -0
- package/dist/os/correctness/anchors.d.ts.map +1 -0
- package/dist/os/correctness/anchors.js +156 -0
- package/dist/os/correctness/anchors.js.map +1 -0
- package/dist/os/correctness/audit/bindings-verify-substance.d.ts +7 -0
- package/dist/os/correctness/audit/bindings-verify-substance.d.ts.map +1 -0
- package/dist/os/correctness/audit/bindings-verify-substance.js +145 -0
- package/dist/os/correctness/audit/bindings-verify-substance.js.map +1 -0
- package/dist/os/correctness/audit/differential.d.ts +7 -0
- package/dist/os/correctness/audit/differential.d.ts.map +1 -0
- package/dist/os/correctness/audit/differential.js +105 -0
- package/dist/os/correctness/audit/differential.js.map +1 -0
- package/dist/os/correctness/audit/ledger-orphans.d.ts +6 -0
- package/dist/os/correctness/audit/ledger-orphans.d.ts.map +1 -0
- package/dist/os/correctness/audit/ledger-orphans.js +71 -0
- package/dist/os/correctness/audit/ledger-orphans.js.map +1 -0
- package/dist/os/correctness/audit/ledger.d.ts +29 -0
- package/dist/os/correctness/audit/ledger.d.ts.map +1 -0
- package/dist/os/correctness/audit/ledger.js +72 -0
- package/dist/os/correctness/audit/ledger.js.map +1 -0
- package/dist/os/correctness/audit/run.d.ts +27 -0
- package/dist/os/correctness/audit/run.d.ts.map +1 -0
- package/dist/os/correctness/audit/run.js +184 -0
- package/dist/os/correctness/audit/run.js.map +1 -0
- package/dist/os/correctness/audit/schema-db.d.ts +32 -0
- package/dist/os/correctness/audit/schema-db.d.ts.map +1 -0
- package/dist/os/correctness/audit/schema-db.js +166 -0
- package/dist/os/correctness/audit/schema-db.js.map +1 -0
- package/dist/os/correctness/audit/snapshot.d.ts +34 -0
- package/dist/os/correctness/audit/snapshot.d.ts.map +1 -0
- package/dist/os/correctness/audit/snapshot.js +190 -0
- package/dist/os/correctness/audit/snapshot.js.map +1 -0
- package/dist/os/correctness/audit/sql-scanner.d.ts +28 -0
- package/dist/os/correctness/audit/sql-scanner.d.ts.map +1 -0
- package/dist/os/correctness/audit/sql-scanner.js +279 -0
- package/dist/os/correctness/audit/sql-scanner.js.map +1 -0
- package/dist/os/correctness/audit/sql-schema-conform.d.ts +17 -0
- package/dist/os/correctness/audit/sql-schema-conform.d.ts.map +1 -0
- package/dist/os/correctness/audit/sql-schema-conform.js +163 -0
- package/dist/os/correctness/audit/sql-schema-conform.js.map +1 -0
- package/dist/os/correctness/audit/state-transitions-coverage.d.ts +19 -0
- package/dist/os/correctness/audit/state-transitions-coverage.d.ts.map +1 -0
- package/dist/os/correctness/audit/state-transitions-coverage.js +263 -0
- package/dist/os/correctness/audit/state-transitions-coverage.js.map +1 -0
- package/dist/os/correctness/audit/tests/git-fixture.d.ts +15 -0
- package/dist/os/correctness/audit/tests/git-fixture.d.ts.map +1 -0
- package/dist/os/correctness/audit/tests/git-fixture.js +85 -0
- package/dist/os/correctness/audit/tests/git-fixture.js.map +1 -0
- package/dist/os/correctness/audit/types.d.ts +58 -0
- package/dist/os/correctness/audit/types.d.ts.map +1 -0
- package/dist/os/correctness/audit/types.js +34 -0
- package/dist/os/correctness/audit/types.js.map +1 -0
- package/dist/os/correctness/correctness.module.d.ts +3 -0
- package/dist/os/correctness/correctness.module.d.ts.map +1 -0
- package/dist/os/correctness/correctness.module.js +173 -0
- package/dist/os/correctness/correctness.module.js.map +1 -0
- package/dist/os/correctness/gate/frozen.d.ts +52 -0
- package/dist/os/correctness/gate/frozen.d.ts.map +1 -0
- package/dist/os/correctness/gate/frozen.js +322 -0
- package/dist/os/correctness/gate/frozen.js.map +1 -0
- package/dist/os/correctness/gate/origin.d.ts +28 -0
- package/dist/os/correctness/gate/origin.d.ts.map +1 -0
- package/dist/os/correctness/gate/origin.js +139 -0
- package/dist/os/correctness/gate/origin.js.map +1 -0
- package/dist/os/correctness/gate/repo.d.ts +25 -0
- package/dist/os/correctness/gate/repo.d.ts.map +1 -0
- package/dist/os/correctness/gate/repo.js +88 -0
- package/dist/os/correctness/gate/repo.js.map +1 -0
- package/dist/os/correctness/gate/run.d.ts +22 -0
- package/dist/os/correctness/gate/run.d.ts.map +1 -0
- package/dist/os/correctness/gate/run.js +430 -0
- package/dist/os/correctness/gate/run.js.map +1 -0
- package/dist/os/correctness/gate/runner.d.ts +18 -0
- package/dist/os/correctness/gate/runner.d.ts.map +1 -0
- package/dist/os/correctness/gate/runner.js +123 -0
- package/dist/os/correctness/gate/runner.js.map +1 -0
- package/dist/os/correctness/gate/tests/gate-fixture.d.ts +36 -0
- package/dist/os/correctness/gate/tests/gate-fixture.d.ts.map +1 -0
- package/dist/os/correctness/gate/tests/gate-fixture.js +153 -0
- package/dist/os/correctness/gate/tests/gate-fixture.js.map +1 -0
- package/dist/os/correctness/gate/types.d.ts +102 -0
- package/dist/os/correctness/gate/types.d.ts.map +1 -0
- package/dist/os/correctness/gate/types.js +64 -0
- package/dist/os/correctness/gate/types.js.map +1 -0
- package/dist/os/correctness/handlers/audit.d.ts +4 -0
- package/dist/os/correctness/handlers/audit.d.ts.map +1 -0
- package/dist/os/correctness/handlers/audit.js +95 -0
- package/dist/os/correctness/handlers/audit.js.map +1 -0
- package/dist/os/correctness/handlers/gate.d.ts +4 -0
- package/dist/os/correctness/handlers/gate.d.ts.map +1 -0
- package/dist/os/correctness/handlers/gate.js +62 -0
- package/dist/os/correctness/handlers/gate.js.map +1 -0
- package/dist/os/correctness/handlers/validate.d.ts +19 -0
- package/dist/os/correctness/handlers/validate.d.ts.map +1 -0
- package/dist/os/correctness/handlers/validate.js +367 -0
- package/dist/os/correctness/handlers/validate.js.map +1 -0
- package/dist/os/correctness/index.d.ts +8 -0
- package/dist/os/correctness/index.d.ts.map +1 -0
- package/dist/os/correctness/index.js +23 -0
- package/dist/os/correctness/index.js.map +1 -0
- package/dist/os/correctness/manifest-schema.d.ts +155 -0
- package/dist/os/correctness/manifest-schema.d.ts.map +1 -0
- package/dist/os/correctness/manifest-schema.js +110 -0
- package/dist/os/correctness/manifest-schema.js.map +1 -0
- package/dist/os/correctness/references.d.ts +22 -0
- package/dist/os/correctness/references.d.ts.map +1 -0
- package/dist/os/correctness/references.js +129 -0
- package/dist/os/correctness/references.js.map +1 -0
- package/dist/os/correctness/tests/fixture-workspace.d.ts +23 -0
- package/dist/os/correctness/tests/fixture-workspace.d.ts.map +1 -0
- package/dist/os/correctness/tests/fixture-workspace.js +104 -0
- package/dist/os/correctness/tests/fixture-workspace.js.map +1 -0
- package/dist/os/correctness/workspace.d.ts +32 -0
- package/dist/os/correctness/workspace.d.ts.map +1 -0
- package/dist/os/correctness/workspace.js +147 -0
- package/dist/os/correctness/workspace.js.map +1 -0
- package/dist/os/flow/correctness-step.d.ts +19 -0
- package/dist/os/flow/correctness-step.d.ts.map +1 -0
- package/dist/os/flow/correctness-step.js +133 -0
- package/dist/os/flow/correctness-step.js.map +1 -0
- package/dist/os/flow/digest.d.ts +18 -0
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +28 -1
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/dirty-classify.d.ts +7 -0
- package/dist/os/flow/dirty-classify.d.ts.map +1 -1
- package/dist/os/flow/dirty-classify.js +11 -0
- package/dist/os/flow/dirty-classify.js.map +1 -1
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +19 -4
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-check.js +9 -9
- package/dist/os/flow/handlers/flow-check.js.map +1 -1
- package/dist/os/flow/handlers/flow-digest.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-digest.js +11 -1
- package/dist/os/flow/handlers/flow-digest.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +11 -0
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +148 -30
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-open.js +14 -19
- package/dist/os/flow/handlers/flow-open.js.map +1 -1
- package/dist/os/flow/index.d.ts +1 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +5 -3
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/post-rebase-regen.d.ts +33 -0
- package/dist/os/flow/post-rebase-regen.d.ts.map +1 -0
- package/dist/os/flow/post-rebase-regen.js +120 -0
- package/dist/os/flow/post-rebase-regen.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +24 -0
- package/dist/os/flow/preflight.d.ts.map +1 -1
- package/dist/os/flow/preflight.js +364 -24
- package/dist/os/flow/preflight.js.map +1 -1
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +23 -4
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +6 -6
- package/dist/os/flow/tests/helpers.d.ts +9 -1
- package/dist/os/flow/tests/helpers.d.ts.map +1 -1
- package/dist/os/flow/tests/helpers.js +36 -2
- package/dist/os/flow/tests/helpers.js.map +1 -1
- package/dist/os/friction/types.d.ts +2 -2
- package/dist/os/gate-run/detach.d.ts +27 -0
- package/dist/os/gate-run/detach.d.ts.map +1 -0
- package/dist/os/gate-run/detach.js +85 -0
- package/dist/os/gate-run/detach.js.map +1 -0
- package/dist/os/gate-run/gate-run.module.d.ts +3 -0
- package/dist/os/gate-run/gate-run.module.d.ts.map +1 -0
- package/dist/os/gate-run/gate-run.module.js +23 -0
- package/dist/os/gate-run/gate-run.module.js.map +1 -0
- package/dist/os/gate-run/index.d.ts +7 -0
- package/dist/os/gate-run/index.d.ts.map +1 -0
- package/dist/os/gate-run/index.js +5 -0
- package/dist/os/gate-run/index.js.map +1 -0
- package/dist/os/gate-run/record.d.ts +47 -0
- package/dist/os/gate-run/record.d.ts.map +1 -0
- package/dist/os/gate-run/record.js +157 -0
- package/dist/os/gate-run/record.js.map +1 -0
- package/dist/os/gate-run/status.d.ts +53 -0
- package/dist/os/gate-run/status.d.ts.map +1 -0
- package/dist/os/gate-run/status.js +163 -0
- package/dist/os/gate-run/status.js.map +1 -0
- package/dist/os/gate-run/types.d.ts +47 -0
- package/dist/os/gate-run/types.d.ts.map +1 -0
- package/dist/os/gate-run/types.js +24 -0
- package/dist/os/gate-run/types.js.map +1 -0
- package/dist/os/program/schemas.d.ts +3 -3
- package/dist/os/queue/types.d.ts +2 -2
- package/dist/os/rfc/evidence-annotation.d.ts +26 -0
- package/dist/os/rfc/evidence-annotation.d.ts.map +1 -0
- package/dist/os/rfc/evidence-annotation.js +52 -0
- package/dist/os/rfc/evidence-annotation.js.map +1 -0
- package/dist/os/rfc/handlers/fixed-inputs.d.ts.map +1 -1
- package/dist/os/rfc/handlers/fixed-inputs.js +7 -1
- package/dist/os/rfc/handlers/fixed-inputs.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-promotes.d.ts +8 -0
- package/dist/os/rfc/handlers/implement-stamp-promotes.d.ts.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-promotes.js +65 -0
- package/dist/os/rfc/handlers/implement-stamp-promotes.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +35 -29
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +152 -11
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +20 -7
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +12 -3
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +5 -2
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verify-workspace.d.ts +12 -0
- package/dist/os/rfc/verify-workspace.d.ts.map +1 -1
- package/dist/os/rfc/verify-workspace.js +155 -0
- package/dist/os/rfc/verify-workspace.js.map +1 -1
- package/dist/os/system/task-schemas.d.ts +1 -1
- package/dist/os/system/tests/helpers.d.ts.map +1 -1
- package/dist/os/system/tests/helpers.js +6 -1
- package/dist/os/system/tests/helpers.js.map +1 -1
- package/dist/os/werkstatt/handlers/schema.d.ts +1 -1
- package/dist/src/cli-flags.d.ts.map +1 -1
- package/dist/src/cli-flags.js +6 -0
- package/dist/src/cli-flags.js.map +1 -1
- package/dist/src/command-modules.d.ts +4 -0
- package/dist/src/command-modules.d.ts.map +1 -0
- package/dist/src/command-modules.js +42 -0
- package/dist/src/command-modules.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +16 -1
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +27 -11
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/correctness/index.d.ts +32 -0
- package/dist/src/correctness/index.d.ts.map +1 -0
- package/dist/src/correctness/index.js +157 -0
- package/dist/src/correctness/index.js.map +1 -0
- package/dist/src/correctness/schema-hash.d.ts +15 -0
- package/dist/src/correctness/schema-hash.d.ts.map +1 -0
- package/dist/src/correctness/schema-hash.js +44 -0
- package/dist/src/correctness/schema-hash.js.map +1 -0
- package/dist/src/knowledge/schema.d.ts +1 -1
- package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/agents-generate.js +20 -3
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/create.d.ts +7 -0
- package/dist/src/onboarding/create.d.ts.map +1 -1
- package/dist/src/onboarding/create.js +62 -9
- package/dist/src/onboarding/create.js.map +1 -1
- package/dist/src/types.d.ts +7 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +2 -8
- package/dist/src/types.js.map +1 -1
- package/docs/reference/correctness-audit.md +91 -0
- package/docs/reference/correctness-gate.md +102 -0
- package/docs/reference/correctness-manifest.md +142 -0
- package/docs/reference/forge-yaml.md +15 -0
- package/os/codebase/codebase.module.ts +57 -0
- package/os/codebase/handlers/codebase-measure-symbols.ts +131 -0
- package/os/codebase/handlers/codebase-measure.ts +503 -0
- package/os/codebase/index.ts +21 -0
- package/os/codebase/types.ts +55 -0
- package/os/core/handlers/package-health.test.ts +24 -2
- package/os/core/handlers/package-health.ts +16 -19
- package/os/correctness/anchors.ts +182 -0
- package/os/correctness/audit/bindings-verify-substance.test.ts +79 -0
- package/os/correctness/audit/bindings-verify-substance.ts +155 -0
- package/os/correctness/audit/differential.test.ts +113 -0
- package/os/correctness/audit/differential.ts +131 -0
- package/os/correctness/audit/ledger-orphans.test.ts +96 -0
- package/os/correctness/audit/ledger-orphans.ts +84 -0
- package/os/correctness/audit/ledger.test.ts +65 -0
- package/os/correctness/audit/ledger.ts +103 -0
- package/os/correctness/audit/run.ts +220 -0
- package/os/correctness/audit/schema-db.ts +208 -0
- package/os/correctness/audit/snapshot.ts +211 -0
- package/os/correctness/audit/sql-scanner.test.ts +84 -0
- package/os/correctness/audit/sql-scanner.ts +289 -0
- package/os/correctness/audit/sql-schema-conform.test.ts +170 -0
- package/os/correctness/audit/sql-schema-conform.ts +178 -0
- package/os/correctness/audit/state-transitions-coverage.test.ts +141 -0
- package/os/correctness/audit/state-transitions-coverage.ts +271 -0
- package/os/correctness/audit/tests/git-fixture.ts +98 -0
- package/os/correctness/audit/types.ts +91 -0
- package/os/correctness/correctness-capture.test.ts +107 -0
- package/os/correctness/correctness-chain.test.ts +232 -0
- package/os/correctness/correctness-coverage.test.ts +86 -0
- package/os/correctness/correctness-mode.test.ts +108 -0
- package/os/correctness/correctness-substrate.test.ts +64 -0
- package/os/correctness/correctness.module.ts +182 -0
- package/os/correctness/gate/anchor-events.test.ts +77 -0
- package/os/correctness/gate/freeze-coverage.test.ts +218 -0
- package/os/correctness/gate/freeze-diff.test.ts +110 -0
- package/os/correctness/gate/frozen.ts +399 -0
- package/os/correctness/gate/gate-mode.test.ts +76 -0
- package/os/correctness/gate/hardening.test.ts +175 -0
- package/os/correctness/gate/oracle-edit.test.ts +83 -0
- package/os/correctness/gate/oracle-origin.test.ts +142 -0
- package/os/correctness/gate/origin.ts +175 -0
- package/os/correctness/gate/repo.ts +102 -0
- package/os/correctness/gate/run.ts +547 -0
- package/os/correctness/gate/runner.ts +136 -0
- package/os/correctness/gate/substrate-attestation.test.ts +71 -0
- package/os/correctness/gate/tests/gate-fixture.ts +205 -0
- package/os/correctness/gate/tier-high.test.ts +92 -0
- package/os/correctness/gate/types.ts +144 -0
- package/os/correctness/handlers/audit.ts +107 -0
- package/os/correctness/handlers/gate.ts +75 -0
- package/os/correctness/handlers/validate.ts +514 -0
- package/os/correctness/index.ts +24 -0
- package/os/correctness/manifest-schema.ts +174 -0
- package/os/correctness/references.ts +143 -0
- package/os/correctness/tests/fixture-workspace.ts +119 -0
- package/os/correctness/workspace.ts +167 -0
- package/os/flow/correctness-step.ts +166 -0
- package/os/flow/digest.ts +40 -1
- package/os/flow/dirty-classify.ts +13 -0
- package/os/flow/flow.module.ts +20 -4
- package/os/flow/handlers/flow-check.ts +17 -18
- package/os/flow/handlers/flow-digest.ts +11 -1
- package/os/flow/handlers/flow-integrate.ts +191 -39
- package/os/flow/handlers/flow-open.ts +24 -31
- package/os/flow/index.ts +5 -7
- package/os/flow/post-rebase-regen.ts +170 -0
- package/os/flow/preflight.ts +361 -27
- package/os/flow/publish.ts +23 -4
- package/os/flow/tests/flow-detachable.test.ts +31 -0
- package/os/flow/tests/flow-digest-correctness-trail.test.ts +55 -0
- package/os/flow/tests/flow-integrate-correctness-gate.test.ts +275 -0
- package/os/flow/tests/flow-integrate.post-rebase-regen.test.ts +234 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +26 -5
- package/os/flow/tests/flow-integrate.test.ts +77 -10
- package/os/flow/tests/helpers.ts +45 -24
- package/os/flow/tests/lockfile-induced.test.ts +328 -0
- package/os/gate-run/detach.ts +106 -0
- package/os/gate-run/gate-run.module.ts +25 -0
- package/os/gate-run/index.ts +16 -0
- package/os/gate-run/record.ts +194 -0
- package/os/gate-run/status.ts +201 -0
- package/os/gate-run/tests/gate-run-detach.test.ts +144 -0
- package/os/gate-run/tests/gate-run-record.test.ts +200 -0
- package/os/gate-run/tests/gate-run-status.test.ts +114 -0
- package/os/gate-run/types.ts +73 -0
- package/os/rfc/evidence-annotation.ts +61 -0
- package/os/rfc/handlers/fixed-inputs.test.ts +70 -0
- package/os/rfc/handlers/fixed-inputs.ts +11 -1
- package/os/rfc/handlers/implement-stamp-promotes.test.ts +214 -0
- package/os/rfc/handlers/implement-stamp-promotes.ts +79 -0
- package/os/rfc/handlers/implement-stamp.ts +40 -29
- package/os/rfc/handlers/list-create.test.ts +14 -5
- package/os/rfc/handlers/validate-evidence-shape.test.ts +218 -0
- package/os/rfc/handlers/validate-probe-meta.test.ts +71 -0
- package/os/rfc/handlers/validate-rules.ts +211 -21
- package/os/rfc/handlers/validate-transient-probes.test.ts +222 -0
- package/os/rfc/rfc-0000-template.md +10 -10
- package/os/rfc/rfc.module.ts +21 -7
- package/os/rfc/types.ts +16 -2
- package/os/rfc/verify-workspace-manifest.test.ts +55 -0
- package/os/rfc/verify-workspace.ts +167 -0
- package/os/system/tests/helpers.ts +6 -1
- package/package.json +57 -1
- package/profiles/typescript.yaml +16 -0
- package/skills/_shared/agent-operating-model.md +4 -0
- package/skills/fo/fo-idea-audit/SKILL.md +4 -0
- package/skills/fo/fo-idea-create-rfc/SKILL.md +6 -2
- package/skills/fo/fo-idea-implement/SKILL.md +8 -2
- package/skills/fo/fo-review/SKILL.md +16 -2
- package/skills/fo/fo-session-retro/SKILL.md +4 -2
- package/src/cli-flags.ts +7 -0
- package/src/command-modules.ts +62 -0
- package/src/config/forge-config.ts +37 -11
- package/src/correctness/index.ts +192 -0
- package/src/correctness/schema-hash.ts +59 -0
- package/src/onboarding/agents-generate.ts +20 -3
- package/src/onboarding/create.ts +59 -9
- package/src/tests/agents-generate-detach.test.ts +126 -0
- package/src/tests/codebase-measure-rfc-1581.test.ts +260 -0
- package/src/tests/command-modules.test.ts +34 -0
- package/src/types.ts +9 -8
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1580: kernel-free test-side helpers (`@warpgogol/forge/correctness`)
|
|
4
|
+
an oracle calls so the correctness gate can see what it actually ran on —
|
|
5
|
+
`attestSubstrate` (schema hash of the handle used), `verifyAnchorEvents`
|
|
6
|
+
(`forge.anchor` log lines checked against that handle), `loadCapture`
|
|
7
|
+
(which capture files were loaded). Without `FORGE_CORRECTNESS_DIR` (ordinary
|
|
8
|
+
`pnpm test`) every helper is a no-op apart from its return value.</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>Never imported by product production code — anchor events are plain JSON log lines.</item>
|
|
11
|
+
<item>No proof of how assertions used the handle — the bundle states that limitation.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<KEY_DECISIONS>
|
|
15
|
+
<item>Identifiers in anchor events must exist in the attested schema; values are bound as parameters, never interpolated.</item>
|
|
16
|
+
<item>Results append to JSON files in the run directory; the gate never reuses a previous run's directory.</item>
|
|
17
|
+
</KEY_DECISIONS>
|
|
18
|
+
<CHANGE_SUMMARY>
|
|
19
|
+
<item>RFC-1580: initial helpers.</item>
|
|
20
|
+
<item>RFC-1580: correctness.gate and the flow.integrate step
|
|
21
|
+
|
|
22
|
+
Add os/correctness/gate (frozen set at --base, weakening diff incl. byte changes without verifier trailers and frozen exempt mode, git-derived oracle origin with forge/oracle-review@1 records, argv oracle runner with timeout, schema-hash substrate attestation, anchor events, tier high/formal, forge/correctness-bundle@1), the correctness.gate command, test-side helpers @warpgogol/forge/correctness, bindings.paths.oracleReviewsDir, and flow.integrate spawning the primary install's gate after hooks/integration-gate.sh (FLOW-INT-18, --accept-weakening with an X-Correctness-Weakening trailer commit). Flow and system test primaries get a stand-in forge binary; integration warnings now survive the cleanup report.</item>
|
|
23
|
+
<item>RFC-1580: close review REVIEW-CODE-2026-11-13-05 findings
|
|
24
|
+
|
|
25
|
+
N1 bootstrap degrade only while the base has not adopted the contour (a forge downgrade refuses); N2 L3 on data/lifecycle counts at its attested level; N3 anchor events bound to the attested handle; N4 new support-glob files are frozen additions; N5/N6 isolated sessions may touch anchor files and only frozen forge.yaml keys; N7 RFC body amended; N8 regression tests; N9 run root in finally and grandchildren reaped; N10 every declared capture loaded. DEV-7 recorded; DEV-5 narrowed pending operator confirmation.</item>
|
|
26
|
+
</CHANGE_SUMMARY>
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { createHash } from "node:crypto";
|
|
30
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
31
|
+
import path from "node:path";
|
|
32
|
+
|
|
33
|
+
import { schemaHashOf, type SchemaHandle } from "./schema-hash.ts";
|
|
34
|
+
|
|
35
|
+
export { normalizeSchemaRows, schemaHashOf } from "./schema-hash.ts";
|
|
36
|
+
export type { SchemaHandle, SchemaRow } from "./schema-hash.ts";
|
|
37
|
+
|
|
38
|
+
export const ATTESTATION_FILE = "attestation.json";
|
|
39
|
+
export const ANCHOR_EVENTS_FILE = "anchor-events.json";
|
|
40
|
+
export const CAPTURES_FILE = "captures.json";
|
|
41
|
+
|
|
42
|
+
export interface SubstrateAttestation {
|
|
43
|
+
level: "L1" | "L2";
|
|
44
|
+
engine: string;
|
|
45
|
+
schemaHash: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface AnchorEventResult {
|
|
49
|
+
anchor: string;
|
|
50
|
+
ok: boolean;
|
|
51
|
+
reason?: string;
|
|
52
|
+
/** Normalized schema hash of the handle the event was verified against. */
|
|
53
|
+
schemaHash?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function runDir(): string | null {
|
|
57
|
+
const dir = process.env["FORGE_CORRECTNESS_DIR"];
|
|
58
|
+
return dir && dir.length > 0 ? dir : null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function appendJson(file: string, items: unknown[]): void {
|
|
62
|
+
const dir = runDir();
|
|
63
|
+
if (!dir) return;
|
|
64
|
+
mkdirSync(dir, { recursive: true });
|
|
65
|
+
const abs = path.join(dir, file);
|
|
66
|
+
let current: unknown[] = [];
|
|
67
|
+
if (existsSync(abs)) {
|
|
68
|
+
try {
|
|
69
|
+
const parsed = JSON.parse(readFileSync(abs, "utf8"));
|
|
70
|
+
if (Array.isArray(parsed)) current = parsed;
|
|
71
|
+
} catch {
|
|
72
|
+
current = [];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
writeFileSync(abs, JSON.stringify([...current, ...items], null, 2));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** L1/L2: hash the normalized live schema of the handle the oracle actually used. */
|
|
79
|
+
export function attestSubstrate(
|
|
80
|
+
db: SchemaHandle,
|
|
81
|
+
meta: { level: "L1" | "L2"; engine: string },
|
|
82
|
+
): SubstrateAttestation {
|
|
83
|
+
const attestation: SubstrateAttestation = {
|
|
84
|
+
level: meta.level,
|
|
85
|
+
engine: meta.engine,
|
|
86
|
+
schemaHash: schemaHashOf(db),
|
|
87
|
+
};
|
|
88
|
+
const dir = runDir();
|
|
89
|
+
if (dir) {
|
|
90
|
+
mkdirSync(dir, { recursive: true });
|
|
91
|
+
writeFileSync(path.join(dir, ATTESTATION_FILE), JSON.stringify(attestation, null, 2));
|
|
92
|
+
}
|
|
93
|
+
return attestation;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface AnchorRef {
|
|
97
|
+
table: string;
|
|
98
|
+
key: Record<string, unknown>;
|
|
99
|
+
column: string;
|
|
100
|
+
value: unknown;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const IDENT_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
104
|
+
|
|
105
|
+
function columnsOf(db: SchemaHandle, table: string): Set<string> | null {
|
|
106
|
+
const tables = (
|
|
107
|
+
db.prepare("SELECT name FROM sqlite_schema WHERE type = 'table'").all() as { name: string }[]
|
|
108
|
+
).map((r) => r.name);
|
|
109
|
+
if (!tables.includes(table)) return null;
|
|
110
|
+
const cols = db.prepare(`PRAGMA table_info("${table}")`).all() as { name: string }[];
|
|
111
|
+
return new Set(cols.map((c) => c.name));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function verifyOne(db: SchemaHandle, anchor: string, ref: unknown): AnchorEventResult {
|
|
115
|
+
const r = ref as Partial<AnchorRef> | null;
|
|
116
|
+
if (
|
|
117
|
+
!r ||
|
|
118
|
+
typeof r.table !== "string" ||
|
|
119
|
+
typeof r.column !== "string" ||
|
|
120
|
+
!r.key ||
|
|
121
|
+
typeof r.key !== "object"
|
|
122
|
+
) {
|
|
123
|
+
return { anchor, ok: false, reason: "event ref needs table, key, column, value" };
|
|
124
|
+
}
|
|
125
|
+
const keyCols = Object.keys(r.key);
|
|
126
|
+
if (keyCols.length === 0) return { anchor, ok: false, reason: "event ref key is empty" };
|
|
127
|
+
for (const ident of [r.table, r.column, ...keyCols]) {
|
|
128
|
+
if (!IDENT_RE.test(ident))
|
|
129
|
+
return {
|
|
130
|
+
anchor,
|
|
131
|
+
ok: false,
|
|
132
|
+
reason: `identifier ${JSON.stringify(ident)} is not a plain SQL name`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const cols = columnsOf(db, r.table);
|
|
136
|
+
if (cols === null)
|
|
137
|
+
return { anchor, ok: false, reason: `table ${r.table} is not in the attested schema` };
|
|
138
|
+
for (const c of [r.column, ...keyCols]) {
|
|
139
|
+
if (!cols.has(c))
|
|
140
|
+
return { anchor, ok: false, reason: `column ${r.table}.${c} is not in the attested schema` };
|
|
141
|
+
}
|
|
142
|
+
const where = keyCols.map((c) => `"${c}" = ?`).join(" AND ");
|
|
143
|
+
const rows = db
|
|
144
|
+
.prepare(`SELECT "${r.column}" AS v FROM "${r.table}" WHERE ${where}`)
|
|
145
|
+
.all(...keyCols.map((c) => (r.key as Record<string, unknown>)[c])) as { v: unknown }[];
|
|
146
|
+
if (rows.length === 0)
|
|
147
|
+
return { anchor, ok: false, reason: `no ${r.table} row matches ${JSON.stringify(r.key)}` };
|
|
148
|
+
const matches = rows.some((row) => row.v === r.value || String(row.v) === String(r.value));
|
|
149
|
+
return matches
|
|
150
|
+
? { anchor, ok: true }
|
|
151
|
+
: {
|
|
152
|
+
anchor,
|
|
153
|
+
ok: false,
|
|
154
|
+
reason: `${r.table}.${r.column} is ${JSON.stringify(rows[0]!.v)}, event claims ${JSON.stringify(r.value)}`,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Collect `forge.anchor` events from captured output and verify each state reference against db. */
|
|
159
|
+
export function verifyAnchorEvents(
|
|
160
|
+
lines: Iterable<string>,
|
|
161
|
+
db: { prepare(sql: string): { all(...params: unknown[]): unknown[] } },
|
|
162
|
+
): AnchorEventResult[] {
|
|
163
|
+
const results: AnchorEventResult[] = [];
|
|
164
|
+
for (const line of lines) {
|
|
165
|
+
const start = line.indexOf("{");
|
|
166
|
+
if (start === -1 || !line.includes("forge.anchor")) continue;
|
|
167
|
+
let event: unknown;
|
|
168
|
+
try {
|
|
169
|
+
event = JSON.parse(line.slice(start));
|
|
170
|
+
} catch {
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const anchor = (event as Record<string, unknown>)?.["forge.anchor"];
|
|
174
|
+
if (typeof anchor !== "string") continue;
|
|
175
|
+
results.push({
|
|
176
|
+
...verifyOne(db, anchor, (event as Record<string, unknown>)["ref"]),
|
|
177
|
+
schemaHash: schemaHashOf(db),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
appendJson(ANCHOR_EVENTS_FILE, results);
|
|
181
|
+
return results;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Record which capture files the oracle loaded (provider seams); returns the parsed JSON. */
|
|
185
|
+
export function loadCapture(capturePath: string): unknown {
|
|
186
|
+
const bytes = readFileSync(capturePath);
|
|
187
|
+
const rel = path.relative(process.cwd(), path.resolve(capturePath)).replace(/\\/g, "/");
|
|
188
|
+
appendJson(CAPTURES_FILE, [
|
|
189
|
+
{ path: rel, sha256: createHash("sha256").update(bytes).digest("hex") },
|
|
190
|
+
]);
|
|
191
|
+
return JSON.parse(bytes.toString("utf8"));
|
|
192
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1580: normalized live-schema hash shared by the test-side
|
|
4
|
+
attestation helper and the correctness gate — `SELECT type, name, sql FROM
|
|
5
|
+
sqlite_schema`, engine tables dropped (`sqlite_%`, `_cf_%`, `d1_migrations`),
|
|
6
|
+
whitespace collapsed, trailing semicolons stripped, sorted by type and name,
|
|
7
|
+
sha256 over the rows. Miniflare / local D1 handles hash like node:sqlite.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>No kernel or forge-os imports — this module ships in the test-side export.</item>
|
|
10
|
+
</non-goals>
|
|
11
|
+
</MODULE_CONTRACT>
|
|
12
|
+
<CHANGE_SUMMARY>
|
|
13
|
+
<item>RFC-1580: initial normalization.</item>
|
|
14
|
+
<item>RFC-1580: correctness.gate and the flow.integrate step
|
|
15
|
+
|
|
16
|
+
Add os/correctness/gate (frozen set at --base, weakening diff incl. byte changes without verifier trailers and frozen exempt mode, git-derived oracle origin with forge/oracle-review@1 records, argv oracle runner with timeout, schema-hash substrate attestation, anchor events, tier high/formal, forge/correctness-bundle@1), the correctness.gate command, test-side helpers @warpgogol/forge/correctness, bindings.paths.oracleReviewsDir, and flow.integrate spawning the primary install's gate after hooks/integration-gate.sh (FLOW-INT-18, --accept-weakening with an X-Correctness-Weakening trailer commit). Flow and system test primaries get a stand-in forge binary; integration warnings now survive the cleanup report.</item>
|
|
17
|
+
</CHANGE_SUMMARY>
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { createHash } from "node:crypto";
|
|
21
|
+
|
|
22
|
+
export interface SchemaRow {
|
|
23
|
+
type: string;
|
|
24
|
+
name: string;
|
|
25
|
+
sql: string | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Minimal handle shape: better-sqlite3, node:sqlite, and D1-over-miniflare adapters all fit. */
|
|
29
|
+
export interface SchemaHandle {
|
|
30
|
+
prepare(sql: string): { all(...params: unknown[]): unknown[] };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const ENGINE_NAME_RE = /^(?:sqlite_|_cf_)|^d1_migrations$/i;
|
|
34
|
+
|
|
35
|
+
export function normalizeSchemaRows(rows: SchemaRow[]): string {
|
|
36
|
+
return rows
|
|
37
|
+
.filter((r) => !ENGINE_NAME_RE.test(r.name))
|
|
38
|
+
.map((r) => ({
|
|
39
|
+
type: r.type,
|
|
40
|
+
name: r.name,
|
|
41
|
+
sql: (r.sql ?? "")
|
|
42
|
+
.replace(/\s+/g, " ")
|
|
43
|
+
.trim()
|
|
44
|
+
.replace(/;+\s*$/, ""),
|
|
45
|
+
}))
|
|
46
|
+
.sort((a, b) => a.type.localeCompare(b.type) || a.name.localeCompare(b.name))
|
|
47
|
+
.map((r) => `${r.type}\t${r.name}\t${r.sql}`)
|
|
48
|
+
.join("\n");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function schemaRowsOf(db: SchemaHandle): SchemaRow[] {
|
|
52
|
+
return db.prepare("SELECT type, name, sql FROM sqlite_schema").all() as SchemaRow[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function schemaHashOf(db: SchemaHandle): string {
|
|
56
|
+
return createHash("sha256")
|
|
57
|
+
.update(normalizeSchemaRows(schemaRowsOf(db)))
|
|
58
|
+
.digest("hex");
|
|
59
|
+
}
|
|
@@ -7,14 +7,18 @@
|
|
|
7
7
|
</non-goals>
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>RFC-1255: Single blank line after the generated header — header ends in a newline so "\n\n" produced two blank lines that prettier collapsed, ping-ponging doctor's stale check. wsTypes resolution moved to shared resolveWorkspaceTypes.</item>
|
|
11
|
-
<item>RFC-1365: step 4 — DNA-115, CONF-* remediation entries, agents-generate convention section</item>
|
|
12
10
|
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
13
11
|
<item>RFC-1500: step 4 — branch-model AGENTS section and consumer docs</item>
|
|
14
12
|
<item>RFC-1539: amend dna-55 and dna-115 for published spec packages
|
|
15
13
|
|
|
16
14
|
Guides, fo-spec-ingest routing, command descriptions and regenerated command docs, remediation entries for SPEC-15..18 and CONF-07..09; resyncs the stale .agents fo-system-dispatch mirror (ADR-0126 source line).</item>
|
|
17
|
-
<
|
|
15
|
+
<item>RFC-1573: step 6 — detach line in generated Branch model section
|
|
16
|
+
|
|
17
|
+
forge.agents.generate lists detachable forge commands from their declarations and points agents at gate.run.status --wait.</item>
|
|
18
|
+
<item>RFC-1573: close review REVIEW-CODE-2026-11-12-01 findings
|
|
19
|
+
|
|
20
|
+
Restore same-line pkg-health-10 suppressions in forge bin/cli.ts (prettier-ignore) and revert unrelated registry.ts reflows; DETACH-01 also matches call sites (slice cap cut mission.close off before runMissionValidate); exempt marker anchored to a non-global line-comment regex; live-source test pins entrypoint resolution and the flow.cut/mission.close negative control; command-modules test; AC-8 literal comment; RFC Deviations DEV-1..3.</item>
|
|
21
|
+
<history>RFC-0391, RFC-0393, RFC-0548, RFC-0549, RFC-0551, RFC-0611, RFC-0640, RFC-0643, RFC-0664, RFC-1097, RFC-1253, RFC-1255, RFC-1365</history>
|
|
18
22
|
</CHANGE_SUMMARY>
|
|
19
23
|
*/
|
|
20
24
|
|
|
@@ -436,6 +440,19 @@ export async function runAgentsGenerate(
|
|
|
436
440
|
dynamicLines.push(`- Every session starts with \`${prefix} flow.open --kind session --slug <slug>\`; work and commit only in the returned worktree. The guard refuses commits on \`develop\` and \`main\`.`);
|
|
437
441
|
dynamicLines.push(`- \`${prefix} flow.integrate --branch <name>\` (operator) rebases, gates and fast-forwards \`develop\`; \`${prefix} flow.discard\` drops a session.`);
|
|
438
442
|
dynamicLines.push(`- Releases are \`${prefix} flow.cut\` (repository line) and \`${prefix} flow.cut --lines <line>\` (package lines); nothing leaves the machine except \`${prefix} flow.push --digest <id>\` after the operator has read \`${prefix} flow.digest\`.`);
|
|
443
|
+
// RFC-1573: the detachable set comes from the command declarations
|
|
444
|
+
// (one module list shared with bin/cli.ts), never a hand-kept copy.
|
|
445
|
+
const { loadForgeCommandModules } = await import("../command-modules.ts");
|
|
446
|
+
const detachable = (await loadForgeCommandModules())
|
|
447
|
+
.flatMap((m) => m.commands)
|
|
448
|
+
.filter((c) => c.detachable === true)
|
|
449
|
+
.map((c) => c.name)
|
|
450
|
+
.sort();
|
|
451
|
+
if (detachable.length > 0) {
|
|
452
|
+
const list = detachable.map((n) => `\`${n}\``).join(", ");
|
|
453
|
+
// The tail is a plain string on purpose: RFC-1573 AC-8 probes this source for the unescaped literal.
|
|
454
|
+
dynamicLines.push(`- Multi-minute commands (${list}) take \`--detach\`: it prints a run id and returns at once; then \`${prefix} gate.run.status --id <runId> --wait 600\`. Exit 0 from \`--detach\` means started, not passed — read \`data.runs[0].status\`.` + " Never a background shell or `timeout`.");
|
|
455
|
+
}
|
|
439
456
|
dynamicLines.push("- Never edit `forge/registry.yaml`, `forge/journal.jsonl` or `forge/*.lock` in the git directory.");
|
|
440
457
|
dynamicLines.push("");
|
|
441
458
|
}
|
package/src/onboarding/create.ts
CHANGED
|
@@ -9,22 +9,24 @@
|
|
|
9
9
|
</non-goals>
|
|
10
10
|
</MODULE_CONTRACT>
|
|
11
11
|
<CHANGE_SUMMARY>
|
|
12
|
-
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
13
|
-
|
|
14
|
-
Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
|
|
15
|
-
<item>RFC-1097: sweep — packages/forge + services clean
|
|
16
|
-
|
|
17
|
-
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
18
|
-
<item>RFC-1224: preserve operator forge.yaml content on upgrade, promote adrImplementStamp binding</item>
|
|
19
12
|
<item>RFC-1500: step 2 — forge.create adopts the fixed branch model</item>
|
|
20
13
|
<item>RFC-1500: link branch-model guide in committed NEXT_STEPS.md (review r1)</item>
|
|
21
|
-
<
|
|
14
|
+
<item>RFC-1578: correctness manifest, validator, promotes gate
|
|
15
|
+
|
|
16
|
+
Add os/correctness (forge/correctness-manifest@1, correctness.manifest.validate CORR-01..09), bindings.paths.correctnessManifest, bindings.commands.checkRun and the correctness section, promotes with V-55 and RFC-IMP-16, the typescript profile skeleton, reference pages, and the promotes marking in fo-idea-create-rfc/fo-idea-audit. Repoint the RFC-1391 AC-8 registry test at src/command-modules.ts (stale since RFC-1573) and close the types.ts header comment without a glob-shaped terminator (EC-33).</item>
|
|
17
|
+
<item>RFC-1578: close review REVIEW-CODE-2026-11-12-08 findings
|
|
18
|
+
|
|
19
|
+
F1 code-only anchor scan (markdown fences never declare anchors); F2 generated index as a re-verified hint, scan on any miss; F3 RFC-IMP-16 asserted through rfc.implement.stamp; F4 forge create patches only absent/null keys; F5 type: refs normalized; F6/F10/F11 capture existence via existsSync, future recordedAt and workspace-escaping paths are CORR-07; F7 V-55 reuses criteriaEval; F8 validator inventory regenerated; F9 binding-driven reads; F12 git listing, index hint, create patch tests; DEV-1 single sidecar spelling; DEV-2 output field dropped.</item>
|
|
20
|
+
<item>RFC-1578: close review REVIEW-CODE-2026-11-12-09 findings
|
|
21
|
+
|
|
22
|
+
N1 index-hint rows count only for files in the workspace listing; N2 forge create leaves exempt repositories unbound; N3 listing test stages a file. Record DEV-3/DEV-4 amendments (CORR-07 future/escaping captures, index as re-verified hint) in the RFC Deviations section.</item>
|
|
23
|
+
<history>RFC-0544, RFC-0548, RFC-0550, RFC-0640, RFC-0643, RFC-0664, RFC-0877, RFC-1097, RFC-1224</history>
|
|
22
24
|
</CHANGE_SUMMARY>
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
import path from "node:path";
|
|
26
28
|
import { resolveIo } from "../utils/io.ts";
|
|
27
|
-
import { stringify as stringifyYaml } from "yaml";
|
|
29
|
+
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
28
30
|
import { runScaffoldProject } from "./scaffold-project.ts";
|
|
29
31
|
import { runInit, type InitResult, type InitDomainFields } from "./init.ts";
|
|
30
32
|
import { runAgentsGenerate } from "./agents-generate.ts";
|
|
@@ -36,6 +38,7 @@ import {
|
|
|
36
38
|
resolveForgeRoot,
|
|
37
39
|
resolvePackageManager,
|
|
38
40
|
applyCliBindingDefaults,
|
|
41
|
+
type ForgeYamlPatch,
|
|
39
42
|
} from "../config/forge-config.ts";
|
|
40
43
|
import { listStackProfiles } from "../profiles/stack-profile.ts";
|
|
41
44
|
import type {
|
|
@@ -126,6 +129,35 @@ function toKebabCase(s: string): string {
|
|
|
126
129
|
*/
|
|
127
130
|
const ALLOWED_EXISTING_DIRS = new Set([".git"]);
|
|
128
131
|
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* RFC-1578: bind a profile-shipped correctness manifest in forge.yaml — only
|
|
135
|
+
* keys that are absent or null are written, so an operator-set
|
|
136
|
+
* `correctnessManifest`, `correctness.mode`, or `correctness.tier` survives.
|
|
137
|
+
* Returns null when nothing needs patching (or the document cannot be patched).
|
|
138
|
+
*/
|
|
139
|
+
export function correctnessBindingPatch(raw: string, manifestRel: string): string | null {
|
|
140
|
+
let current: Record<string, unknown> = {};
|
|
141
|
+
try {
|
|
142
|
+
current = (parseYaml(raw) ?? {}) as Record<string, unknown>;
|
|
143
|
+
} catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const bindingsPaths = ((current["bindings"] as Record<string, unknown> | undefined)?.["paths"] ??
|
|
147
|
+
{}) as Record<string, unknown>;
|
|
148
|
+
const section = (current["correctness"] ?? {}) as Record<string, unknown>;
|
|
149
|
+
// An exempt repository declares no manifest (CORR-02) — leave it untouched.
|
|
150
|
+
if (section["mode"] === "exempt") return null;
|
|
151
|
+
const patches: ForgeYamlPatch[] = [];
|
|
152
|
+
if (bindingsPaths["correctnessManifest"] == null) {
|
|
153
|
+
patches.push({ path: ["bindings", "paths", "correctnessManifest"], value: manifestRel });
|
|
154
|
+
}
|
|
155
|
+
if (section["mode"] == null) patches.push({ path: ["correctness", "mode"], value: "warn" });
|
|
156
|
+
if (section["tier"] == null) patches.push({ path: ["correctness", "tier"], value: "standard" });
|
|
157
|
+
if (patches.length === 0) return null;
|
|
158
|
+
return applyForgeYamlPatches(raw, patches);
|
|
159
|
+
}
|
|
160
|
+
|
|
129
161
|
export async function runCreate(
|
|
130
162
|
input: ForgeCommandInput,
|
|
131
163
|
context: ForgeRuntimeContext,
|
|
@@ -383,6 +415,24 @@ export async function runCreate(
|
|
|
383
415
|
}
|
|
384
416
|
}
|
|
385
417
|
|
|
418
|
+
// 11.5. RFC-1578: a profile that ships docs/correctness.yaml binds it — profiles
|
|
419
|
+
// cannot write forge.yaml themselves, so the manifest binding and the default
|
|
420
|
+
// correctness section are patched in here (mode warn until the product's own
|
|
421
|
+
// retrofit flips enforce).
|
|
422
|
+
{
|
|
423
|
+
const forgeYamlPath = path.join(targetDir, "forge.yaml");
|
|
424
|
+
const manifestRel = "docs/correctness.yaml";
|
|
425
|
+
if ((await fio.exists(path.join(targetDir, manifestRel))) && (await fio.exists(forgeYamlPath))) {
|
|
426
|
+
try {
|
|
427
|
+
const raw = await fio.readFile(forgeYamlPath);
|
|
428
|
+
const patched = correctnessBindingPatch(raw, manifestRel);
|
|
429
|
+
if (patched !== null) await fio.writeFile(forgeYamlPath, patched);
|
|
430
|
+
} catch {
|
|
431
|
+
// Best-effort like step 11 — correctness.manifest.validate reports CORR-01 when unbound.
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
386
436
|
// 12. Auto-run forge.agents.generate (RFC-0548)
|
|
387
437
|
try {
|
|
388
438
|
const agentsInput: ForgeCommandInput = {
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1573 AC-8 — forge.agents.generate emits the detach line in the
|
|
4
|
+
"Branch model" section of flow-adopted repositories, listing the detachable
|
|
5
|
+
forge commands from their declarations; unadopted repositories get none.</purpose>
|
|
6
|
+
<non-goals>
|
|
7
|
+
<item>Not the branch-model section itself — agents-generate-flow.test.ts pins that.</item>
|
|
8
|
+
</non-goals>
|
|
9
|
+
</MODULE_CONTRACT>
|
|
10
|
+
*/
|
|
11
|
+
// Test-Reason: requirement AC-8 (RFC-1573)
|
|
12
|
+
import { execFileSync } from "node:child_process";
|
|
13
|
+
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
14
|
+
import { tmpdir } from "node:os";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
17
|
+
import { runAgentsGenerate } from "../onboarding/agents-generate.ts";
|
|
18
|
+
import { runFlowInstall } from "../../os/flow/handlers/flow-install.ts";
|
|
19
|
+
import type { ForgeRuntimeContext } from "../types.ts";
|
|
20
|
+
|
|
21
|
+
const silentLogger = {
|
|
22
|
+
section: () => {},
|
|
23
|
+
info: () => {},
|
|
24
|
+
warn: () => {},
|
|
25
|
+
error: () => {},
|
|
26
|
+
success: () => {},
|
|
27
|
+
};
|
|
28
|
+
const FORGE_ROOT = join(import.meta.dirname, "..", "..");
|
|
29
|
+
const FORGE_YAML = `schema: forge/config@1
|
|
30
|
+
project:
|
|
31
|
+
name: consumer-project
|
|
32
|
+
stack: []
|
|
33
|
+
packageManager: pnpm
|
|
34
|
+
paths:
|
|
35
|
+
rfcsDir: docs/rfcs
|
|
36
|
+
adrsDir: docs/adrs
|
|
37
|
+
plansDir: docs/plans
|
|
38
|
+
auditsDir: docs/audits
|
|
39
|
+
specsDir: docs/specs
|
|
40
|
+
skillsDir: .agents/skills
|
|
41
|
+
sessionsDir: docs/sessions
|
|
42
|
+
bindings:
|
|
43
|
+
schema: forge/bindings@1
|
|
44
|
+
commands:
|
|
45
|
+
validateRfc: "pnpm exec forge rfc.validate --id {id} --json"
|
|
46
|
+
validateAdr: null
|
|
47
|
+
implementStamp: null
|
|
48
|
+
typecheck: null
|
|
49
|
+
test: null
|
|
50
|
+
scopedBuild: null
|
|
51
|
+
specValidate: null
|
|
52
|
+
sessionSave: null
|
|
53
|
+
paths:
|
|
54
|
+
invariantsFile: null
|
|
55
|
+
compassDocs: []
|
|
56
|
+
reviewsDir: null
|
|
57
|
+
handoffsDir: null
|
|
58
|
+
sessionsDir: null
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
function git(dir: string, args: string[]): string {
|
|
62
|
+
return execFileSync("git", ["-C", dir, ...args], { encoding: "utf8" }).trim();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function makeContext(workspaceRoot: string): ForgeRuntimeContext {
|
|
66
|
+
return {
|
|
67
|
+
workspaceRoot,
|
|
68
|
+
logger: silentLogger as never,
|
|
69
|
+
dryRun: false,
|
|
70
|
+
outputFormat: "json",
|
|
71
|
+
forgeRoot: FORGE_ROOT,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function initRepo(dir: string): Promise<void> {
|
|
76
|
+
git(dir, ["init", "--initial-branch=main"]);
|
|
77
|
+
git(dir, ["config", "user.name", "Flow Test"]);
|
|
78
|
+
git(dir, ["config", "user.email", "flow-test@example.invalid"]);
|
|
79
|
+
await writeFile(join(dir, "forge.yaml"), FORGE_YAML, "utf8");
|
|
80
|
+
await writeFile(
|
|
81
|
+
join(dir, "package.json"),
|
|
82
|
+
JSON.stringify({ name: "consumer-project", version: "0.1.0" }),
|
|
83
|
+
"utf8",
|
|
84
|
+
);
|
|
85
|
+
git(dir, ["add", "-A"]);
|
|
86
|
+
git(dir, ["commit", "-m", "chore: consumer scaffold"]);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let repoDir: string;
|
|
90
|
+
beforeEach(async () => {
|
|
91
|
+
repoDir = await mkdtemp(join(tmpdir(), "agents-detach-test-"));
|
|
92
|
+
});
|
|
93
|
+
afterEach(async () => {
|
|
94
|
+
await rm(repoDir, { recursive: true, force: true });
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe("RFC-1573: agents.generate detach line (AC-8)", () => {
|
|
98
|
+
test("adopted repository lists detachable commands and gate.run.status", async () => {
|
|
99
|
+
await initRepo(repoDir);
|
|
100
|
+
expect((await runFlowInstall({ argv: [], flags: {} }, makeContext(repoDir))).exitCode).toBe(0);
|
|
101
|
+
expect((await runAgentsGenerate({ argv: [], flags: {} }, makeContext(repoDir))).exitCode).toBe(
|
|
102
|
+
0,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const agentsMd = await readFile(join(repoDir, "AGENTS.md"), "utf8");
|
|
106
|
+
const line = agentsMd.split("\n").find((l) => l.startsWith("- Multi-minute commands ("));
|
|
107
|
+
expect(line, "Branch model section must carry the RFC-1573 detach line").toBeDefined();
|
|
108
|
+
for (const name of ["flow.cut", "flow.backmerge", "flow.integrate", "rfc.implement.stamp"]) {
|
|
109
|
+
expect(line, `detach list must include ${name} (declared detachable)`).toContain(
|
|
110
|
+
`\`${name}\``,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
expect(line).not.toContain("`flow.open`");
|
|
114
|
+
expect(line).toContain("pnpm exec forge gate.run.status --id <runId> --wait 600");
|
|
115
|
+
expect(line).toContain("Never a background shell or `timeout`.");
|
|
116
|
+
}, 60000);
|
|
117
|
+
|
|
118
|
+
test("unadopted repository gets no detach line", async () => {
|
|
119
|
+
await initRepo(repoDir);
|
|
120
|
+
expect((await runAgentsGenerate({ argv: [], flags: {} }, makeContext(repoDir))).exitCode).toBe(
|
|
121
|
+
0,
|
|
122
|
+
);
|
|
123
|
+
const agentsMd = await readFile(join(repoDir, "AGENTS.md"), "utf8");
|
|
124
|
+
expect(agentsMd).not.toContain("- Multi-minute commands (");
|
|
125
|
+
}, 60000);
|
|
126
|
+
});
|