@webpieces/ai-hook-rules 0.4.839 → 0.4.841
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/README.md +12 -140
- package/package.json +7 -15
- package/src/adapters/hook-app-fixtures.d.ts +1 -1
- package/src/adapters/hook-app-fixtures.js +0 -8
- package/src/adapters/hook-app-fixtures.js.map +1 -1
- package/src/adapters/hook-core.d.ts +1 -21
- package/src/adapters/hook-core.js +22 -341
- package/src/adapters/hook-core.js.map +1 -1
- package/src/core/load-rules.d.ts +4 -39
- package/src/core/load-rules.js +15 -127
- package/src/core/load-rules.js.map +1 -1
- package/src/core/rules/catch-error-pattern.d.ts +3 -3
- package/src/core/rules/catch-error-pattern.js +13 -13
- package/src/core/rules/catch-error-pattern.js.map +1 -1
- package/src/core/rules/index.d.ts +1 -14
- package/src/core/rules/index.js +1 -17
- package/src/core/rules/index.js.map +1 -1
- package/src/core/rules/match-rule.d.ts +3 -3
- package/src/core/rules/match-rule.js +6 -6
- package/src/core/rules/match-rule.js.map +1 -1
- package/src/core/rules/max-file-lines.d.ts +3 -3
- package/src/core/rules/max-file-lines.js +7 -7
- package/src/core/rules/max-file-lines.js.map +1 -1
- package/src/core/rules/no-any-unknown.d.ts +3 -3
- package/src/core/rules/no-any-unknown.js +6 -6
- package/src/core/rules/no-any-unknown.js.map +1 -1
- package/src/core/rules/no-custom-css.d.ts +3 -3
- package/src/core/rules/no-custom-css.js +7 -7
- package/src/core/rules/no-custom-css.js.map +1 -1
- package/src/core/rules/no-destructure.d.ts +3 -3
- package/src/core/rules/no-destructure.js +7 -7
- package/src/core/rules/no-destructure.js.map +1 -1
- package/src/core/rules/no-implicit-any.d.ts +3 -3
- package/src/core/rules/no-implicit-any.js +6 -6
- package/src/core/rules/no-implicit-any.js.map +1 -1
- package/src/core/rules/no-js-files.d.ts +3 -3
- package/src/core/rules/no-js-files.js +6 -6
- package/src/core/rules/no-js-files.js.map +1 -1
- package/src/core/rules/no-process-exit-outside-main.d.ts +3 -3
- package/src/core/rules/no-process-exit-outside-main.js +7 -7
- package/src/core/rules/no-process-exit-outside-main.js.map +1 -1
- package/src/core/rules/no-symbol-di-tokens.d.ts +3 -3
- package/src/core/rules/no-symbol-di-tokens.js +7 -7
- package/src/core/rules/no-symbol-di-tokens.js.map +1 -1
- package/src/core/rules/no-unmanaged-exceptions.d.ts +3 -3
- package/src/core/rules/no-unmanaged-exceptions.js +9 -9
- package/src/core/rules/no-unmanaged-exceptions.js.map +1 -1
- package/src/core/rules/require-return-type.d.ts +3 -3
- package/src/core/rules/require-return-type.js +6 -6
- package/src/core/rules/require-return-type.js.map +1 -1
- package/src/core/rules/throw-cause-required.d.ts +3 -3
- package/src/core/rules/throw-cause-required.js +9 -9
- package/src/core/rules/throw-cause-required.js.map +1 -1
- package/src/core/rules/validate-ts-in-src.d.ts +3 -3
- package/src/core/rules/validate-ts-in-src.js +7 -7
- package/src/core/rules/validate-ts-in-src.js.map +1 -1
- package/src/core/runner.d.ts +10 -19
- package/src/core/runner.js +24 -622
- package/src/core/runner.js.map +1 -1
- package/src/index.d.ts +2 -15
- package/src/index.js +4 -54
- package/src/index.js.map +1 -1
- package/openclaw.plugin.json +0 -15
- package/src/adapters/agent-adapters.d.ts +0 -13
- package/src/adapters/agent-adapters.js +0 -23
- package/src/adapters/agent-adapters.js.map +0 -1
- package/src/adapters/agent-payload.d.ts +0 -48
- package/src/adapters/agent-payload.js +0 -30
- package/src/adapters/agent-payload.js.map +0 -1
- package/src/adapters/agent-response.d.ts +0 -5
- package/src/adapters/agent-response.js +0 -86
- package/src/adapters/agent-response.js.map +0 -1
- package/src/adapters/claude-code-adapter.d.ts +0 -26
- package/src/adapters/claude-code-adapter.js +0 -69
- package/src/adapters/claude-code-adapter.js.map +0 -1
- package/src/adapters/codex-adapter.d.ts +0 -19
- package/src/adapters/codex-adapter.js +0 -48
- package/src/adapters/codex-adapter.js.map +0 -1
- package/src/adapters/codex-subagent-guard.d.ts +0 -45
- package/src/adapters/codex-subagent-guard.js +0 -88
- package/src/adapters/codex-subagent-guard.js.map +0 -1
- package/src/adapters/detect-ai.d.ts +0 -70
- package/src/adapters/detect-ai.js +0 -82
- package/src/adapters/detect-ai.js.map +0 -1
- package/src/adapters/guards-hook.d.ts +0 -3
- package/src/adapters/guards-hook.js +0 -30
- package/src/adapters/guards-hook.js.map +0 -1
- package/src/adapters/openclaw-plugin.d.ts +0 -14
- package/src/adapters/openclaw-plugin.js +0 -87
- package/src/adapters/openclaw-plugin.js.map +0 -1
- package/src/adapters/review-identity-stamper.d.ts +0 -20
- package/src/adapters/review-identity-stamper.js +0 -34
- package/src/adapters/review-identity-stamper.js.map +0 -1
- package/src/bin/codex-trust.d.ts +0 -105
- package/src/bin/codex-trust.js +0 -205
- package/src/bin/codex-trust.js.map +0 -1
- package/src/bin/dev-hook-install.d.ts +0 -1
- package/src/bin/dev-hook-install.js +0 -82
- package/src/bin/dev-hook-install.js.map +0 -1
- package/src/bin/dev-hook-uninstall.d.ts +0 -1
- package/src/bin/dev-hook-uninstall.js +0 -45
- package/src/bin/dev-hook-uninstall.js.map +0 -1
- package/src/bin/hook-registration.d.ts +0 -429
- package/src/bin/hook-registration.js +0 -661
- package/src/bin/hook-registration.js.map +0 -1
- package/src/bin/install-entry.d.ts +0 -19
- package/src/bin/install-entry.js +0 -128
- package/src/bin/install-entry.js.map +0 -1
- package/src/bin/l0-allowlist.d.ts +0 -49
- package/src/bin/l0-allowlist.js +0 -528
- package/src/bin/l0-allowlist.js.map +0 -1
- package/src/bin/l0-codex-read.d.ts +0 -21
- package/src/bin/l0-codex-read.js +0 -109
- package/src/bin/l0-codex-read.js.map +0 -1
- package/src/bin/l0-decide.d.ts +0 -50
- package/src/bin/l0-decide.js +0 -103
- package/src/bin/l0-decide.js.map +0 -1
- package/src/bin/l0-entry.d.ts +0 -103
- package/src/bin/l0-entry.js +0 -98
- package/src/bin/l0-entry.js.map +0 -1
- package/src/bin/l0-ignored-tools.d.ts +0 -38
- package/src/bin/l0-ignored-tools.js +0 -44
- package/src/bin/l0-ignored-tools.js.map +0 -1
- package/src/bin/managed-env.d.ts +0 -46
- package/src/bin/managed-env.js +0 -50
- package/src/bin/managed-env.js.map +0 -1
- package/src/bin/neighbour-hooks.d.ts +0 -42
- package/src/bin/neighbour-hooks.js +0 -177
- package/src/bin/neighbour-hooks.js.map +0 -1
- package/src/bin/reviewer-agent.d.ts +0 -19
- package/src/bin/reviewer-agent.js +0 -135
- package/src/bin/reviewer-agent.js.map +0 -1
- package/src/bin/settings-shape.d.ts +0 -37
- package/src/bin/settings-shape.js +0 -17
- package/src/bin/settings-shape.js.map +0 -1
- package/src/bin/setup-config.d.ts +0 -19
- package/src/bin/setup-config.js +0 -370
- package/src/bin/setup-config.js.map +0 -1
- package/src/bin/setup.d.ts +0 -78
- package/src/bin/setup.js +0 -400
- package/src/bin/setup.js.map +0 -1
- package/src/bin/shim-audit-log.d.ts +0 -119
- package/src/bin/shim-audit-log.js +0 -286
- package/src/bin/shim-audit-log.js.map +0 -1
- package/src/bin/shim-deny-reason.d.ts +0 -1
- package/src/bin/shim-deny-reason.js +0 -244
- package/src/bin/shim-deny-reason.js.map +0 -1
- package/src/bin/shim-drift-fix.d.ts +0 -1
- package/src/bin/shim-drift-fix.js +0 -72
- package/src/bin/shim-drift-fix.js.map +0 -1
- package/src/bin/shim-testkit.d.ts +0 -107
- package/src/bin/shim-testkit.js +0 -197
- package/src/bin/shim-testkit.js.map +0 -1
- package/src/bin/shim-version-drift.d.ts +0 -1
- package/src/bin/shim-version-drift.js +0 -164
- package/src/bin/shim-version-drift.js.map +0 -1
- package/src/bin/shim.d.ts +0 -16
- package/src/bin/shim.js +0 -636
- package/src/bin/shim.js.map +0 -1
- package/src/bin/upgrade-shim.d.ts +0 -18
- package/src/bin/upgrade-shim.js +0 -283
- package/src/bin/upgrade-shim.js.map +0 -1
- package/src/core/ai-type-context.d.ts +0 -36
- package/src/core/ai-type-context.js +0 -45
- package/src/core/ai-type-context.js.map +0 -1
- package/src/core/apply-patch-parse.d.ts +0 -36
- package/src/core/apply-patch-parse.js +0 -154
- package/src/core/apply-patch-parse.js.map +0 -1
- package/src/core/build-context.d.ts +0 -10
- package/src/core/build-context.js +0 -66
- package/src/core/build-context.js.map +0 -1
- package/src/core/command-scan.d.ts +0 -122
- package/src/core/command-scan.js +0 -282
- package/src/core/command-scan.js.map +0 -1
- package/src/core/custom-rule-adapter.d.ts +0 -22
- package/src/core/custom-rule-adapter.js +0 -50
- package/src/core/custom-rule-adapter.js.map +0 -1
- package/src/core/decision-log.d.ts +0 -190
- package/src/core/decision-log.js +0 -406
- package/src/core/decision-log.js.map +0 -1
- package/src/core/delete-scoped-rules.d.ts +0 -8
- package/src/core/delete-scoped-rules.js +0 -31
- package/src/core/delete-scoped-rules.js.map +0 -1
- package/src/core/disable-directives.d.ts +0 -8
- package/src/core/disable-directives.js +0 -80
- package/src/core/disable-directives.js.map +0 -1
- package/src/core/effective-tree.d.ts +0 -204
- package/src/core/effective-tree.js +0 -277
- package/src/core/effective-tree.js.map +0 -1
- package/src/core/excluded-path-escape.d.ts +0 -101
- package/src/core/excluded-path-escape.js +0 -236
- package/src/core/excluded-path-escape.js.map +0 -1
- package/src/core/excluded-paths.d.ts +0 -23
- package/src/core/excluded-paths.js +0 -54
- package/src/core/excluded-paths.js.map +0 -1
- package/src/core/fix-hint.d.ts +0 -40
- package/src/core/fix-hint.js +0 -53
- package/src/core/fix-hint.js.map +0 -1
- package/src/core/force-to-root.d.ts +0 -32
- package/src/core/force-to-root.js +0 -60
- package/src/core/force-to-root.js.map +0 -1
- package/src/core/guard-index-doc.d.ts +0 -63
- package/src/core/guard-index-doc.js +0 -172
- package/src/core/guard-index-doc.js.map +0 -1
- package/src/core/instruct-ai-writer.d.ts +0 -1
- package/src/core/instruct-ai-writer.js +0 -6
- package/src/core/instruct-ai-writer.js.map +0 -1
- package/src/core/l0-fault-codes.d.ts +0 -85
- package/src/core/l0-fault-codes.js +0 -121
- package/src/core/l0-fault-codes.js.map +0 -1
- package/src/core/l0-matrix.d.ts +0 -114
- package/src/core/l0-matrix.js +0 -416
- package/src/core/l0-matrix.js.map +0 -1
- package/src/core/l0-tooling-doc.d.ts +0 -45
- package/src/core/l0-tooling-doc.js +0 -258
- package/src/core/l0-tooling-doc.js.map +0 -1
- package/src/core/l1-doc.d.ts +0 -7
- package/src/core/l1-doc.js +0 -340
- package/src/core/l1-doc.js.map +0 -1
- package/src/core/l1-matrix-doc.d.ts +0 -31
- package/src/core/l1-matrix-doc.js +0 -111
- package/src/core/l1-matrix-doc.js.map +0 -1
- package/src/core/l1-rows.d.ts +0 -167
- package/src/core/l1-rows.js +0 -262
- package/src/core/l1-rows.js.map +0 -1
- package/src/core/l2-doc.d.ts +0 -7
- package/src/core/l2-doc.js +0 -385
- package/src/core/l2-doc.js.map +0 -1
- package/src/core/l2-matrix-doc.d.ts +0 -23
- package/src/core/l2-matrix-doc.js +0 -72
- package/src/core/l2-matrix-doc.js.map +0 -1
- package/src/core/l2-row.d.ts +0 -54
- package/src/core/l2-row.js +0 -75
- package/src/core/l2-row.js.map +0 -1
- package/src/core/l2-rows.d.ts +0 -56
- package/src/core/l2-rows.js +0 -272
- package/src/core/l2-rows.js.map +0 -1
- package/src/core/load-config.d.ts +0 -1
- package/src/core/load-config.js +0 -9
- package/src/core/load-config.js.map +0 -1
- package/src/core/log-stream.d.ts +0 -117
- package/src/core/log-stream.js +0 -156
- package/src/core/log-stream.js.map +0 -1
- package/src/core/log-streams.d.ts +0 -48
- package/src/core/log-streams.js +0 -55
- package/src/core/log-streams.js.map +0 -1
- package/src/core/log-target.d.ts +0 -21
- package/src/core/log-target.js +0 -29
- package/src/core/log-target.js.map +0 -1
- package/src/core/main-sync-log.d.ts +0 -16
- package/src/core/main-sync-log.js +0 -105
- package/src/core/main-sync-log.js.map +0 -1
- package/src/core/main-sync-refresh.d.ts +0 -39
- package/src/core/main-sync-refresh.js +0 -96
- package/src/core/main-sync-refresh.js.map +0 -1
- package/src/core/main-sync-timeout.d.ts +0 -32
- package/src/core/main-sync-timeout.js +0 -94
- package/src/core/main-sync-timeout.js.map +0 -1
- package/src/core/matrix-cures.d.ts +0 -12
- package/src/core/matrix-cures.js +0 -56
- package/src/core/matrix-cures.js.map +0 -1
- package/src/core/missing-directory.d.ts +0 -38
- package/src/core/missing-directory.js +0 -66
- package/src/core/missing-directory.js.map +0 -1
- package/src/core/read-only-inspection.d.ts +0 -34
- package/src/core/read-only-inspection.js +0 -88
- package/src/core/read-only-inspection.js.map +0 -1
- package/src/core/rejection-log.d.ts +0 -9
- package/src/core/rejection-log.js +0 -258
- package/src/core/rejection-log.js.map +0 -1
- package/src/core/report.d.ts +0 -21
- package/src/core/report.js +0 -73
- package/src/core/report.js.map +0 -1
- package/src/core/rule-base.d.ts +0 -39
- package/src/core/rule-base.js +0 -36
- package/src/core/rule-base.js.map +0 -1
- package/src/core/rules/branch-creation-guard.d.ts +0 -113
- package/src/core/rules/branch-creation-guard.js +0 -422
- package/src/core/rules/branch-creation-guard.js.map +0 -1
- package/src/core/rules/branch-switch-scan.d.ts +0 -43
- package/src/core/rules/branch-switch-scan.js +0 -132
- package/src/core/rules/branch-switch-scan.js.map +0 -1
- package/src/core/rules/build-output-pipe-guard.d.ts +0 -56
- package/src/core/rules/build-output-pipe-guard.js +0 -120
- package/src/core/rules/build-output-pipe-guard.js.map +0 -1
- package/src/core/rules/build-output-pipe-scan.d.ts +0 -47
- package/src/core/rules/build-output-pipe-scan.js +0 -84
- package/src/core/rules/build-output-pipe-scan.js.map +0 -1
- package/src/core/rules/cap-remedies.d.ts +0 -39
- package/src/core/rules/cap-remedies.js +0 -59
- package/src/core/rules/cap-remedies.js.map +0 -1
- package/src/core/rules/commit-message-substitution-guard.d.ts +0 -72
- package/src/core/rules/commit-message-substitution-guard.js +0 -134
- package/src/core/rules/commit-message-substitution-guard.js.map +0 -1
- package/src/core/rules/commit-message-substitution-scan.d.ts +0 -42
- package/src/core/rules/commit-message-substitution-scan.js +0 -145
- package/src/core/rules/commit-message-substitution-scan.js.map +0 -1
- package/src/core/rules/content-read-scan.d.ts +0 -76
- package/src/core/rules/content-read-scan.js +0 -176
- package/src/core/rules/content-read-scan.js.map +0 -1
- package/src/core/rules/cure-prefix-scan.d.ts +0 -64
- package/src/core/rules/cure-prefix-scan.js +0 -133
- package/src/core/rules/cure-prefix-scan.js.map +0 -1
- package/src/core/rules/feature-branch-guard.d.ts +0 -121
- package/src/core/rules/feature-branch-guard.js +0 -326
- package/src/core/rules/feature-branch-guard.js.map +0 -1
- package/src/core/rules/judged-tree.d.ts +0 -66
- package/src/core/rules/judged-tree.js +0 -97
- package/src/core/rules/judged-tree.js.map +0 -1
- package/src/core/rules/main-freshness.d.ts +0 -37
- package/src/core/rules/main-freshness.js +0 -61
- package/src/core/rules/main-freshness.js.map +0 -1
- package/src/core/rules/merge-in-progress-guard.d.ts +0 -17
- package/src/core/rules/merge-in-progress-guard.js +0 -122
- package/src/core/rules/merge-in-progress-guard.js.map +0 -1
- package/src/core/rules/merged-branch-bash-guard.d.ts +0 -62
- package/src/core/rules/merged-branch-bash-guard.js +0 -170
- package/src/core/rules/merged-branch-bash-guard.js.map +0 -1
- package/src/core/rules/merged-branch-message.d.ts +0 -59
- package/src/core/rules/merged-branch-message.js +0 -137
- package/src/core/rules/merged-branch-message.js.map +0 -1
- package/src/core/rules/pr-creation-or-push-guard.d.ts +0 -26
- package/src/core/rules/pr-creation-or-push-guard.js +0 -146
- package/src/core/rules/pr-creation-or-push-guard.js.map +0 -1
- package/src/core/rules/pr-merge-guard.d.ts +0 -36
- package/src/core/rules/pr-merge-guard.js +0 -86
- package/src/core/rules/pr-merge-guard.js.map +0 -1
- package/src/core/rules/read-stale-guard.d.ts +0 -136
- package/src/core/rules/read-stale-guard.js +0 -326
- package/src/core/rules/read-stale-guard.js.map +0 -1
- package/src/core/rules/recovery-allowlist.d.ts +0 -49
- package/src/core/rules/recovery-allowlist.js +0 -187
- package/src/core/rules/recovery-allowlist.js.map +0 -1
- package/src/core/rules/redirect-how-to-merge-main.d.ts +0 -16
- package/src/core/rules/redirect-how-to-merge-main.js +0 -157
- package/src/core/rules/redirect-how-to-merge-main.js.map +0 -1
- package/src/core/rules/shell-segment-scan.d.ts +0 -64
- package/src/core/rules/shell-segment-scan.js +0 -88
- package/src/core/rules/shell-segment-scan.js.map +0 -1
- package/src/core/rules/stale-main-bash-guard.d.ts +0 -198
- package/src/core/rules/stale-main-bash-guard.js +0 -361
- package/src/core/rules/stale-main-bash-guard.js.map +0 -1
- package/src/core/rules/stale-main-message.d.ts +0 -62
- package/src/core/rules/stale-main-message.js +0 -102
- package/src/core/rules/stale-main-message.js.map +0 -1
- package/src/core/rules/tree-recovery.d.ts +0 -92
- package/src/core/rules/tree-recovery.js +0 -165
- package/src/core/rules/tree-recovery.js.map +0 -1
- package/src/core/rules/wait-spin-guard.d.ts +0 -128
- package/src/core/rules/wait-spin-guard.js +0 -211
- package/src/core/rules/wait-spin-guard.js.map +0 -1
- package/src/core/rules/wait-spin-scan.d.ts +0 -118
- package/src/core/rules/wait-spin-scan.js +0 -203
- package/src/core/rules/wait-spin-scan.js.map +0 -1
- package/src/core/rules/whole-repo-build-guard.d.ts +0 -125
- package/src/core/rules/whole-repo-build-guard.js +0 -257
- package/src/core/rules/whole-repo-build-guard.js.map +0 -1
- package/src/core/rules/whole-repo-build-scan.d.ts +0 -28
- package/src/core/rules/whole-repo-build-scan.js +0 -198
- package/src/core/rules/whole-repo-build-scan.js.map +0 -1
- package/src/core/session-call-history.d.ts +0 -44
- package/src/core/session-call-history.js +0 -79
- package/src/core/session-call-history.js.map +0 -1
- package/src/core/shell-read-parity.d.ts +0 -56
- package/src/core/shell-read-parity.js +0 -155
- package/src/core/shell-read-parity.js.map +0 -1
- package/src/core/strip-ts-noise.d.ts +0 -1
- package/src/core/strip-ts-noise.js +0 -185
- package/src/core/strip-ts-noise.js.map +0 -1
- package/src/core/sync-main.d.ts +0 -46
- package/src/core/sync-main.js +0 -175
- package/src/core/sync-main.js.map +0 -1
- package/src/core/target-tree.d.ts +0 -84
- package/src/core/target-tree.js +0 -148
- package/src/core/target-tree.js.map +0 -1
- package/src/core/to-error.d.ts +0 -5
- package/src/core/to-error.js +0 -37
- package/src/core/to-error.js.map +0 -1
- package/src/core/types.d.ts +0 -152
- package/src/core/types.js +0 -200
- package/src/core/types.js.map +0 -1
- package/src/core/version-sync.d.ts +0 -219
- package/src/core/version-sync.js +0 -558
- package/src/core/version-sync.js.map +0 -1
- package/src/core/webpieces-versions.d.ts +0 -98
- package/src/core/webpieces-versions.js +0 -206
- package/src/core/webpieces-versions.js.map +0 -1
- package/templates/ai-hook.sh +0 -497
- package/templates/claude-settings-hook.json +0 -28
- package/templates/webpieces-reviewer.md +0 -60
package/src/core/l2-row.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/** Which tools a row covers. `B` Bash · `R` Read · `E` Write/Edit. */
|
|
2
|
-
export type L2Tool = 'B' | 'R' | 'E';
|
|
3
|
-
/** What L2 does with a row — the same action codebook every layer reports in (GUARD_MATRIX.md). */
|
|
4
|
-
export type L2ActionKind = 'allow' | 'exempt' | 'block' | 'fail-open';
|
|
5
|
-
/**
|
|
6
|
-
* The TERMINAL fail-open row, and the one number in this table that is not from the 1-10 design.
|
|
7
|
-
*
|
|
8
|
-
* Everything in rows 6-10 needs the asynchronously refreshed cache, so the first call can have no
|
|
9
|
-
* data. It is 11 rather than a renumbered 6 because row numbers are logged identity.
|
|
10
|
-
*/
|
|
11
|
-
export declare const L2_FAIL_OPEN_ROW = 11;
|
|
12
|
-
/** The `act` cell: the doc's literal label, plus the machine-readable kind behind it. */
|
|
13
|
-
export declare class L2Action {
|
|
14
|
-
readonly label: string;
|
|
15
|
-
readonly kind: L2ActionKind;
|
|
16
|
-
constructor(label: string, kind: L2ActionKind);
|
|
17
|
-
}
|
|
18
|
-
export declare const L2_ALLOW: L2Action;
|
|
19
|
-
export declare const L2_EXEMPT: L2Action;
|
|
20
|
-
export declare const L2_BLOCK: L2Action;
|
|
21
|
-
export declare const L2_FAIL_OPEN: L2Action;
|
|
22
|
-
/** One observed situation in L2's generated use-case table. */
|
|
23
|
-
export declare class L2UseCase {
|
|
24
|
-
readonly num: number;
|
|
25
|
-
readonly symptom: string;
|
|
26
|
-
readonly state: string;
|
|
27
|
-
readonly verdict: string;
|
|
28
|
-
readonly fix: string;
|
|
29
|
-
readonly reason: string;
|
|
30
|
-
constructor(num: number, symptom: string, state: string, verdict: string, fix: string, reason: string);
|
|
31
|
-
}
|
|
32
|
-
/** A use case that is not an L2 row exit, and therefore has no reason-to-row join. */
|
|
33
|
-
export declare const NO_ROW_EXIT = "NO_ROW_EXIT (not an L2 row exit \u2014 another layer owns this state)";
|
|
34
|
-
/** One row of L2's first-match-wins decision table. */
|
|
35
|
-
export declare class L2Row {
|
|
36
|
-
readonly num: number;
|
|
37
|
-
readonly tools: readonly L2Tool[];
|
|
38
|
-
/** The `state` cell, verbatim. */
|
|
39
|
-
readonly state: string;
|
|
40
|
-
readonly action: L2Action;
|
|
41
|
-
/** The `cure` cell, verbatim. `—` when the row allows. */
|
|
42
|
-
readonly cure: string;
|
|
43
|
-
/** A required non-empty tuple: every row must document at least one observed use case. */
|
|
44
|
-
readonly useCases: readonly [L2UseCase, ...L2UseCase[]];
|
|
45
|
-
constructor(num: number, tools: readonly L2Tool[],
|
|
46
|
-
/** The `state` cell, verbatim. */
|
|
47
|
-
state: string, action: L2Action,
|
|
48
|
-
/** The `cure` cell, verbatim. `—` when the row allows. */
|
|
49
|
-
cure: string,
|
|
50
|
-
/** A required non-empty tuple: every row must document at least one observed use case. */
|
|
51
|
-
useCases: readonly [L2UseCase, ...L2UseCase[]]);
|
|
52
|
-
/** `B R E`, the doc's own spelling of the tool cell. */
|
|
53
|
-
toolCell(): string;
|
|
54
|
-
}
|
package/src/core/l2-row.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.L2Row = exports.NO_ROW_EXIT = exports.L2UseCase = exports.L2_FAIL_OPEN = exports.L2_BLOCK = exports.L2_EXEMPT = exports.L2_ALLOW = exports.L2Action = exports.L2_FAIL_OPEN_ROW = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The TERMINAL fail-open row, and the one number in this table that is not from the 1-10 design.
|
|
6
|
-
*
|
|
7
|
-
* Everything in rows 6-10 needs the asynchronously refreshed cache, so the first call can have no
|
|
8
|
-
* data. It is 11 rather than a renumbered 6 because row numbers are logged identity.
|
|
9
|
-
*/
|
|
10
|
-
exports.L2_FAIL_OPEN_ROW = 11;
|
|
11
|
-
/** The `act` cell: the doc's literal label, plus the machine-readable kind behind it. */
|
|
12
|
-
class L2Action {
|
|
13
|
-
label;
|
|
14
|
-
kind;
|
|
15
|
-
constructor(label, kind) {
|
|
16
|
-
this.label = label;
|
|
17
|
-
this.kind = kind;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.L2Action = L2Action;
|
|
21
|
-
exports.L2_ALLOW = new L2Action('1 allow', 'allow');
|
|
22
|
-
exports.L2_EXEMPT = new L2Action('2 exempt', 'exempt');
|
|
23
|
-
exports.L2_BLOCK = new L2Action('4 block', 'block');
|
|
24
|
-
exports.L2_FAIL_OPEN = new L2Action('1 allow (fail-open)', 'fail-open');
|
|
25
|
-
/** One observed situation in L2's generated use-case table. */
|
|
26
|
-
class L2UseCase {
|
|
27
|
-
num;
|
|
28
|
-
symptom;
|
|
29
|
-
state;
|
|
30
|
-
verdict;
|
|
31
|
-
fix;
|
|
32
|
-
reason;
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/max-params -- four verbatim doc cells plus the reason behind them
|
|
34
|
-
constructor(num, symptom, state, verdict, fix, reason) {
|
|
35
|
-
this.num = num;
|
|
36
|
-
this.symptom = symptom;
|
|
37
|
-
this.state = state;
|
|
38
|
-
this.verdict = verdict;
|
|
39
|
-
this.fix = fix;
|
|
40
|
-
this.reason = reason;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.L2UseCase = L2UseCase;
|
|
44
|
-
/** A use case that is not an L2 row exit, and therefore has no reason-to-row join. */
|
|
45
|
-
exports.NO_ROW_EXIT = 'NO_ROW_EXIT (not an L2 row exit — another layer owns this state)';
|
|
46
|
-
/** One row of L2's first-match-wins decision table. */
|
|
47
|
-
class L2Row {
|
|
48
|
-
num;
|
|
49
|
-
tools;
|
|
50
|
-
state;
|
|
51
|
-
action;
|
|
52
|
-
cure;
|
|
53
|
-
useCases;
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/max-params -- the five cells of one doc row plus its use cases
|
|
55
|
-
constructor(num, tools,
|
|
56
|
-
/** The `state` cell, verbatim. */
|
|
57
|
-
state, action,
|
|
58
|
-
/** The `cure` cell, verbatim. `—` when the row allows. */
|
|
59
|
-
cure,
|
|
60
|
-
/** A required non-empty tuple: every row must document at least one observed use case. */
|
|
61
|
-
useCases) {
|
|
62
|
-
this.num = num;
|
|
63
|
-
this.tools = tools;
|
|
64
|
-
this.state = state;
|
|
65
|
-
this.action = action;
|
|
66
|
-
this.cure = cure;
|
|
67
|
-
this.useCases = useCases;
|
|
68
|
-
}
|
|
69
|
-
/** `B R E`, the doc's own spelling of the tool cell. */
|
|
70
|
-
toolCell() {
|
|
71
|
-
return this.tools.join(' ');
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.L2Row = L2Row;
|
|
75
|
-
//# sourceMappingURL=l2-row.js.map
|
package/src/core/l2-row.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"l2-row.js","sourceRoot":"","sources":["../../../../../../packages/tooling/ai-hook-rules/src/core/l2-row.ts"],"names":[],"mappings":";;;AAMA;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAEnC,yFAAyF;AACzF,MAAa,QAAQ;IACI;IAAwB;IAA7C,YAAqB,KAAa,EAA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J,wDAAwD;IACxD,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;CACJ;AAlBD,sBAkBC","sourcesContent":["/** Which tools a row covers. `B` Bash · `R` Read · `E` Write/Edit. */\nexport type L2Tool = 'B' | 'R' | 'E';\n\n/** What L2 does with a row — the same action codebook every layer reports in (GUARD_MATRIX.md). */\nexport type L2ActionKind = 'allow' | 'exempt' | 'block' | 'fail-open';\n\n/**\n * The TERMINAL fail-open row, and the one number in this table that is not from the 1-10 design.\n *\n * Everything in rows 6-10 needs the asynchronously refreshed cache, so the first call can have no\n * data. It is 11 rather than a renumbered 6 because row numbers are logged identity.\n */\nexport const L2_FAIL_OPEN_ROW = 11;\n\n/** The `act` cell: the doc's literal label, plus the machine-readable kind behind it. */\nexport class L2Action {\n constructor(readonly label: string, readonly kind: L2ActionKind) {}\n}\n\nexport const L2_ALLOW = new L2Action('1 allow', 'allow');\nexport const L2_EXEMPT = new L2Action('2 exempt', 'exempt');\nexport const L2_BLOCK = new L2Action('4 block', 'block');\nexport const L2_FAIL_OPEN = new L2Action('1 allow (fail-open)', 'fail-open');\n\n/** One observed situation in L2's generated use-case table. */\nexport class L2UseCase {\n // eslint-disable-next-line @typescript-eslint/max-params -- four verbatim doc cells plus the reason behind them\n constructor(\n readonly num: number,\n readonly symptom: string,\n readonly state: string,\n readonly verdict: string,\n readonly fix: string,\n readonly reason: string,\n ) {}\n}\n\n/** A use case that is not an L2 row exit, and therefore has no reason-to-row join. */\nexport const NO_ROW_EXIT = 'NO_ROW_EXIT (not an L2 row exit — another layer owns this state)';\n\n/** One row of L2's first-match-wins decision table. */\nexport class L2Row {\n // eslint-disable-next-line @typescript-eslint/max-params -- the five cells of one doc row plus its use cases\n constructor(\n readonly num: number,\n readonly tools: readonly L2Tool[],\n /** The `state` cell, verbatim. */\n readonly state: string,\n readonly action: L2Action,\n /** The `cure` cell, verbatim. `—` when the row allows. */\n readonly cure: string,\n /** A required non-empty tuple: every row must document at least one observed use case. */\n readonly useCases: readonly [L2UseCase, ...L2UseCase[]],\n ) {}\n\n /** `B R E`, the doc's own spelling of the tool cell. */\n toolCell(): string {\n return this.tools.join(' ');\n }\n}\n"]}
|
package/src/core/l2-rows.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { L2Row, L2UseCase } from './l2-row';
|
|
2
|
-
export { L2Action, L2ActionKind, L2Tool, L2_ALLOW, L2_BLOCK, L2_EXEMPT, L2_FAIL_OPEN, L2_FAIL_OPEN_ROW, L2Row, L2UseCase, NO_ROW_EXIT, } from './l2-row';
|
|
3
|
-
/**
|
|
4
|
-
* THE THIRTEEN L2 ROWS, in first-match-wins order.
|
|
5
|
-
*
|
|
6
|
-
* Rows 1-5 need NO cache and fire on call #1: rows 1, 2 and 4 are text matches, row 3 is a marker-file
|
|
7
|
-
* scan, row 5 is one `git rev-parse`. Row 11 is the cache divider. Rows 6-10 all read the cache.
|
|
8
|
-
*
|
|
9
|
-
* THE ORDER OF ROW 5 IS THE MOST LOAD-BEARING THING IN THIS TABLE. Put "on main" BELOW the divider and
|
|
10
|
-
* WRITES on `main` are permitted for the whole first call of every session — and permanently in a
|
|
11
|
-
* multi-worktree repo, where another tree may hold the cache lock indefinitely.
|
|
12
|
-
*
|
|
13
|
-
* `B` AND `E` PART COMPANY ON `main`, and rows 5/6/7 are where. A WRITE on `main` is wrong at any
|
|
14
|
-
* freshness — the work lands somewhere unreviewable and unrevertable — so row 5 is `E` only, judged on
|
|
15
|
-
* the branch alone, above the divider. A READ or a BUILD on a CURRENT `main` is harmless, and blocking
|
|
16
|
-
* it strands the agent right after `pnpm wp-sync-main` put it there; so `B` joins `R` on the
|
|
17
|
-
* FRESHNESS-gated pair below the divider (row 6 behind → block, row 7 current → allow), where "cannot
|
|
18
|
-
* tell" fails open at row 11 by construction. `B` and `R` still differ in SHAPE inside row 6: a Read
|
|
19
|
-
* names one file and is judged precisely, a Bash command is opaque and gets default-deny plus row 4.
|
|
20
|
-
*/
|
|
21
|
-
export declare const L2_ROWS: readonly L2Row[];
|
|
22
|
-
/**
|
|
23
|
-
* Every use case on every row, in row order, for the doc and for the exhaustiveness specs.
|
|
24
|
-
*
|
|
25
|
-
* Numbering is GLOBAL and is identity, exactly as the row numbers are: a use case is cited by number in
|
|
26
|
-
* review and in the doc, so add new ones at the END of the highest number rather than renumbering to
|
|
27
|
-
* keep a row's block contiguous.
|
|
28
|
-
*/
|
|
29
|
-
export declare function allL2UseCases(): readonly L2UseCase[];
|
|
30
|
-
/**
|
|
31
|
-
* The row a logged reason belongs to, or null when nothing claims it.
|
|
32
|
-
*
|
|
33
|
-
* Null rather than a default row: a reason with no row is a HOLE in the table, and defaulting it to
|
|
34
|
-
* "fail-open" would hide exactly the drift the exhaustiveness spec exists to catch. The guards render
|
|
35
|
-
* null as `row=-`, so an unmapped reason is visible in the log too, not only in CI.
|
|
36
|
-
*/
|
|
37
|
-
export declare function l2RowForReason(reason: string): number | null;
|
|
38
|
-
/** Every reason string this table claims, for the exhaustiveness spec. */
|
|
39
|
-
export declare function l2MappedReasons(): readonly string[];
|
|
40
|
-
/** One documented gap between a row and what the guards actually do today. Data-only. */
|
|
41
|
-
export declare class L2NotDone {
|
|
42
|
-
readonly row: number;
|
|
43
|
-
readonly gap: string;
|
|
44
|
-
readonly why: string;
|
|
45
|
-
constructor(row: number, gap: string, why: string);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* WHERE THE TABLE AND THE CODE DISAGREE, stated rather than papered over.
|
|
49
|
-
*
|
|
50
|
-
* The L1 precedent is `## Not done — \`o\` is not exempt yet`: a row the runner cannot reach, named in
|
|
51
|
-
* the generated doc with the reason it has not shipped. The same treatment applies here, and it is what
|
|
52
|
-
* makes it safe to publish a table the guards do not yet dispatch from — a reader is told exactly which
|
|
53
|
-
* rows describe intent rather than behaviour, and the log's `row=` stamps land on row 11 for every one
|
|
54
|
-
* of these, so the trail never claims the strict row fired.
|
|
55
|
-
*/
|
|
56
|
-
export declare const NOT_DONE: readonly L2NotDone[];
|
package/src/core/l2-rows.js
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ---------------------------------------------------------------------------
|
|
3
|
-
// L2 — the BRANCH-STATE layer, as data.
|
|
4
|
-
//
|
|
5
|
-
// L2 answers one question: *may I work here, and is what I read current?* Drawn as a decision matrix
|
|
6
|
-
// that is TWELVE ordered rows plus one terminal fail-open row, first match wins.
|
|
7
|
-
//
|
|
8
|
-
// This module holds those rows, l2-doc.ts renders them into guards/L2-branch-state.md, and a unit test
|
|
9
|
-
// (l2-matrix.spec.ts) locks that file byte-identical to the renderer — the same mechanism that already
|
|
10
|
-
// makes L0's fault table and L1's location table undriftable. Before this existed the L2 doc was 100%
|
|
11
|
-
// hand-written and said so: *"Until that lands this text is hand-written and can drift."*
|
|
12
|
-
//
|
|
13
|
-
// ## HOW L2 JOINS TO THE ROWS TODAY — read this before assuming it works like L1
|
|
14
|
-
//
|
|
15
|
-
// L1 DISPATCHES from its array: `runner.l1LocationBlock` takes the first matching row and switches on
|
|
16
|
-
// its `blockId`, so deleting a row deletes a block. L2 does NOT, and pretending otherwise would be the
|
|
17
|
-
// drift this table exists to remove. The four L2 guard classes each own their own ladder, and those
|
|
18
|
-
// ladders diverge on purpose (guards/L2-branch-state.md, "Deliberate divergence": the two Bash guards
|
|
19
|
-
// differ in polarity, quantifier and empty-command handling all at once, so no single parameterised
|
|
20
|
-
// function serves both). Unifying them is where a wrong edit turns an allow into a session-wedging
|
|
21
|
-
// block, so it is deliberately not attempted here.
|
|
22
|
-
//
|
|
23
|
-
// What L2 does instead is a REASON→ROW join. Every exit of every L2 guard already carries a stable
|
|
24
|
-
// reason string into the decision log; `L2_ROW_FOR_REASON` maps each of those to the row it is an
|
|
25
|
-
// instance of, the guards stamp that number as `row=`, and l2-matrix.spec.ts asserts the map is
|
|
26
|
-
// EXHAUSTIVE against the guard sources — a new reason with no row fails the build. So `row=8` in
|
|
27
|
-
// `.webpieces/logs/L2-decisions` opens guards/L2-branch-state.md at row 8 and reads the state, the cure
|
|
28
|
-
// and the tools that row covers, exactly as `row=5` already does for L1.
|
|
29
|
-
//
|
|
30
|
-
// The rows the guards cannot yet honour are named in the doc's "Not done" section rather than quietly
|
|
31
|
-
// rendered as if they were live. That section is generated from NOT_DONE below, so it cannot rot.
|
|
32
|
-
//
|
|
33
|
-
// This module is deliberately import-free at runtime, so `pnpm guards:generate` can load it without the
|
|
34
|
-
// package's transitive dependencies.
|
|
35
|
-
// ---------------------------------------------------------------------------
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.NOT_DONE = exports.L2NotDone = exports.L2_ROWS = exports.NO_ROW_EXIT = exports.L2UseCase = exports.L2Row = exports.L2_FAIL_OPEN_ROW = exports.L2_FAIL_OPEN = exports.L2_EXEMPT = exports.L2_BLOCK = exports.L2_ALLOW = exports.L2Action = void 0;
|
|
38
|
-
exports.allL2UseCases = allL2UseCases;
|
|
39
|
-
exports.l2RowForReason = l2RowForReason;
|
|
40
|
-
exports.l2MappedReasons = l2MappedReasons;
|
|
41
|
-
const l2_row_1 = require("./l2-row");
|
|
42
|
-
var l2_row_2 = require("./l2-row");
|
|
43
|
-
Object.defineProperty(exports, "L2Action", { enumerable: true, get: function () { return l2_row_2.L2Action; } });
|
|
44
|
-
Object.defineProperty(exports, "L2_ALLOW", { enumerable: true, get: function () { return l2_row_2.L2_ALLOW; } });
|
|
45
|
-
Object.defineProperty(exports, "L2_BLOCK", { enumerable: true, get: function () { return l2_row_2.L2_BLOCK; } });
|
|
46
|
-
Object.defineProperty(exports, "L2_EXEMPT", { enumerable: true, get: function () { return l2_row_2.L2_EXEMPT; } });
|
|
47
|
-
Object.defineProperty(exports, "L2_FAIL_OPEN", { enumerable: true, get: function () { return l2_row_2.L2_FAIL_OPEN; } });
|
|
48
|
-
Object.defineProperty(exports, "L2_FAIL_OPEN_ROW", { enumerable: true, get: function () { return l2_row_2.L2_FAIL_OPEN_ROW; } });
|
|
49
|
-
Object.defineProperty(exports, "L2Row", { enumerable: true, get: function () { return l2_row_2.L2Row; } });
|
|
50
|
-
Object.defineProperty(exports, "L2UseCase", { enumerable: true, get: function () { return l2_row_2.L2UseCase; } });
|
|
51
|
-
Object.defineProperty(exports, "NO_ROW_EXIT", { enumerable: true, get: function () { return l2_row_2.NO_ROW_EXIT; } });
|
|
52
|
-
/**
|
|
53
|
-
* THE THIRTEEN L2 ROWS, in first-match-wins order.
|
|
54
|
-
*
|
|
55
|
-
* Rows 1-5 need NO cache and fire on call #1: rows 1, 2 and 4 are text matches, row 3 is a marker-file
|
|
56
|
-
* scan, row 5 is one `git rev-parse`. Row 11 is the cache divider. Rows 6-10 all read the cache.
|
|
57
|
-
*
|
|
58
|
-
* THE ORDER OF ROW 5 IS THE MOST LOAD-BEARING THING IN THIS TABLE. Put "on main" BELOW the divider and
|
|
59
|
-
* WRITES on `main` are permitted for the whole first call of every session — and permanently in a
|
|
60
|
-
* multi-worktree repo, where another tree may hold the cache lock indefinitely.
|
|
61
|
-
*
|
|
62
|
-
* `B` AND `E` PART COMPANY ON `main`, and rows 5/6/7 are where. A WRITE on `main` is wrong at any
|
|
63
|
-
* freshness — the work lands somewhere unreviewable and unrevertable — so row 5 is `E` only, judged on
|
|
64
|
-
* the branch alone, above the divider. A READ or a BUILD on a CURRENT `main` is harmless, and blocking
|
|
65
|
-
* it strands the agent right after `pnpm wp-sync-main` put it there; so `B` joins `R` on the
|
|
66
|
-
* FRESHNESS-gated pair below the divider (row 6 behind → block, row 7 current → allow), where "cannot
|
|
67
|
-
* tell" fails open at row 11 by construction. `B` and `R` still differ in SHAPE inside row 6: a Read
|
|
68
|
-
* names one file and is judged precisely, a Bash command is opaque and gets default-deny plus row 4.
|
|
69
|
-
*/
|
|
70
|
-
exports.L2_ROWS = [
|
|
71
|
-
new l2_row_1.L2Row(1, ['B', 'R', 'E'], 'on the **global allowlist** (inert command, or a universal cure such as reading/editing `webpieces.config.json`)', l2_row_1.L2_ALLOW, '—', [
|
|
72
|
-
new l2_row_1.L2UseCase(1, 'You are blocked by some other L2 row, and need to turn the policy off to get anything done', 'any state — this row is ahead of every block', 'ALLOW: reading and editing `webpieces.config.json` is never blocked, so the mode-OFF cure is always reachable', 'Edit `webpieces.config.json` → `hookGuards` → `branch-state-guard` → `"mode": "OFF"`', 'webpieces-config-read (escape hatch)'),
|
|
73
|
-
new l2_row_1.L2UseCase(2, 'A Write to `webpieces.config.json` while on `main`, which row 5 would otherwise block', 'on `main`, editing the one file that can disable the guard', 'ALLOW: the hook adapter bypasses feature-branch-guard for this path before any guard runs', 'None needed — the edit proceeds', 'config-bypass (feature-branch-guard skipped)'),
|
|
74
|
-
]),
|
|
75
|
-
new l2_row_1.L2Row(2, ['B'], 'bare `git checkout main`, with no `git pull` chained into the same command', l2_row_1.L2_BLOCK, '`pnpm wp-sync-main`', [
|
|
76
|
-
new l2_row_1.L2UseCase(3, '`git checkout main` after a merge, to start the next piece of work', 'about to land on whatever local `main` you last had — 157 commits behind, in the incident', 'BLOCK: decided from command TEXT alone, before the checkout, because the only `main` this could measure is the one it is about to leave', '`pnpm wp-sync-main` — checkout, pull, reap dead branches/worktrees, sweep orphan directories, in one command (hand-rolled, the pull must be in the SAME command as the checkout)', 'bare checkout of main ('),
|
|
77
|
-
new l2_row_1.L2UseCase(4, 'The same command inside a linked worktree, where `git checkout main` fatals anyway', 'linked worktree — `main` is already checked out in the primary clone', 'BLOCK, and the message prints the worktree form rather than a cure git would refuse', '`git fetch origin main`, then work off `origin/main`', 'bare checkout of main ('),
|
|
78
|
-
]),
|
|
79
|
-
new l2_row_1.L2Row(3, ['B', 'R', 'E'], '**merge in progress** — L4 owns this state', l2_row_1.L2_EXEMPT, 'finish the merge: `pnpm wp-finish-upsert-pr`', [
|
|
80
|
-
new l2_row_1.L2UseCase(5, 'Reading and editing conflicted files during a 3-point merge, on a branch row 9 would block', 'merge markers on disk — `pnpm wp-start-update` has run and not finished', 'EXEMPT: everything is permitted, which is exactly what lets row 9 be strict', 'Resolve the conflicts, then `pnpm wp-finish-upsert-pr`', l2_row_1.NO_ROW_EXIT),
|
|
81
|
-
]),
|
|
82
|
-
new l2_row_1.L2Row(4, ['B'], 'on the **skip list** — it gets you OUT, or tells you where you are', l2_row_1.L2_ALLOW, '—', [
|
|
83
|
-
new l2_row_1.L2UseCase(6, '`git status` / `gh pr view` while blocked, to work out where you are', 'any state — orientation is never "working here"', 'ALLOW: metadata tells you where you are without putting stale file CONTENT in context', 'None needed', 'not-a-content-read (cure/build/metadata)'),
|
|
84
|
-
new l2_row_1.L2UseCase(7, '`git stash` when `git checkout -b <new> origin/main` refuses because `origin/main` touched the same files you edited', 'on a stale `main` or a merged branch, dirty tree, with an overlapping upstream change', 'ALLOW: the cure for the row that blocked you must itself never be blocked — and this is the residual step that makes rows 6 and 8 safe to block on a dirty tree', 'None needed — then re-run the checkout and `git stash pop`', 'not-a-content-read (cure/build/metadata)'),
|
|
85
|
-
new l2_row_1.L2UseCase(28, '`gh pr close 123`, `gh pr comment`, `gh api …` or a `curl` while parked on a stale `main` or a merged branch', 'blocked state, running something that touches GitHub or a URL and nothing in this tree', 'ALLOW: the skip list asks one question — does this read or write repo CONTENT? `gh` talks to GitHub and `curl`/`wget` talk to a network, so the branch state has nothing to say about them. The forms that write a local file (`gh repo clone`, `gh pr checkout`, `curl -o`, any `> file`) are excluded, and `gh pr create`/`merge` remain governed by their own guards', 'None needed', 'not-a-content-read (cure/build/metadata)'),
|
|
86
|
-
new l2_row_1.L2UseCase(8, '`pnpm wp-start-upsert-pr` on a branch whose fork point is broken', 'row 9 state, running the tool row 9 prescribes', 'ALLOW: every `wp-*` bin is on the skip list, so no row can block its own remedy', 'None needed', 'merged-branch recovery/inspection (allowlisted)'),
|
|
87
|
-
]),
|
|
88
|
-
new l2_row_1.L2Row(5, ['E'], 'on `main`', l2_row_1.L2_BLOCK, '`git checkout -b <new> origin/main`', [
|
|
89
|
-
new l2_row_1.L2UseCase(9, 'An Edit or Write to any tracked file while `git rev-parse --abbrev-ref HEAD` says `main`', 'on `main`, any freshness', 'BLOCK: decided by one `git rev-parse`, with NO cache read, so it fires on the first tool call of the session', '`git checkout -b <new> origin/main` — uncommitted work comes with you', 'on-main'),
|
|
90
|
-
new l2_row_1.L2UseCase(25, 'The FIRST edit of a session, on `main`, before any cache exists', 'on `main`, cache absent — row 11 would fail open', 'BLOCK anyway: row 5 is ABOVE the cache divider and reads only `git rev-parse`, so it is armed on call #1. This is why the row is `E` only and must never be gated on the cache', '`git checkout -b <new> origin/main`', 'on-main'),
|
|
91
|
-
]),
|
|
92
|
-
new l2_row_1.L2Row(l2_row_1.L2_FAIL_OPEN_ROW, ['B', 'R', 'E'], '**the state could not be established** — branch undeterminable, no cache yet, the cache holds another branch, `origin/main` unknown, or the forge unreachable', l2_row_1.L2_FAIL_OPEN, '— (nothing to fix; the refresher populates the cache for the next call)', [
|
|
93
|
-
new l2_row_1.L2UseCase(11, 'The very first tool call of a session is allowed even on a badly stale `main`', 'no cache — the refresher is fire-and-forget and populates it for the NEXT call', 'ALLOW (fail-open), logged as `ALLOW_FAIL_OPEN` so abstentions stay countable', 'None — the second call is judged normally', 'no-sync-cache'),
|
|
94
|
-
new l2_row_1.L2UseCase(12, 'Guards quietly stand down on a plane, or when `gh` is unauthenticated or rate-limited', 'the forge could not be asked whether the PR is merged', 'ALLOW (fail-open) logged as `no-forge` — distinct from "asked, and it is not merged", which used to look identical in the trail', 'None — restore network/`gh auth` to re-arm the merged-branch policy', 'no-forge'),
|
|
95
|
-
new l2_row_1.L2UseCase(27, 'A build, a `cat` or a `curl` on `main`, on the first Bash call of a session', 'on `main`, cache absent — so whether `main` is behind is UNKNOWN', 'ALLOW (fail-open), logged `ALLOW_FAIL_OPEN`. `B` on `main` is judged by rows 6/7 and therefore lands here when the cache cannot answer; the WRITE half is not, which is why row 5 sits above this divider', 'None — the second call is judged normally', 'no-sync-cache'),
|
|
96
|
-
new l2_row_1.L2UseCase(14, 'Mid-rebase, every guard abstains', 'detached HEAD — there is no branch name to judge', 'ALLOW (fail-open), logged LOUDLY when the branch is unresolvable rather than merely detached', 'None — finish or abort the rebase', 'branch-undeterminable'),
|
|
97
|
-
]),
|
|
98
|
-
// ROWS 12/13 sit ABOVE row 6 because they are judged inside its state: local `main` is established
|
|
99
|
-
// BEHIND, and the only remaining question is whether the command already carries its own cure. They
|
|
100
|
-
// are numbered 12/13 rather than slotted in as 6a/6b for the reason row 11 is numbered 11 — row
|
|
101
|
-
// numbers are logged as `row=` and cited here, so renumbering re-points every existing reference.
|
|
102
|
-
new l2_row_1.L2Row(12, ['B'], 'on `main`, behind `origin/main`, and the command STARTS with a refresh-main cure joined to the work by `&&`', l2_row_1.L2_ALLOW, '—', [
|
|
103
|
-
new l2_row_1.L2UseCase(29, '`git fetch --prune origin main -q && git pull --ff-only origin main 2>&1 | tail -1 && sed -n \'30,75p\' src/app.ts` — the agent cures and reads in one call', 'on `main`, behind `origin/main`, cure first, `&&` between', 'ALLOW: `&&` short-circuits, so the `sed` never runs if the pull fails — the guard was refusing a safety property the shell already enforces. Measured fleet-wide as `cure_bundled_and`, and filed as a TOOLING defect, not an agent one', 'None needed', 'cure-prefixed, && short-circuits the work'),
|
|
104
|
-
]),
|
|
105
|
-
new l2_row_1.L2Row(13, ['B'], 'on `main`, behind `origin/main`, and the cure is joined to the work by `;` (or `||`, `&`, a newline) — the work runs even if the cure fails', l2_row_1.L2_BLOCK, '`pnpm wp-sync-main && <your command>`', [
|
|
106
|
-
new l2_row_1.L2UseCase(30, '`pnpm wp-sync-main >/dev/null 2>&1; git log --oneline -1; sed -n \'598,612p\' eslint.config.mjs` — and the agent then quotes an eslint rule out of a file 15 commits stale', 'on `main`, behind `origin/main`, cure first, `;` between', 'BLOCK: `;` discards the cure\'s exit code, so a conflict, a dirty tree or no network leaves the `sed` reading still-stale content — and 7 of the 9 observed cases also silenced the cure with `>/dev/null 2>&1`, so the failure was invisible too. The two-step is safer because the NEXT tool call re-computes `localMain` against `originMain`, so a failed pull re-blocks; an allowed `;` compound never gets that second look', 'Swap the `;` for `&&` — `pnpm wp-sync-main && <your command>` — or run the cure alone and re-issue the command in the next call', 'cure-prefixed, work runs anyway'),
|
|
107
|
-
]),
|
|
108
|
-
new l2_row_1.L2Row(6, ['B', 'R'], 'on `main`, farther behind `origin/main` than `maxCommitsBehind`', l2_row_1.L2_BLOCK, '`pnpm wp-sync-main`, or `git checkout -b <new> origin/main`', [
|
|
109
|
-
new l2_row_1.L2UseCase(13, 'The Read tool refuses a file on a stale `main` while you have UNCOMMITTED edits', 'on `main`, beyond `maxCommitsBehind`, dirty tree', 'BLOCK. This used to fail open, on the argument that the prescribed `git pull` is not a clean fast-forward when the tree is dirty. That was true of the MESSAGE, not the row: the cure cell always offered a second form, and it works dirty', '`git checkout -b <new> origin/main` — uncommitted changes come with you onto the new branch. If git refuses because `origin/main` touched the same files, `git stash` first (never blocked), then retry, then `git stash pop`', 'on-stale-main'),
|
|
110
|
-
new l2_row_1.L2UseCase(15, 'The Read tool refuses a file that exists, on a `main` 18 commits behind', 'on `main`, beyond `maxCommitsBehind`, clean tree', 'BLOCK: judged by live ancestry (`git merge-base --is-ancestor`), not hash equality, so a pull takes effect instantly', '`pnpm wp-sync-main`, or `git checkout -b <new> origin/main`', 'on-stale-main'),
|
|
111
|
-
new l2_row_1.L2UseCase(16, 'Read is blocked, so the session reaches for `cat`, `grep` and `ls` instead — and describes a CI workflow set missing a whole workflow that existed upstream', 'the SIDE DOOR: same tree, same staleness, different tool', 'BLOCK: `B` is judged here beside `R`, so closing the Read tool no longer opens a shell-shaped hole. The log used to read "read-stale-guard handled", which is worse than no guard — it looks covered', '`git checkout -b <new> origin/main`', 'on-stale-main'),
|
|
112
|
-
new l2_row_1.L2UseCase(10, 'A Bash command that WRITES tracked files as a side effect — `npx expo install`, a formatter, codegen, `sed -i`, a `>` redirect', 'on a `main` known to be beyond `maxCommitsBehind`, and the write is incidental to a command whose stated purpose is something else', 'BLOCK: inside this row `B` is default-DENY plus row 4\'s skip list, never a blocklist of readers — a command nobody thought to enumerate is caught by not being on the list, which is the only shape that could have caught this one', '`git checkout -b <new> origin/main` BEFORE running anything that may write', 'on-stale-main'),
|
|
113
|
-
]),
|
|
114
|
-
new l2_row_1.L2Row(7, ['B', 'R'], 'on `main`, current or within `maxCommitsBehind`', l2_row_1.L2_ALLOW, '—', [
|
|
115
|
-
new l2_row_1.L2UseCase(17, 'Reading files on a `main` you just pulled', 'on `main`, and `origin/main` is an ancestor of HEAD', 'ALLOW: ancestry, not hash equality, so the allow arrives the instant the pull lands rather than when the detached refresher next runs', 'None needed', 'local-main-contains-origin (up to date)'),
|
|
116
|
-
new l2_row_1.L2UseCase(24, '`curl`, `gh pr close` or a test run, immediately after `pnpm wp-sync-main` landed you on a perfectly current `main`', 'on `main`, current — no staleness anywhere', 'ALLOW. This used to BLOCK, from the branch alone: the tool the repo prescribes put the agent here, and the guard whose name says STALE then refused everything off a narrow allowlist for a reason that had nothing to do with staleness. WRITES here are still blocked, by row 5 — that hazard is real at any freshness', 'None needed', 'local-main-contains-origin (up to date)'),
|
|
117
|
-
new l2_row_1.L2UseCase(31, 'Reading or running Bash while local `main` is five commits behind and the configured maximum is five', 'on `main`, cached `commitsBehind` is at or below `maxCommitsBehind`', 'ALLOW: the detached refresher computed the distance; the guard hot path only reads the cache', 'None needed', 'within-max-commits-behind'),
|
|
118
|
-
]),
|
|
119
|
-
new l2_row_1.L2Row(8, ['B', 'R', 'E'], 'on a branch whose PR is **already merged**', l2_row_1.L2_BLOCK, '`git fetch origin main && git checkout -b <new> origin/main`', [
|
|
120
|
-
new l2_row_1.L2UseCase(18, 'You keep working on the branch after its PR merged, and the next PR reopens code review already landed', 'branch whose PR is merged — `merged` is monotonic, so the cached flag is trusted with no TTL', 'BLOCK across all three tools', '`git fetch origin main && git checkout -b <new> origin/main`', 'already-merged PR#'),
|
|
121
|
-
new l2_row_1.L2UseCase(26, 'You have uncommitted edits on a branch whose PR just merged', 'merged branch, dirty tree', 'BLOCK. This used to fail open too, and that valve never had an argument behind it — row 8\'s cure carries uncommitted work onto the fresh branch, so nothing was ever trapped. It was drift from the documented design, which `read-stale-guard`\'s own class comment still described correctly', '`git fetch origin main && git checkout -b <new> origin/main` — your edits come with you', 'already-merged PR#'),
|
|
122
|
-
new l2_row_1.L2UseCase(19, 'A shell-only session sails through on a merged branch', 'merged branch, Bash only — both FILE guards are file-scoped, so Bash reached neither', 'BLOCK: `merged-branch-bash-guard` exists because `branchAlreadyMerged` was being computed and logged on that very path, then thrown away', '`git fetch origin main && git checkout -b <new> origin/main`', 'already-merged PR#'),
|
|
123
|
-
]),
|
|
124
|
-
new l2_row_1.L2Row(9, ['B', 'R', 'E'], 'no fork point with `origin/main`, or `origin/main` moved and collided with your files', l2_row_1.L2_BLOCK, '`pnpm wp-start-update`, or `pnpm wp-start-upsert-pr` when a PR is open', [
|
|
125
|
-
new l2_row_1.L2UseCase(20, 'Your branch and `origin/main` share no merge base — usually a branch cut from a squashed-away tip', 'no fork point', 'BLOCK: nothing built on this branch can be reasoned about relative to main', '`pnpm wp-start-update`, or `pnpm wp-start-upsert-pr` when a PR is open', 'no-fork-point'),
|
|
126
|
-
new l2_row_1.L2UseCase(21, '`origin/main` moved and changed the same files you edited', 'main-moved collision', 'BLOCK — and row 3 then exempts everything once the merge starts, which is what makes this safe', '`pnpm wp-start-update`, resolve, `pnpm wp-finish-upsert-pr`', 'main-moved-conflict'),
|
|
127
|
-
]),
|
|
128
|
-
new l2_row_1.L2Row(10, ['B', 'R', 'E'], 'healthy feature branch', l2_row_1.L2_ALLOW, '—', [
|
|
129
|
-
new l2_row_1.L2UseCase(22, 'Ordinary work on a branch cut from a current `origin/main`', 'healthy feature branch', 'ALLOW — the state every other row exists to push you back into', 'None needed', 'clean-feature-branch'),
|
|
130
|
-
new l2_row_1.L2UseCase(23, '`stale-main-bash-guard` sees a feature branch and hands off', 'not on `main` — state B belongs to `merged-branch-bash-guard`', 'ALLOW: the same verdict about the same tree, logged by the guard that is not responsible for it', 'None needed', 'not-on-main (state B is another guard)'),
|
|
131
|
-
]),
|
|
132
|
-
];
|
|
133
|
-
/**
|
|
134
|
-
* Every use case on every row, in row order, for the doc and for the exhaustiveness specs.
|
|
135
|
-
*
|
|
136
|
-
* Numbering is GLOBAL and is identity, exactly as the row numbers are: a use case is cited by number in
|
|
137
|
-
* review and in the doc, so add new ones at the END of the highest number rather than renumbering to
|
|
138
|
-
* keep a row's block contiguous.
|
|
139
|
-
*/
|
|
140
|
-
// webpieces-disable no-function-outside-class -- pure accessor over L2_ROWS above, in this data module
|
|
141
|
-
function allL2UseCases() {
|
|
142
|
-
return exports.L2_ROWS.flatMap((row) => row.useCases);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* REASON → ROW. The join between what a guard actually logged and the row it is an instance of.
|
|
146
|
-
*
|
|
147
|
-
* Keys are the exact `reason` strings the four L2 guards pass to their decision log. Two of them are
|
|
148
|
-
* PREFIXES because the guard interpolates a PR number or a matched segment into the reason
|
|
149
|
-
* (`already-merged PR#123`); those are matched by `l2RowForReason` on prefix, which is why they end in
|
|
150
|
-
* a space or a `(`.
|
|
151
|
-
*
|
|
152
|
-
* l2-matrix.spec.ts reads the four guard sources and asserts every reason literal in them resolves
|
|
153
|
-
* here, so a new exit with no row fails the build rather than logging `row=-` forever.
|
|
154
|
-
*/
|
|
155
|
-
const EXACT_REASON_ROWS = {
|
|
156
|
-
// Row 1 — the universal cure that must stay reachable from inside any block.
|
|
157
|
-
'webpieces-config-read (escape hatch)': 1,
|
|
158
|
-
// Row 2 — the preventive half, decided from command TEXT before any cache is read.
|
|
159
|
-
// (prefix, see PREFIX_REASON_ROWS)
|
|
160
|
-
// Row 4 — the skip list, in its two live spellings.
|
|
161
|
-
'merged-branch recovery/inspection (allowlisted)': 4,
|
|
162
|
-
'not-a-content-read (cure/build/metadata)': 4,
|
|
163
|
-
// Row 5 — never WRITE on main, at any freshness. `E` only; the Bash half is rows 6/7.
|
|
164
|
-
'on-main': 5,
|
|
165
|
-
// Row 6/7 — freshness, for `B` and `R` alike. Both guards log these two literals: read-stale-guard
|
|
166
|
-
// for the Read tool, stale-main-bash-guard for Bash. Same cache, same ancestry test, one verdict.
|
|
167
|
-
'on-stale-main': 6,
|
|
168
|
-
'local-main-contains-origin (up to date)': 7,
|
|
169
|
-
'within-max-commits-behind': 7,
|
|
170
|
-
// Rows 12/13 — composition, judged INSIDE row 6's state: the tree is established behind, and the
|
|
171
|
-
// only remaining question is whether the command carries its own cure and with which operator.
|
|
172
|
-
'cure-prefixed, && short-circuits the work': 12,
|
|
173
|
-
'cure-prefixed, work runs anyway': 13,
|
|
174
|
-
// Row 9 — the two unhealthy-fork states.
|
|
175
|
-
'no-fork-point': 9,
|
|
176
|
-
'main-moved-conflict': 9,
|
|
177
|
-
// Row 10 — healthy, and the state-B guard's "this is not my state" hand-off, which is the same
|
|
178
|
-
// verdict about the same tree.
|
|
179
|
-
'clean-feature-branch': 10,
|
|
180
|
-
'not-on-main (state B is another guard)': 10,
|
|
181
|
-
// Row 11 — every "could not establish", including the two dirty-tree valves the code still opens
|
|
182
|
-
// (see NOT_DONE) and the unreachable forge.
|
|
183
|
-
'branch-undeterminable': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
184
|
-
'commit-distance-unknown': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
185
|
-
// The target tree HAS no branch name (mid-rebase / mid-bisect), so there is no key into the
|
|
186
|
-
// branch-keyed cache — use case 14, which the row already describes. It used to arrive here as the
|
|
187
|
-
// literal branch `HEAD`, miss in the cache and log `no-sync-cache`: the right verdict recorded under
|
|
188
|
-
// a reason that names a different cause, and therefore uncountable.
|
|
189
|
-
'detached-head': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
190
|
-
// The file being judged lives in a NESTED CLONE (`repositories/**`) — another repo's branch is not
|
|
191
|
-
// this policy's to judge. The bash path calls the same state ALLOW_EXEMPT at L1; on the file path it
|
|
192
|
-
// is an abstention, because nothing about the target tree's state was established.
|
|
193
|
-
'target-tree-foreign': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
194
|
-
'no-sync-cache': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
195
|
-
'stale-cross-branch-cache': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
196
|
-
'origin-main-unknown': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
197
|
-
// `dirty-tree-on-main` and `dirty-merged-branch` used to live here. Both valves are deleted: rows
|
|
198
|
-
// 6 and 8 now block on a dirty tree, because each row's cure carries uncommitted work with you.
|
|
199
|
-
'no-forge': l2_row_1.L2_FAIL_OPEN_ROW,
|
|
200
|
-
// The config-edit bypass logged by the hook adapter before any guard runs — row 1, same universal
|
|
201
|
-
// cure as the config READ above.
|
|
202
|
-
'config-bypass (feature-branch-guard skipped)': 1,
|
|
203
|
-
};
|
|
204
|
-
/** Reasons the guards interpolate a value into. Matched by prefix, longest first. */
|
|
205
|
-
const PREFIX_REASON_ROWS = {
|
|
206
|
-
'already-merged PR#': 8,
|
|
207
|
-
'bare checkout of main (': 2,
|
|
208
|
-
// `stale-main content read (` used to live here, mapping the Bash side of row 6. It is gone with
|
|
209
|
-
// the guard exit that emitted it: on `main`, row 5 now blocks before any content-read scan runs,
|
|
210
|
-
// so row 6 is what the table always said it was — the ROW-ONLY row.
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* The row a logged reason belongs to, or null when nothing claims it.
|
|
214
|
-
*
|
|
215
|
-
* Null rather than a default row: a reason with no row is a HOLE in the table, and defaulting it to
|
|
216
|
-
* "fail-open" would hide exactly the drift the exhaustiveness spec exists to catch. The guards render
|
|
217
|
-
* null as `row=-`, so an unmapped reason is visible in the log too, not only in CI.
|
|
218
|
-
*/
|
|
219
|
-
// webpieces-disable no-function-outside-class -- the matcher over the two tables above, beside them in this data module
|
|
220
|
-
function l2RowForReason(reason) {
|
|
221
|
-
const exact = EXACT_REASON_ROWS[reason];
|
|
222
|
-
if (exact !== undefined)
|
|
223
|
-
return exact;
|
|
224
|
-
for (const prefix of Object.keys(PREFIX_REASON_ROWS)) {
|
|
225
|
-
if (reason.startsWith(prefix))
|
|
226
|
-
return PREFIX_REASON_ROWS[prefix];
|
|
227
|
-
}
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
/** Every reason string this table claims, for the exhaustiveness spec. */
|
|
231
|
-
// webpieces-disable no-function-outside-class -- pure accessor over the two tables above
|
|
232
|
-
function l2MappedReasons() {
|
|
233
|
-
return [...Object.keys(EXACT_REASON_ROWS), ...Object.keys(PREFIX_REASON_ROWS)];
|
|
234
|
-
}
|
|
235
|
-
/** One documented gap between a row and what the guards actually do today. Data-only. */
|
|
236
|
-
class L2NotDone {
|
|
237
|
-
row;
|
|
238
|
-
gap;
|
|
239
|
-
why;
|
|
240
|
-
constructor(row, gap, why) {
|
|
241
|
-
this.row = row;
|
|
242
|
-
this.gap = gap;
|
|
243
|
-
this.why = why;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
exports.L2NotDone = L2NotDone;
|
|
247
|
-
/**
|
|
248
|
-
* WHERE THE TABLE AND THE CODE DISAGREE, stated rather than papered over.
|
|
249
|
-
*
|
|
250
|
-
* The L1 precedent is `## Not done — \`o\` is not exempt yet`: a row the runner cannot reach, named in
|
|
251
|
-
* the generated doc with the reason it has not shipped. The same treatment applies here, and it is what
|
|
252
|
-
* makes it safe to publish a table the guards do not yet dispatch from — a reader is told exactly which
|
|
253
|
-
* rows describe intent rather than behaviour, and the log's `row=` stamps land on row 11 for every one
|
|
254
|
-
* of these, so the trail never claims the strict row fired.
|
|
255
|
-
*/
|
|
256
|
-
exports.NOT_DONE = [
|
|
257
|
-
// EMPTY, and that is the goal state: every row in the table is a row the guards actually honour.
|
|
258
|
-
//
|
|
259
|
-
// It held three entries. Row 5's `B` half shipped and then MOVED: on `main`, a write is judged from
|
|
260
|
-
// the branch alone (row 5, above the divider) while Bash is judged on freshness beside the Read tool
|
|
261
|
-
// (rows 6/7), because a build on a CURRENT `main` harms nothing and denying it stranded agents on
|
|
262
|
-
// the very `main` `pnpm wp-sync-main` had just handed them. Rows 6 and 8 held DIRTY-TREE
|
|
263
|
-
// valves, and both are now closed — each of
|
|
264
|
-
// those rows cures with `git checkout -b <new> origin/main`, which carries uncommitted changes onto
|
|
265
|
-
// the new branch, so a dirty tree never trapped anybody. The row 6 entry claimed the dirty argument
|
|
266
|
-
// "has teeth" there because its cure is `git pull`; that was a fact about the MESSAGE, which printed
|
|
267
|
-
// only the pull, and the fix was to print both cures rather than to suppress the block.
|
|
268
|
-
//
|
|
269
|
-
// Keep this array. An empty "Not done" is a claim worth making explicitly — the doc says so in as
|
|
270
|
-
// many words — and the next divergence between a row and its code belongs here, not in prose.
|
|
271
|
-
];
|
|
272
|
-
//# sourceMappingURL=l2-rows.js.map
|
package/src/core/l2-rows.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"l2-rows.js","sourceRoot":"","sources":["../../../../../../packages/tooling/ai-hook-rules/src/core/l2-rows.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,wCAAwC;AACxC,EAAE;AACF,qGAAqG;AACrG,iFAAiF;AACjF,EAAE;AACF,uGAAuG;AACvG,uGAAuG;AACvG,sGAAsG;AACtG,0FAA0F;AAC1F,EAAE;AACF,iFAAiF;AACjF,EAAE;AACF,sGAAsG;AACtG,uGAAuG;AACvG,oGAAoG;AACpG,sGAAsG;AACtG,oGAAoG;AACpG,mGAAmG;AACnG,mDAAmD;AACnD,EAAE;AACF,mGAAmG;AACnG,kGAAkG;AAClG,gGAAgG;AAChG,iGAAiG;AACjG,wGAAwG;AACxG,yEAAyE;AACzE,EAAE;AACF,sGAAsG;AACtG,kGAAkG;AAClG,EAAE;AACF,wGAAwG;AACxG,qCAAqC;AACrC,8EAA8E;;;AAgQ9E,sCAEC;AAgFD,wCAOC;AAID,0CAEC;AA7VD,qC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YAAqB,GAAW,EAAW,GAAW,EAAW,GAAW;QAAvD,QAAG,GAAH,GAAG,CAAQ;QAAW,QAAG,GAAH,GAAG,CAAQ;QAAW,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;CACnF;AAFD,8BAEC;AAED;;;;;;;;GAQG;AACU,QAAA,QAAQ,GAAyB;AAC1C,iGAAiG;AACjG,EAAE;AACF,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,yFAAyF;AACzF,4CAA4C;AAC5C,oGAAoG;AACpG,oGAAoG;AACpG,qGAAqG;AACrG,wFAAwF;AACxF,EAAE;AACF,kGAAkG;AAClG,8FAA8F;CACjG,CAAC","sourcesContent":["// ---------------------------------------------------------------------------\n// L2 — the BRANCH-STATE layer, as data.\n//\n// L2 answers one question: *may I work here, and is what I read current?* Drawn as a decision matrix\n// that is TWELVE ordered rows plus one terminal fail-open row, first match wins.\n//\n// This module holds those rows, l2-doc.ts renders them into guards/L2-branch-state.md, and a unit test\n// (l2-matrix.spec.ts) locks that file byte-identical to the renderer — the same mechanism that already\n// makes L0's fault table and L1's location table undriftable. Before this existed the L2 doc was 100%\n// hand-written and said so: *\"Until that lands this text is hand-written and can drift.\"*\n//\n// ## HOW L2 JOINS TO THE ROWS TODAY — read this before assuming it works like L1\n//\n// L1 DISPATCHES from its array: `runner.l1LocationBlock` takes the first matching row and switches on\n// its `blockId`, so deleting a row deletes a block. L2 does NOT, and pretending otherwise would be the\n// drift this table exists to remove. The four L2 guard classes each own their own ladder, and those\n// ladders diverge on purpose (guards/L2-branch-state.md, \"Deliberate divergence\": the two Bash guards\n// differ in polarity, quantifier and empty-command handling all at once, so no single parameterised\n// function serves both). Unifying them is where a wrong edit turns an allow into a session-wedging\n// block, so it is deliberately not attempted here.\n//\n// What L2 does instead is a REASON→ROW join. Every exit of every L2 guard already carries a stable\n// reason string into the decision log; `L2_ROW_FOR_REASON` maps each of those to the row it is an\n// instance of, the guards stamp that number as `row=`, and l2-matrix.spec.ts asserts the map is\n// EXHAUSTIVE against the guard sources — a new reason with no row fails the build. So `row=8` in\n// `.webpieces/logs/L2-decisions` opens guards/L2-branch-state.md at row 8 and reads the state, the cure\n// and the tools that row covers, exactly as `row=5` already does for L1.\n//\n// The rows the guards cannot yet honour are named in the doc's \"Not done\" section rather than quietly\n// rendered as if they were live. That section is generated from NOT_DONE below, so it cannot rot.\n//\n// This module is deliberately import-free at runtime, so `pnpm guards:generate` can load it without the\n// package's transitive dependencies.\n// ---------------------------------------------------------------------------\n\nimport {\n L2_ALLOW, L2_BLOCK, L2_EXEMPT, L2_FAIL_OPEN, L2_FAIL_OPEN_ROW, L2Row, L2UseCase, NO_ROW_EXIT,\n} from './l2-row';\n\nexport {\n L2Action, L2ActionKind, L2Tool,\n L2_ALLOW, L2_BLOCK, L2_EXEMPT, L2_FAIL_OPEN, L2_FAIL_OPEN_ROW, L2Row, L2UseCase, NO_ROW_EXIT,\n} from './l2-row';\n\n/**\n * THE THIRTEEN L2 ROWS, in first-match-wins order.\n *\n * Rows 1-5 need NO cache and fire on call #1: rows 1, 2 and 4 are text matches, row 3 is a marker-file\n * scan, row 5 is one `git rev-parse`. Row 11 is the cache divider. Rows 6-10 all read the cache.\n *\n * THE ORDER OF ROW 5 IS THE MOST LOAD-BEARING THING IN THIS TABLE. Put \"on main\" BELOW the divider and\n * WRITES on `main` are permitted for the whole first call of every session — and permanently in a\n * multi-worktree repo, where another tree may hold the cache lock indefinitely.\n *\n * `B` AND `E` PART COMPANY ON `main`, and rows 5/6/7 are where. A WRITE on `main` is wrong at any\n * freshness — the work lands somewhere unreviewable and unrevertable — so row 5 is `E` only, judged on\n * the branch alone, above the divider. A READ or a BUILD on a CURRENT `main` is harmless, and blocking\n * it strands the agent right after `pnpm wp-sync-main` put it there; so `B` joins `R` on the\n * FRESHNESS-gated pair below the divider (row 6 behind → block, row 7 current → allow), where \"cannot\n * tell\" fails open at row 11 by construction. `B` and `R` still differ in SHAPE inside row 6: a Read\n * names one file and is judged precisely, a Bash command is opaque and gets default-deny plus row 4.\n */\nexport const L2_ROWS: readonly L2Row[] = [\n new L2Row(1, ['B', 'R', 'E'], 'on the **global allowlist** (inert command, or a universal cure such as reading/editing `webpieces.config.json`)', L2_ALLOW, '—', [\n new L2UseCase(1,\n 'You are blocked by some other L2 row, and need to turn the policy off to get anything done',\n 'any state — this row is ahead of every block',\n 'ALLOW: reading and editing `webpieces.config.json` is never blocked, so the mode-OFF cure is always reachable',\n 'Edit `webpieces.config.json` → `hookGuards` → `branch-state-guard` → `\"mode\": \"OFF\"`',\n 'webpieces-config-read (escape hatch)'),\n new L2UseCase(2,\n 'A Write to `webpieces.config.json` while on `main`, which row 5 would otherwise block',\n 'on `main`, editing the one file that can disable the guard',\n 'ALLOW: the hook adapter bypasses feature-branch-guard for this path before any guard runs',\n 'None needed — the edit proceeds',\n 'config-bypass (feature-branch-guard skipped)'),\n ]),\n new L2Row(2, ['B'], 'bare `git checkout main`, with no `git pull` chained into the same command', L2_BLOCK, '`pnpm wp-sync-main`', [\n new L2UseCase(3,\n '`git checkout main` after a merge, to start the next piece of work',\n 'about to land on whatever local `main` you last had — 157 commits behind, in the incident',\n 'BLOCK: decided from command TEXT alone, before the checkout, because the only `main` this could measure is the one it is about to leave',\n '`pnpm wp-sync-main` — checkout, pull, reap dead branches/worktrees, sweep orphan directories, in one command (hand-rolled, the pull must be in the SAME command as the checkout)',\n 'bare checkout of main ('),\n new L2UseCase(4,\n 'The same command inside a linked worktree, where `git checkout main` fatals anyway',\n 'linked worktree — `main` is already checked out in the primary clone',\n 'BLOCK, and the message prints the worktree form rather than a cure git would refuse',\n '`git fetch origin main`, then work off `origin/main`',\n 'bare checkout of main ('),\n ]),\n new L2Row(3, ['B', 'R', 'E'], '**merge in progress** — L4 owns this state', L2_EXEMPT, 'finish the merge: `pnpm wp-finish-upsert-pr`', [\n new L2UseCase(5,\n 'Reading and editing conflicted files during a 3-point merge, on a branch row 9 would block',\n 'merge markers on disk — `pnpm wp-start-update` has run and not finished',\n 'EXEMPT: everything is permitted, which is exactly what lets row 9 be strict',\n 'Resolve the conflicts, then `pnpm wp-finish-upsert-pr`',\n NO_ROW_EXIT),\n ]),\n new L2Row(4, ['B'], 'on the **skip list** — it gets you OUT, or tells you where you are', L2_ALLOW, '—', [\n new L2UseCase(6,\n '`git status` / `gh pr view` while blocked, to work out where you are',\n 'any state — orientation is never \"working here\"',\n 'ALLOW: metadata tells you where you are without putting stale file CONTENT in context',\n 'None needed',\n 'not-a-content-read (cure/build/metadata)'),\n new L2UseCase(7,\n '`git stash` when `git checkout -b <new> origin/main` refuses because `origin/main` touched the same files you edited',\n 'on a stale `main` or a merged branch, dirty tree, with an overlapping upstream change',\n 'ALLOW: the cure for the row that blocked you must itself never be blocked — and this is the residual step that makes rows 6 and 8 safe to block on a dirty tree',\n 'None needed — then re-run the checkout and `git stash pop`',\n 'not-a-content-read (cure/build/metadata)'),\n new L2UseCase(28,\n '`gh pr close 123`, `gh pr comment`, `gh api …` or a `curl` while parked on a stale `main` or a merged branch',\n 'blocked state, running something that touches GitHub or a URL and nothing in this tree',\n 'ALLOW: the skip list asks one question — does this read or write repo CONTENT? `gh` talks to GitHub and `curl`/`wget` talk to a network, so the branch state has nothing to say about them. The forms that write a local file (`gh repo clone`, `gh pr checkout`, `curl -o`, any `> file`) are excluded, and `gh pr create`/`merge` remain governed by their own guards',\n 'None needed',\n 'not-a-content-read (cure/build/metadata)'),\n new L2UseCase(8,\n '`pnpm wp-start-upsert-pr` on a branch whose fork point is broken',\n 'row 9 state, running the tool row 9 prescribes',\n 'ALLOW: every `wp-*` bin is on the skip list, so no row can block its own remedy',\n 'None needed',\n 'merged-branch recovery/inspection (allowlisted)'),\n ]),\n new L2Row(5, ['E'], 'on `main`', L2_BLOCK, '`git checkout -b <new> origin/main`', [\n new L2UseCase(9,\n 'An Edit or Write to any tracked file while `git rev-parse --abbrev-ref HEAD` says `main`',\n 'on `main`, any freshness',\n 'BLOCK: decided by one `git rev-parse`, with NO cache read, so it fires on the first tool call of the session',\n '`git checkout -b <new> origin/main` — uncommitted work comes with you',\n 'on-main'),\n new L2UseCase(25,\n 'The FIRST edit of a session, on `main`, before any cache exists',\n 'on `main`, cache absent — row 11 would fail open',\n 'BLOCK anyway: row 5 is ABOVE the cache divider and reads only `git rev-parse`, so it is armed on call #1. This is why the row is `E` only and must never be gated on the cache',\n '`git checkout -b <new> origin/main`',\n 'on-main'),\n ]),\n new L2Row(L2_FAIL_OPEN_ROW, ['B', 'R', 'E'], '**the state could not be established** — branch undeterminable, no cache yet, the cache holds another branch, `origin/main` unknown, or the forge unreachable', L2_FAIL_OPEN, '— (nothing to fix; the refresher populates the cache for the next call)', [\n new L2UseCase(11,\n 'The very first tool call of a session is allowed even on a badly stale `main`',\n 'no cache — the refresher is fire-and-forget and populates it for the NEXT call',\n 'ALLOW (fail-open), logged as `ALLOW_FAIL_OPEN` so abstentions stay countable',\n 'None — the second call is judged normally',\n 'no-sync-cache'),\n new L2UseCase(12,\n 'Guards quietly stand down on a plane, or when `gh` is unauthenticated or rate-limited',\n 'the forge could not be asked whether the PR is merged',\n 'ALLOW (fail-open) logged as `no-forge` — distinct from \"asked, and it is not merged\", which used to look identical in the trail',\n 'None — restore network/`gh auth` to re-arm the merged-branch policy',\n 'no-forge'),\n new L2UseCase(27,\n 'A build, a `cat` or a `curl` on `main`, on the first Bash call of a session',\n 'on `main`, cache absent — so whether `main` is behind is UNKNOWN',\n 'ALLOW (fail-open), logged `ALLOW_FAIL_OPEN`. `B` on `main` is judged by rows 6/7 and therefore lands here when the cache cannot answer; the WRITE half is not, which is why row 5 sits above this divider',\n 'None — the second call is judged normally',\n 'no-sync-cache'),\n new L2UseCase(14,\n 'Mid-rebase, every guard abstains',\n 'detached HEAD — there is no branch name to judge',\n 'ALLOW (fail-open), logged LOUDLY when the branch is unresolvable rather than merely detached',\n 'None — finish or abort the rebase',\n 'branch-undeterminable'),\n ]),\n // ROWS 12/13 sit ABOVE row 6 because they are judged inside its state: local `main` is established\n // BEHIND, and the only remaining question is whether the command already carries its own cure. They\n // are numbered 12/13 rather than slotted in as 6a/6b for the reason row 11 is numbered 11 — row\n // numbers are logged as `row=` and cited here, so renumbering re-points every existing reference.\n new L2Row(12, ['B'], 'on `main`, behind `origin/main`, and the command STARTS with a refresh-main cure joined to the work by `&&`', L2_ALLOW, '—', [\n new L2UseCase(29,\n '`git fetch --prune origin main -q && git pull --ff-only origin main 2>&1 | tail -1 && sed -n \\'30,75p\\' src/app.ts` — the agent cures and reads in one call',\n 'on `main`, behind `origin/main`, cure first, `&&` between',\n 'ALLOW: `&&` short-circuits, so the `sed` never runs if the pull fails — the guard was refusing a safety property the shell already enforces. Measured fleet-wide as `cure_bundled_and`, and filed as a TOOLING defect, not an agent one',\n 'None needed',\n 'cure-prefixed, && short-circuits the work'),\n ]),\n new L2Row(13, ['B'], 'on `main`, behind `origin/main`, and the cure is joined to the work by `;` (or `||`, `&`, a newline) — the work runs even if the cure fails', L2_BLOCK, '`pnpm wp-sync-main && <your command>`', [\n new L2UseCase(30,\n '`pnpm wp-sync-main >/dev/null 2>&1; git log --oneline -1; sed -n \\'598,612p\\' eslint.config.mjs` — and the agent then quotes an eslint rule out of a file 15 commits stale',\n 'on `main`, behind `origin/main`, cure first, `;` between',\n 'BLOCK: `;` discards the cure\\'s exit code, so a conflict, a dirty tree or no network leaves the `sed` reading still-stale content — and 7 of the 9 observed cases also silenced the cure with `>/dev/null 2>&1`, so the failure was invisible too. The two-step is safer because the NEXT tool call re-computes `localMain` against `originMain`, so a failed pull re-blocks; an allowed `;` compound never gets that second look',\n 'Swap the `;` for `&&` — `pnpm wp-sync-main && <your command>` — or run the cure alone and re-issue the command in the next call',\n 'cure-prefixed, work runs anyway'),\n ]),\n new L2Row(6, ['B', 'R'], 'on `main`, farther behind `origin/main` than `maxCommitsBehind`', L2_BLOCK, '`pnpm wp-sync-main`, or `git checkout -b <new> origin/main`', [\n new L2UseCase(13,\n 'The Read tool refuses a file on a stale `main` while you have UNCOMMITTED edits',\n 'on `main`, beyond `maxCommitsBehind`, dirty tree',\n 'BLOCK. This used to fail open, on the argument that the prescribed `git pull` is not a clean fast-forward when the tree is dirty. That was true of the MESSAGE, not the row: the cure cell always offered a second form, and it works dirty',\n '`git checkout -b <new> origin/main` — uncommitted changes come with you onto the new branch. If git refuses because `origin/main` touched the same files, `git stash` first (never blocked), then retry, then `git stash pop`',\n 'on-stale-main'),\n new L2UseCase(15,\n 'The Read tool refuses a file that exists, on a `main` 18 commits behind',\n 'on `main`, beyond `maxCommitsBehind`, clean tree',\n 'BLOCK: judged by live ancestry (`git merge-base --is-ancestor`), not hash equality, so a pull takes effect instantly',\n '`pnpm wp-sync-main`, or `git checkout -b <new> origin/main`',\n 'on-stale-main'),\n new L2UseCase(16,\n 'Read is blocked, so the session reaches for `cat`, `grep` and `ls` instead — and describes a CI workflow set missing a whole workflow that existed upstream',\n 'the SIDE DOOR: same tree, same staleness, different tool',\n 'BLOCK: `B` is judged here beside `R`, so closing the Read tool no longer opens a shell-shaped hole. The log used to read \"read-stale-guard handled\", which is worse than no guard — it looks covered',\n '`git checkout -b <new> origin/main`',\n 'on-stale-main'),\n new L2UseCase(10,\n 'A Bash command that WRITES tracked files as a side effect — `npx expo install`, a formatter, codegen, `sed -i`, a `>` redirect',\n 'on a `main` known to be beyond `maxCommitsBehind`, and the write is incidental to a command whose stated purpose is something else',\n 'BLOCK: inside this row `B` is default-DENY plus row 4\\'s skip list, never a blocklist of readers — a command nobody thought to enumerate is caught by not being on the list, which is the only shape that could have caught this one',\n '`git checkout -b <new> origin/main` BEFORE running anything that may write',\n 'on-stale-main'),\n ]),\n new L2Row(7, ['B', 'R'], 'on `main`, current or within `maxCommitsBehind`', L2_ALLOW, '—', [\n new L2UseCase(17,\n 'Reading files on a `main` you just pulled',\n 'on `main`, and `origin/main` is an ancestor of HEAD',\n 'ALLOW: ancestry, not hash equality, so the allow arrives the instant the pull lands rather than when the detached refresher next runs',\n 'None needed',\n 'local-main-contains-origin (up to date)'),\n new L2UseCase(24,\n '`curl`, `gh pr close` or a test run, immediately after `pnpm wp-sync-main` landed you on a perfectly current `main`',\n 'on `main`, current — no staleness anywhere',\n 'ALLOW. This used to BLOCK, from the branch alone: the tool the repo prescribes put the agent here, and the guard whose name says STALE then refused everything off a narrow allowlist for a reason that had nothing to do with staleness. WRITES here are still blocked, by row 5 — that hazard is real at any freshness',\n 'None needed',\n 'local-main-contains-origin (up to date)'),\n new L2UseCase(31,\n 'Reading or running Bash while local `main` is five commits behind and the configured maximum is five',\n 'on `main`, cached `commitsBehind` is at or below `maxCommitsBehind`',\n 'ALLOW: the detached refresher computed the distance; the guard hot path only reads the cache',\n 'None needed',\n 'within-max-commits-behind'),\n ]),\n new L2Row(8, ['B', 'R', 'E'], 'on a branch whose PR is **already merged**', L2_BLOCK, '`git fetch origin main && git checkout -b <new> origin/main`', [\n new L2UseCase(18,\n 'You keep working on the branch after its PR merged, and the next PR reopens code review already landed',\n 'branch whose PR is merged — `merged` is monotonic, so the cached flag is trusted with no TTL',\n 'BLOCK across all three tools',\n '`git fetch origin main && git checkout -b <new> origin/main`',\n 'already-merged PR#'),\n new L2UseCase(26,\n 'You have uncommitted edits on a branch whose PR just merged',\n 'merged branch, dirty tree',\n 'BLOCK. This used to fail open too, and that valve never had an argument behind it — row 8\\'s cure carries uncommitted work onto the fresh branch, so nothing was ever trapped. It was drift from the documented design, which `read-stale-guard`\\'s own class comment still described correctly',\n '`git fetch origin main && git checkout -b <new> origin/main` — your edits come with you',\n 'already-merged PR#'),\n new L2UseCase(19,\n 'A shell-only session sails through on a merged branch',\n 'merged branch, Bash only — both FILE guards are file-scoped, so Bash reached neither',\n 'BLOCK: `merged-branch-bash-guard` exists because `branchAlreadyMerged` was being computed and logged on that very path, then thrown away',\n '`git fetch origin main && git checkout -b <new> origin/main`',\n 'already-merged PR#'),\n ]),\n new L2Row(9, ['B', 'R', 'E'], 'no fork point with `origin/main`, or `origin/main` moved and collided with your files', L2_BLOCK, '`pnpm wp-start-update`, or `pnpm wp-start-upsert-pr` when a PR is open', [\n new L2UseCase(20,\n 'Your branch and `origin/main` share no merge base — usually a branch cut from a squashed-away tip',\n 'no fork point',\n 'BLOCK: nothing built on this branch can be reasoned about relative to main',\n '`pnpm wp-start-update`, or `pnpm wp-start-upsert-pr` when a PR is open',\n 'no-fork-point'),\n new L2UseCase(21,\n '`origin/main` moved and changed the same files you edited',\n 'main-moved collision',\n 'BLOCK — and row 3 then exempts everything once the merge starts, which is what makes this safe',\n '`pnpm wp-start-update`, resolve, `pnpm wp-finish-upsert-pr`',\n 'main-moved-conflict'),\n ]),\n new L2Row(10, ['B', 'R', 'E'], 'healthy feature branch', L2_ALLOW, '—', [\n new L2UseCase(22,\n 'Ordinary work on a branch cut from a current `origin/main`',\n 'healthy feature branch',\n 'ALLOW — the state every other row exists to push you back into',\n 'None needed',\n 'clean-feature-branch'),\n new L2UseCase(23,\n '`stale-main-bash-guard` sees a feature branch and hands off',\n 'not on `main` — state B belongs to `merged-branch-bash-guard`',\n 'ALLOW: the same verdict about the same tree, logged by the guard that is not responsible for it',\n 'None needed',\n 'not-on-main (state B is another guard)'),\n ]),\n];\n\n/**\n * Every use case on every row, in row order, for the doc and for the exhaustiveness specs.\n *\n * Numbering is GLOBAL and is identity, exactly as the row numbers are: a use case is cited by number in\n * review and in the doc, so add new ones at the END of the highest number rather than renumbering to\n * keep a row's block contiguous.\n */\n// webpieces-disable no-function-outside-class -- pure accessor over L2_ROWS above, in this data module\nexport function allL2UseCases(): readonly L2UseCase[] {\n return L2_ROWS.flatMap((row: L2Row): readonly L2UseCase[] => row.useCases);\n}\n\n/**\n * REASON → ROW. The join between what a guard actually logged and the row it is an instance of.\n *\n * Keys are the exact `reason` strings the four L2 guards pass to their decision log. Two of them are\n * PREFIXES because the guard interpolates a PR number or a matched segment into the reason\n * (`already-merged PR#123`); those are matched by `l2RowForReason` on prefix, which is why they end in\n * a space or a `(`.\n *\n * l2-matrix.spec.ts reads the four guard sources and asserts every reason literal in them resolves\n * here, so a new exit with no row fails the build rather than logging `row=-` forever.\n */\nconst EXACT_REASON_ROWS: Record<string, number> = {\n // Row 1 — the universal cure that must stay reachable from inside any block.\n 'webpieces-config-read (escape hatch)': 1,\n // Row 2 — the preventive half, decided from command TEXT before any cache is read.\n // (prefix, see PREFIX_REASON_ROWS)\n // Row 4 — the skip list, in its two live spellings.\n 'merged-branch recovery/inspection (allowlisted)': 4,\n 'not-a-content-read (cure/build/metadata)': 4,\n // Row 5 — never WRITE on main, at any freshness. `E` only; the Bash half is rows 6/7.\n 'on-main': 5,\n // Row 6/7 — freshness, for `B` and `R` alike. Both guards log these two literals: read-stale-guard\n // for the Read tool, stale-main-bash-guard for Bash. Same cache, same ancestry test, one verdict.\n 'on-stale-main': 6,\n 'local-main-contains-origin (up to date)': 7,\n 'within-max-commits-behind': 7,\n // Rows 12/13 — composition, judged INSIDE row 6's state: the tree is established behind, and the\n // only remaining question is whether the command carries its own cure and with which operator.\n 'cure-prefixed, && short-circuits the work': 12,\n 'cure-prefixed, work runs anyway': 13,\n // Row 9 — the two unhealthy-fork states.\n 'no-fork-point': 9,\n 'main-moved-conflict': 9,\n // Row 10 — healthy, and the state-B guard's \"this is not my state\" hand-off, which is the same\n // verdict about the same tree.\n 'clean-feature-branch': 10,\n 'not-on-main (state B is another guard)': 10,\n // Row 11 — every \"could not establish\", including the two dirty-tree valves the code still opens\n // (see NOT_DONE) and the unreachable forge.\n 'branch-undeterminable': L2_FAIL_OPEN_ROW,\n 'commit-distance-unknown': L2_FAIL_OPEN_ROW,\n // The target tree HAS no branch name (mid-rebase / mid-bisect), so there is no key into the\n // branch-keyed cache — use case 14, which the row already describes. It used to arrive here as the\n // literal branch `HEAD`, miss in the cache and log `no-sync-cache`: the right verdict recorded under\n // a reason that names a different cause, and therefore uncountable.\n 'detached-head': L2_FAIL_OPEN_ROW,\n // The file being judged lives in a NESTED CLONE (`repositories/**`) — another repo's branch is not\n // this policy's to judge. The bash path calls the same state ALLOW_EXEMPT at L1; on the file path it\n // is an abstention, because nothing about the target tree's state was established.\n 'target-tree-foreign': L2_FAIL_OPEN_ROW,\n 'no-sync-cache': L2_FAIL_OPEN_ROW,\n 'stale-cross-branch-cache': L2_FAIL_OPEN_ROW,\n 'origin-main-unknown': L2_FAIL_OPEN_ROW,\n // `dirty-tree-on-main` and `dirty-merged-branch` used to live here. Both valves are deleted: rows\n // 6 and 8 now block on a dirty tree, because each row's cure carries uncommitted work with you.\n 'no-forge': L2_FAIL_OPEN_ROW,\n // The config-edit bypass logged by the hook adapter before any guard runs — row 1, same universal\n // cure as the config READ above.\n 'config-bypass (feature-branch-guard skipped)': 1,\n};\n\n/** Reasons the guards interpolate a value into. Matched by prefix, longest first. */\nconst PREFIX_REASON_ROWS: Record<string, number> = {\n 'already-merged PR#': 8,\n 'bare checkout of main (': 2,\n // `stale-main content read (` used to live here, mapping the Bash side of row 6. It is gone with\n // the guard exit that emitted it: on `main`, row 5 now blocks before any content-read scan runs,\n // so row 6 is what the table always said it was — the ROW-ONLY row.\n};\n\n/**\n * The row a logged reason belongs to, or null when nothing claims it.\n *\n * Null rather than a default row: a reason with no row is a HOLE in the table, and defaulting it to\n * \"fail-open\" would hide exactly the drift the exhaustiveness spec exists to catch. The guards render\n * null as `row=-`, so an unmapped reason is visible in the log too, not only in CI.\n */\n// webpieces-disable no-function-outside-class -- the matcher over the two tables above, beside them in this data module\nexport function l2RowForReason(reason: string): number | null {\n const exact = EXACT_REASON_ROWS[reason];\n if (exact !== undefined) return exact;\n for (const prefix of Object.keys(PREFIX_REASON_ROWS)) {\n if (reason.startsWith(prefix)) return PREFIX_REASON_ROWS[prefix];\n }\n return null;\n}\n\n/** Every reason string this table claims, for the exhaustiveness spec. */\n// webpieces-disable no-function-outside-class -- pure accessor over the two tables above\nexport function l2MappedReasons(): readonly string[] {\n return [...Object.keys(EXACT_REASON_ROWS), ...Object.keys(PREFIX_REASON_ROWS)];\n}\n\n/** One documented gap between a row and what the guards actually do today. Data-only. */\nexport class L2NotDone {\n constructor(readonly row: number, readonly gap: string, readonly why: string) {}\n}\n\n/**\n * WHERE THE TABLE AND THE CODE DISAGREE, stated rather than papered over.\n *\n * The L1 precedent is `## Not done — \\`o\\` is not exempt yet`: a row the runner cannot reach, named in\n * the generated doc with the reason it has not shipped. The same treatment applies here, and it is what\n * makes it safe to publish a table the guards do not yet dispatch from — a reader is told exactly which\n * rows describe intent rather than behaviour, and the log's `row=` stamps land on row 11 for every one\n * of these, so the trail never claims the strict row fired.\n */\nexport const NOT_DONE: readonly L2NotDone[] = [\n // EMPTY, and that is the goal state: every row in the table is a row the guards actually honour.\n //\n // It held three entries. Row 5's `B` half shipped and then MOVED: on `main`, a write is judged from\n // the branch alone (row 5, above the divider) while Bash is judged on freshness beside the Read tool\n // (rows 6/7), because a build on a CURRENT `main` harms nothing and denying it stranded agents on\n // the very `main` `pnpm wp-sync-main` had just handed them. Rows 6 and 8 held DIRTY-TREE\n // valves, and both are now closed — each of\n // those rows cures with `git checkout -b <new> origin/main`, which carries uncommitted changes onto\n // the new branch, so a dirty tree never trapped anybody. The row 6 entry claimed the dirty argument\n // \"has teeth\" there because its cure is `git pull`; that was a fact about the MESSAGE, which printed\n // only the pull, and the fix was to print both cures rather than to suppress the block.\n //\n // Keep this array. An empty \"Not done\" is a claim worth making explicitly — the doc says so in as\n // many words — and the next divergence between a row and its code belongs here, not in prose.\n];\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { findConfigFile, CONFIG_FILENAME } from '@webpieces/rules-config';
|
package/src/core/load-config.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONFIG_FILENAME = exports.findConfigFile = void 0;
|
|
4
|
-
// Re-export the shared workspace config loader so ai-hooks and the Nx
|
|
5
|
-
// validate-code executor use the same webpieces.config.json.
|
|
6
|
-
var rules_config_1 = require("@webpieces/rules-config");
|
|
7
|
-
Object.defineProperty(exports, "findConfigFile", { enumerable: true, get: function () { return rules_config_1.findConfigFile; } });
|
|
8
|
-
Object.defineProperty(exports, "CONFIG_FILENAME", { enumerable: true, get: function () { return rules_config_1.CONFIG_FILENAME; } });
|
|
9
|
-
//# sourceMappingURL=load-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../../../../../packages/tooling/ai-hook-rules/src/core/load-config.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,6DAA6D;AAC7D,wDAA0E;AAAjE,8GAAA,cAAc,OAAA;AAAE,+GAAA,eAAe,OAAA","sourcesContent":["// Re-export the shared workspace config loader so ai-hooks and the Nx\n// validate-code executor use the same webpieces.config.json.\nexport { findConfigFile, CONFIG_FILENAME } from '@webpieces/rules-config';\n"]}
|