@quickchatai/pi-quickreview 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +75 -2
- package/assets/agents/pass-abstraction.md +64 -0
- package/assets/agents/pass-ask-human.md +134 -0
- package/assets/agents/pass-backcompat.md +67 -0
- package/assets/agents/pass-baseline.md +61 -0
- package/assets/agents/pass-behaviour-delta.md +64 -0
- package/assets/agents/pass-bounds.md +36 -0
- package/assets/agents/pass-claims.md +31 -0
- package/assets/agents/pass-concurrency.md +168 -0
- package/assets/agents/pass-consistency.md +57 -0
- package/assets/agents/pass-contracts.md +30 -0
- package/assets/agents/pass-data-safety.md +54 -0
- package/assets/agents/pass-deferred.md +35 -0
- package/assets/agents/pass-delivery.md +37 -0
- package/assets/agents/pass-duplication.md +60 -0
- package/assets/agents/pass-intent.md +63 -0
- package/assets/agents/pass-lint-conformance.md +46 -0
- package/assets/agents/pass-maintainability.md +67 -0
- package/assets/agents/pass-placement.md +68 -0
- package/assets/agents/pass-prod-risk.md +24 -0
- package/assets/agents/pass-rollout.md +32 -0
- package/assets/agents/pass-roundtrip.md +46 -0
- package/assets/agents/pass-security.md +31 -0
- package/assets/agents/pass-simplicity.md +68 -0
- package/assets/agents/pass-statelessness.md +27 -0
- package/assets/agents/pass-style.md +37 -0
- package/assets/agents/pass-sweep.md +57 -0
- package/assets/agents/pass-tests.md +58 -0
- package/assets/agents/pass-ui.md +23 -0
- package/assets/agents/pass-validate.md +50 -0
- package/assets/agents/pass-widened.md +46 -0
- package/assets/agents/scan/pass-scan.md +86 -0
- package/assets/config.example.toml +1067 -0
- package/assets/deploy/reviewer/AGENTS.override.md +12 -0
- package/assets/profiles/default/README.md +21 -0
- package/assets/profiles/default/addenda/.gitkeep +0 -0
- package/assets/profiles/default/profile.toml +17 -0
- package/assets/profiles/example-django/README.md +21 -0
- package/assets/profiles/example-django/addenda/10-migration-discipline.md +13 -0
- package/assets/profiles/example-django/addenda/20-new-column-nullability.md +12 -0
- package/assets/profiles/example-django/addenda/30-test-doctrine.md +12 -0
- package/assets/profiles/example-django/addenda/40-orm-usage.md +19 -0
- package/assets/profiles/example-django/addenda/50-declared-shape.md +10 -0
- package/assets/profiles/example-django/addenda/60-config-placement.md +14 -0
- package/assets/profiles/example-django/heuristics.toml +24 -0
- package/assets/profiles/example-django/profile.toml +9 -0
- package/assets/profiles/fast/README.md +24 -0
- package/assets/profiles/fast/profile.toml +59 -0
- package/assets/profiles/minimal/README.md +17 -0
- package/assets/profiles/minimal/addenda/.gitkeep +0 -0
- package/assets/profiles/minimal/profile.toml +8 -0
- package/assets/profiles/snappy/README.md +24 -0
- package/assets/profiles/snappy/addenda/10-race-as-question.md +6 -0
- package/assets/profiles/snappy/profile.toml +46 -0
- package/assets/prompts/companion-day-open.md +46 -0
- package/assets/prompts/companion-first-run.md +104 -0
- package/assets/prompts/companion.md +821 -0
- package/assets/prompts/conversation-system.md +117 -0
- package/assets/prompts/eod-sweep.md +120 -0
- package/assets/prompts/onboarding.md +74 -0
- package/assets/prompts/pass-common.md +52 -0
- package/assets/prompts/pass-quality-common.md +22 -0
- package/assets/prompts/round-first.md +874 -0
- package/assets/prompts/round-follow-up.md +991 -0
- package/assets/prompts/round-re-review.md +889 -0
- package/assets/prompts/round-recheck.md +196 -0
- package/assets/prompts/round-staleness.md +856 -0
- package/assets/schemas/review-result.v1.json +391 -0
- package/assets/schemas/scan-result.v1.json +421 -0
- package/assets/schemas/version.v1.json +57 -0
- package/assets/seed-manifest.json +19 -0
- package/assets/seeds/agents/pass-baseline.md +61 -0
- package/assets/seeds/agents/pass-contracts.md +30 -0
- package/assets/seeds/agents/pass-data-safety.md +54 -0
- package/assets/seeds/agents/pass-delivery.md +37 -0
- package/assets/seeds/agents/pass-prod-risk.md +24 -0
- package/assets/seeds/agents/pass-security.md +31 -0
- package/assets/seeds/agents/pass-statelessness.md +27 -0
- package/assets/seeds/agents/pass-ui.md +23 -0
- package/assets/seeds/agents/pass-validate.md +50 -0
- package/assets/seeds/prompts/conversation-system.md +117 -0
- package/assets/seeds/prompts/eod-sweep.md +120 -0
- package/assets/seeds/prompts/pass-common.md +52 -0
- package/dist/extensions/bash-guard.d.ts +467 -0
- package/dist/extensions/bash-guard.d.ts.map +1 -0
- package/dist/extensions/bash-guard.js +3058 -0
- package/dist/extensions/bash-guard.js.map +1 -0
- package/dist/extensions/finding-clusters.d.ts +33 -0
- package/dist/extensions/finding-clusters.d.ts.map +1 -0
- package/dist/extensions/finding-clusters.js +218 -0
- package/dist/extensions/finding-clusters.js.map +1 -0
- package/dist/extensions/ledger-pin.d.ts +76 -0
- package/dist/extensions/ledger-pin.d.ts.map +1 -0
- package/dist/extensions/ledger-pin.js +331 -0
- package/dist/extensions/ledger-pin.js.map +1 -0
- package/dist/extensions/lens.d.ts +43 -0
- package/dist/extensions/lens.d.ts.map +1 -0
- package/dist/extensions/lens.js +150 -0
- package/dist/extensions/lens.js.map +1 -0
- package/dist/extensions/pi-tool.d.ts +22 -0
- package/dist/extensions/pi-tool.d.ts.map +1 -0
- package/dist/extensions/pi-tool.js +20 -0
- package/dist/extensions/pi-tool.js.map +1 -0
- package/dist/extensions/quickreview.d.ts +21 -0
- package/dist/extensions/quickreview.d.ts.map +1 -0
- package/dist/extensions/quickreview.js +132 -0
- package/dist/extensions/quickreview.js.map +1 -0
- package/dist/src/anchors.d.ts +54 -0
- package/dist/src/anchors.d.ts.map +1 -0
- package/dist/src/anchors.js +127 -0
- package/dist/src/anchors.js.map +1 -0
- package/dist/src/assetroot.d.ts +16 -0
- package/dist/src/assetroot.d.ts.map +1 -0
- package/dist/src/assetroot.js +77 -0
- package/dist/src/assetroot.js.map +1 -0
- package/dist/src/authwatch.d.ts +61 -0
- package/dist/src/authwatch.d.ts.map +1 -0
- package/dist/src/authwatch.js +210 -0
- package/dist/src/authwatch.js.map +1 -0
- package/dist/src/budget.d.ts +15 -0
- package/dist/src/budget.d.ts.map +1 -0
- package/dist/src/budget.js +32 -0
- package/dist/src/budget.js.map +1 -0
- package/dist/src/casebudget.d.ts +3 -0
- package/dist/src/casebudget.d.ts.map +1 -0
- package/dist/src/casebudget.js +3 -0
- package/dist/src/casebudget.js.map +1 -0
- package/dist/src/cigate.d.ts +116 -0
- package/dist/src/cigate.d.ts.map +1 -0
- package/dist/src/cigate.js +176 -0
- package/dist/src/cigate.js.map +1 -0
- package/dist/src/codespan.d.ts +46 -0
- package/dist/src/codespan.d.ts.map +1 -0
- package/dist/src/codespan.js +75 -0
- package/dist/src/codespan.js.map +1 -0
- package/dist/src/contextpack.d.ts +56 -0
- package/dist/src/contextpack.d.ts.map +1 -0
- package/dist/src/contextpack.js +195 -0
- package/dist/src/contextpack.js.map +1 -0
- package/dist/src/contract.d.ts +8 -0
- package/dist/src/contract.d.ts.map +1 -0
- package/dist/src/contract.js +21 -0
- package/dist/src/contract.js.map +1 -0
- package/dist/src/coverage.d.ts +32 -0
- package/dist/src/coverage.d.ts.map +1 -0
- package/dist/src/coverage.js +85 -0
- package/dist/src/coverage.js.map +1 -0
- package/dist/src/datafence.d.ts +19 -0
- package/dist/src/datafence.d.ts.map +1 -0
- package/dist/src/datafence.js +60 -0
- package/dist/src/datafence.js.map +1 -0
- package/dist/src/dedup.d.ts +65 -0
- package/dist/src/dedup.d.ts.map +1 -0
- package/dist/src/dedup.js +459 -0
- package/dist/src/dedup.js.map +1 -0
- package/dist/src/depsources.d.ts +304 -0
- package/dist/src/depsources.d.ts.map +1 -0
- package/dist/src/depsources.js +3367 -0
- package/dist/src/depsources.js.map +1 -0
- package/dist/src/diffinput.d.ts +10 -0
- package/dist/src/diffinput.d.ts.map +1 -0
- package/dist/src/diffinput.js +172 -0
- package/dist/src/diffinput.js.map +1 -0
- package/dist/src/doubtwords.d.ts +10 -0
- package/dist/src/doubtwords.d.ts.map +1 -0
- package/dist/src/doubtwords.js +13 -0
- package/dist/src/doubtwords.js.map +1 -0
- package/dist/src/ecosystem.d.ts +148 -0
- package/dist/src/ecosystem.d.ts.map +1 -0
- package/dist/src/ecosystem.js +338 -0
- package/dist/src/ecosystem.js.map +1 -0
- package/dist/src/engine/agentdir.d.ts +5 -0
- package/dist/src/engine/agentdir.d.ts.map +1 -0
- package/dist/src/engine/agentdir.js +21 -0
- package/dist/src/engine/agentdir.js.map +1 -0
- package/dist/src/engine/auth.d.ts +214 -0
- package/dist/src/engine/auth.d.ts.map +1 -0
- package/dist/src/engine/auth.js +374 -0
- package/dist/src/engine/auth.js.map +1 -0
- package/dist/src/engine/budget.d.ts +60 -0
- package/dist/src/engine/budget.d.ts.map +1 -0
- package/dist/src/engine/budget.js +113 -0
- package/dist/src/engine/budget.js.map +1 -0
- package/dist/src/engine/capfd.d.ts +6 -0
- package/dist/src/engine/capfd.d.ts.map +1 -0
- package/dist/src/engine/capfd.js +21 -0
- package/dist/src/engine/capfd.js.map +1 -0
- package/dist/src/engine/caseout.d.ts +66 -0
- package/dist/src/engine/caseout.d.ts.map +1 -0
- package/dist/src/engine/caseout.js +107 -0
- package/dist/src/engine/caseout.js.map +1 -0
- package/dist/src/engine/context.d.ts +57 -0
- package/dist/src/engine/context.d.ts.map +1 -0
- package/dist/src/engine/context.js +212 -0
- package/dist/src/engine/context.js.map +1 -0
- package/dist/src/engine/envmap.d.ts +13 -0
- package/dist/src/engine/envmap.d.ts.map +1 -0
- package/dist/src/engine/envmap.js +372 -0
- package/dist/src/engine/envmap.js.map +1 -0
- package/dist/src/engine/extfiles.d.ts +7 -0
- package/dist/src/engine/extfiles.d.ts.map +1 -0
- package/dist/src/engine/extfiles.js +23 -0
- package/dist/src/engine/extfiles.js.map +1 -0
- package/dist/src/engine/keyroute.d.ts +21 -0
- package/dist/src/engine/keyroute.d.ts.map +1 -0
- package/dist/src/engine/keyroute.js +58 -0
- package/dist/src/engine/keyroute.js.map +1 -0
- package/dist/src/engine/lens/cache-group.d.ts +20 -0
- package/dist/src/engine/lens/cache-group.d.ts.map +1 -0
- package/dist/src/engine/lens/cache-group.js +31 -0
- package/dist/src/engine/lens/cache-group.js.map +1 -0
- package/dist/src/engine/lens/cache-run.d.ts +65 -0
- package/dist/src/engine/lens/cache-run.d.ts.map +1 -0
- package/dist/src/engine/lens/cache-run.js +159 -0
- package/dist/src/engine/lens/cache-run.js.map +1 -0
- package/dist/src/engine/lens/deadline.d.ts +54 -0
- package/dist/src/engine/lens/deadline.d.ts.map +1 -0
- package/dist/src/engine/lens/deadline.js +111 -0
- package/dist/src/engine/lens/deadline.js.map +1 -0
- package/dist/src/engine/lens/engine-tools.d.ts +13 -0
- package/dist/src/engine/lens/engine-tools.d.ts.map +1 -0
- package/dist/src/engine/lens/engine-tools.js +37 -0
- package/dist/src/engine/lens/engine-tools.js.map +1 -0
- package/dist/src/engine/lens/env.d.ts +23 -0
- package/dist/src/engine/lens/env.d.ts.map +1 -0
- package/dist/src/engine/lens/env.js +42 -0
- package/dist/src/engine/lens/env.js.map +1 -0
- package/dist/src/engine/lens/launch-plan.d.ts +63 -0
- package/dist/src/engine/lens/launch-plan.d.ts.map +1 -0
- package/dist/src/engine/lens/launch-plan.js +203 -0
- package/dist/src/engine/lens/launch-plan.js.map +1 -0
- package/dist/src/engine/lens/leaf-cache.d.ts +22 -0
- package/dist/src/engine/lens/leaf-cache.d.ts.map +1 -0
- package/dist/src/engine/lens/leaf-cache.js +115 -0
- package/dist/src/engine/lens/leaf-cache.js.map +1 -0
- package/dist/src/engine/lens/permits.d.ts +14 -0
- package/dist/src/engine/lens/permits.d.ts.map +1 -0
- package/dist/src/engine/lens/permits.js +18 -0
- package/dist/src/engine/lens/permits.js.map +1 -0
- package/dist/src/engine/lens/registry.d.ts +55 -0
- package/dist/src/engine/lens/registry.d.ts.map +1 -0
- package/dist/src/engine/lens/registry.js +140 -0
- package/dist/src/engine/lens/registry.js.map +1 -0
- package/dist/src/engine/lens/round-lens.d.ts +16 -0
- package/dist/src/engine/lens/round-lens.d.ts.map +1 -0
- package/dist/src/engine/lens/round-lens.js +46 -0
- package/dist/src/engine/lens/round-lens.js.map +1 -0
- package/dist/src/engine/lens/runlens.d.ts +103 -0
- package/dist/src/engine/lens/runlens.d.ts.map +1 -0
- package/dist/src/engine/lens/runlens.js +538 -0
- package/dist/src/engine/lens/runlens.js.map +1 -0
- package/dist/src/engine/lens/section.d.ts +19 -0
- package/dist/src/engine/lens/section.d.ts.map +1 -0
- package/dist/src/engine/lens/section.js +40 -0
- package/dist/src/engine/lens/section.js.map +1 -0
- package/dist/src/engine/lens/semaphore.d.ts +13 -0
- package/dist/src/engine/lens/semaphore.d.ts.map +1 -0
- package/dist/src/engine/lens/semaphore.js +44 -0
- package/dist/src/engine/lens/semaphore.js.map +1 -0
- package/dist/src/engine/lens/tool.d.ts +34 -0
- package/dist/src/engine/lens/tool.d.ts.map +1 -0
- package/dist/src/engine/lens/tool.js +345 -0
- package/dist/src/engine/lens/tool.js.map +1 -0
- package/dist/src/engine/lens/wave.d.ts +63 -0
- package/dist/src/engine/lens/wave.d.ts.map +1 -0
- package/dist/src/engine/lens/wave.js +95 -0
- package/dist/src/engine/lens/wave.js.map +1 -0
- package/dist/src/engine/livesessions.d.ts +21 -0
- package/dist/src/engine/livesessions.d.ts.map +1 -0
- package/dist/src/engine/livesessions.js +57 -0
- package/dist/src/engine/livesessions.js.map +1 -0
- package/dist/src/engine/livewire.d.ts +18 -0
- package/dist/src/engine/livewire.d.ts.map +1 -0
- package/dist/src/engine/livewire.js +31 -0
- package/dist/src/engine/livewire.js.map +1 -0
- package/dist/src/engine/openable.d.ts +37 -0
- package/dist/src/engine/openable.d.ts.map +1 -0
- package/dist/src/engine/openable.js +120 -0
- package/dist/src/engine/openable.js.map +1 -0
- package/dist/src/engine/pisdk.d.ts +226 -0
- package/dist/src/engine/pisdk.d.ts.map +1 -0
- package/dist/src/engine/pisdk.js +552 -0
- package/dist/src/engine/pisdk.js.map +1 -0
- package/dist/src/engine/port.d.ts +144 -0
- package/dist/src/engine/port.d.ts.map +1 -0
- package/dist/src/engine/port.js +16 -0
- package/dist/src/engine/port.js.map +1 -0
- package/dist/src/engine/prompts.d.ts +159 -0
- package/dist/src/engine/prompts.d.ts.map +1 -0
- package/dist/src/engine/prompts.js +339 -0
- package/dist/src/engine/prompts.js.map +1 -0
- package/dist/src/engine/render.d.ts +10 -0
- package/dist/src/engine/render.d.ts.map +1 -0
- package/dist/src/engine/render.js +23 -0
- package/dist/src/engine/render.js.map +1 -0
- package/dist/src/engine/reviewruntime.d.ts +13 -0
- package/dist/src/engine/reviewruntime.d.ts.map +1 -0
- package/dist/src/engine/reviewruntime.js +35 -0
- package/dist/src/engine/reviewruntime.js.map +1 -0
- package/dist/src/engine/reviewsdk.d.ts +75 -0
- package/dist/src/engine/reviewsdk.d.ts.map +1 -0
- package/dist/src/engine/reviewsdk.js +180 -0
- package/dist/src/engine/reviewsdk.js.map +1 -0
- package/dist/src/engine/round.d.ts +166 -0
- package/dist/src/engine/round.d.ts.map +1 -0
- package/dist/src/engine/round.js +543 -0
- package/dist/src/engine/round.js.map +1 -0
- package/dist/src/engine/roundagents.d.ts +17 -0
- package/dist/src/engine/roundagents.d.ts.map +1 -0
- package/dist/src/engine/roundagents.js +49 -0
- package/dist/src/engine/roundagents.js.map +1 -0
- package/dist/src/engine/roundevents.d.ts +110 -0
- package/dist/src/engine/roundevents.d.ts.map +1 -0
- package/dist/src/engine/roundevents.js +276 -0
- package/dist/src/engine/roundevents.js.map +1 -0
- package/dist/src/engine/roundsdk.d.ts +33 -0
- package/dist/src/engine/roundsdk.d.ts.map +1 -0
- package/dist/src/engine/roundsdk.js +76 -0
- package/dist/src/engine/roundsdk.js.map +1 -0
- package/dist/src/engine/sdkruntime.d.ts +23 -0
- package/dist/src/engine/sdkruntime.d.ts.map +1 -0
- package/dist/src/engine/sdkruntime.js +340 -0
- package/dist/src/engine/sdkruntime.js.map +1 -0
- package/dist/src/engine/select.d.ts +16 -0
- package/dist/src/engine/select.d.ts.map +1 -0
- package/dist/src/engine/select.js +32 -0
- package/dist/src/engine/select.js.map +1 -0
- package/dist/src/engine/sessionwrap.d.ts +4 -0
- package/dist/src/engine/sessionwrap.d.ts.map +1 -0
- package/dist/src/engine/sessionwrap.js +31 -0
- package/dist/src/engine/sessionwrap.js.map +1 -0
- package/dist/src/engine/toolfence.d.ts +90 -0
- package/dist/src/engine/toolfence.d.ts.map +1 -0
- package/dist/src/engine/toolfence.js +378 -0
- package/dist/src/engine/toolfence.js.map +1 -0
- package/dist/src/engine/tooluid.d.ts +128 -0
- package/dist/src/engine/tooluid.d.ts.map +1 -0
- package/dist/src/engine/tooluid.js +401 -0
- package/dist/src/engine/tooluid.js.map +1 -0
- package/dist/src/envstrip.d.ts +10 -0
- package/dist/src/envstrip.d.ts.map +1 -0
- package/dist/src/envstrip.js +15 -0
- package/dist/src/envstrip.js.map +1 -0
- package/dist/src/escalationprompt.d.ts +22 -0
- package/dist/src/escalationprompt.d.ts.map +1 -0
- package/dist/src/escalationprompt.js +54 -0
- package/dist/src/escalationprompt.js.map +1 -0
- package/dist/src/execfn.d.ts +29 -0
- package/dist/src/execfn.d.ts.map +1 -0
- package/dist/src/execfn.js +55 -0
- package/dist/src/execfn.js.map +1 -0
- package/dist/src/finding-chain.d.ts +40 -0
- package/dist/src/finding-chain.d.ts.map +1 -0
- package/dist/src/finding-chain.js +76 -0
- package/dist/src/finding-chain.js.map +1 -0
- package/dist/src/finding-row.d.ts +24 -0
- package/dist/src/finding-row.d.ts.map +1 -0
- package/dist/src/finding-row.js +26 -0
- package/dist/src/finding-row.js.map +1 -0
- package/dist/src/findingkey.d.ts +99 -0
- package/dist/src/findingkey.d.ts.map +1 -0
- package/dist/src/findingkey.js +210 -0
- package/dist/src/findingkey.js.map +1 -0
- package/dist/src/findingsrecord.d.ts +175 -0
- package/dist/src/findingsrecord.d.ts.map +1 -0
- package/dist/src/findingsrecord.js +410 -0
- package/dist/src/findingsrecord.js.map +1 -0
- package/dist/src/followup-mode.d.ts +4 -0
- package/dist/src/followup-mode.d.ts.map +1 -0
- package/dist/src/followup-mode.js +6 -0
- package/dist/src/followup-mode.js.map +1 -0
- package/dist/src/gate.d.ts +199 -0
- package/dist/src/gate.d.ts.map +1 -0
- package/dist/src/gate.js +315 -0
- package/dist/src/gate.js.map +1 -0
- package/dist/src/ghcred.d.ts +58 -0
- package/dist/src/ghcred.d.ts.map +1 -0
- package/dist/src/ghcred.js +139 -0
- package/dist/src/ghcred.js.map +1 -0
- package/dist/src/githubAuth.d.ts +32 -0
- package/dist/src/githubAuth.d.ts.map +1 -0
- package/dist/src/githubAuth.js +116 -0
- package/dist/src/githubAuth.js.map +1 -0
- package/dist/src/githubcore.d.ts +20 -0
- package/dist/src/githubcore.d.ts.map +1 -0
- package/dist/src/githubcore.js +20 -0
- package/dist/src/githubcore.js.map +1 -0
- package/dist/src/glob.d.ts +11 -0
- package/dist/src/glob.d.ts.map +1 -0
- package/dist/src/glob.js +69 -0
- package/dist/src/glob.js.map +1 -0
- package/dist/src/guards.d.ts +93 -0
- package/dist/src/guards.d.ts.map +1 -0
- package/dist/src/guards.js +306 -0
- package/dist/src/guards.js.map +1 -0
- package/dist/src/heartbeat.d.ts +29 -0
- package/dist/src/heartbeat.d.ts.map +1 -0
- package/dist/src/heartbeat.js +87 -0
- package/dist/src/heartbeat.js.map +1 -0
- package/dist/src/heuristics.d.ts +247 -0
- package/dist/src/heuristics.d.ts.map +1 -0
- package/dist/src/heuristics.js +927 -0
- package/dist/src/heuristics.js.map +1 -0
- package/dist/src/homes.d.ts +181 -0
- package/dist/src/homes.d.ts.map +1 -0
- package/dist/src/homes.js +242 -0
- package/dist/src/homes.js.map +1 -0
- package/dist/src/hunkheader.d.ts +11 -0
- package/dist/src/hunkheader.d.ts.map +1 -0
- package/dist/src/hunkheader.js +18 -0
- package/dist/src/hunkheader.js.map +1 -0
- package/dist/src/include.d.ts +435 -0
- package/dist/src/include.d.ts.map +1 -0
- package/dist/src/include.js +1692 -0
- package/dist/src/include.js.map +1 -0
- package/dist/src/launchvocab.d.ts +36 -0
- package/dist/src/launchvocab.d.ts.map +1 -0
- package/dist/src/launchvocab.js +59 -0
- package/dist/src/launchvocab.js.map +1 -0
- package/dist/src/ledgercarry.d.ts +24 -0
- package/dist/src/ledgercarry.d.ts.map +1 -0
- package/dist/src/ledgercarry.js +109 -0
- package/dist/src/ledgercarry.js.map +1 -0
- package/dist/src/lensids.d.ts +7 -0
- package/dist/src/lensids.d.ts.map +1 -0
- package/dist/src/lensids.js +53 -0
- package/dist/src/lensids.js.map +1 -0
- package/dist/src/lensplanning.d.ts +8 -0
- package/dist/src/lensplanning.d.ts.map +1 -0
- package/dist/src/lensplanning.js +126 -0
- package/dist/src/lensplanning.js.map +1 -0
- package/dist/src/lensresult.d.ts +94 -0
- package/dist/src/lensresult.d.ts.map +1 -0
- package/dist/src/lensresult.js +162 -0
- package/dist/src/lensresult.js.map +1 -0
- package/dist/src/lenstuning.d.ts +97 -0
- package/dist/src/lenstuning.d.ts.map +1 -0
- package/dist/src/lenstuning.js +326 -0
- package/dist/src/lenstuning.js.map +1 -0
- package/dist/src/lintconfig.d.ts +31 -0
- package/dist/src/lintconfig.d.ts.map +1 -0
- package/dist/src/lintconfig.js +543 -0
- package/dist/src/lintconfig.js.map +1 -0
- package/dist/src/live/events.d.ts +188 -0
- package/dist/src/live/events.d.ts.map +1 -0
- package/dist/src/live/events.js +136 -0
- package/dist/src/live/events.js.map +1 -0
- package/dist/src/live/writer.d.ts +54 -0
- package/dist/src/live/writer.d.ts.map +1 -0
- package/dist/src/live/writer.js +516 -0
- package/dist/src/live/writer.js.map +1 -0
- package/dist/src/localreview.d.ts +128 -0
- package/dist/src/localreview.d.ts.map +1 -0
- package/dist/src/localreview.js +426 -0
- package/dist/src/localreview.js.map +1 -0
- package/dist/src/loosenedtests.d.ts +13 -0
- package/dist/src/loosenedtests.d.ts.map +1 -0
- package/dist/src/loosenedtests.js +188 -0
- package/dist/src/loosenedtests.js.map +1 -0
- package/dist/src/memoryport.d.ts +264 -0
- package/dist/src/memoryport.d.ts.map +1 -0
- package/dist/src/memoryport.js +445 -0
- package/dist/src/memoryport.js.map +1 -0
- package/dist/src/migrations.d.ts +106 -0
- package/dist/src/migrations.d.ts.map +1 -0
- package/dist/src/migrations.js +373 -0
- package/dist/src/migrations.js.map +1 -0
- package/dist/src/oneshot.d.ts +12 -0
- package/dist/src/oneshot.d.ts.map +1 -0
- package/dist/src/oneshot.js +8 -0
- package/dist/src/oneshot.js.map +1 -0
- package/dist/src/packing.d.ts +11 -0
- package/dist/src/packing.d.ts.map +1 -0
- package/dist/src/packing.js +31 -0
- package/dist/src/packing.js.map +1 -0
- package/dist/src/passes.d.ts +16 -0
- package/dist/src/passes.d.ts.map +1 -0
- package/dist/src/passes.js +104 -0
- package/dist/src/passes.js.map +1 -0
- package/dist/src/passtasks.d.ts +68 -0
- package/dist/src/passtasks.d.ts.map +1 -0
- package/dist/src/passtasks.js +360 -0
- package/dist/src/passtasks.js.map +1 -0
- package/dist/src/pathinside.d.ts +5 -0
- package/dist/src/pathinside.d.ts.map +1 -0
- package/dist/src/pathinside.js +9 -0
- package/dist/src/pathinside.js.map +1 -0
- package/dist/src/pibuiltins.d.ts +36 -0
- package/dist/src/pibuiltins.d.ts.map +1 -0
- package/dist/src/pibuiltins.js +83 -0
- package/dist/src/pibuiltins.js.map +1 -0
- package/dist/src/plankey.d.ts +4 -0
- package/dist/src/plankey.d.ts.map +1 -0
- package/dist/src/plankey.js +10 -0
- package/dist/src/plankey.js.map +1 -0
- package/dist/src/planner.d.ts +375 -0
- package/dist/src/planner.d.ts.map +1 -0
- package/dist/src/planner.js +722 -0
- package/dist/src/planner.js.map +1 -0
- package/dist/src/plugin/args.d.ts +19 -0
- package/dist/src/plugin/args.d.ts.map +1 -0
- package/dist/src/plugin/args.js +107 -0
- package/dist/src/plugin/args.js.map +1 -0
- package/dist/src/plugin/index.d.ts +3 -0
- package/dist/src/plugin/index.d.ts.map +1 -0
- package/dist/src/plugin/index.js +14 -0
- package/dist/src/plugin/index.js.map +1 -0
- package/dist/src/plugin/login.d.ts +39 -0
- package/dist/src/plugin/login.d.ts.map +1 -0
- package/dist/src/plugin/login.js +73 -0
- package/dist/src/plugin/login.js.map +1 -0
- package/dist/src/plugin/review.d.ts +27 -0
- package/dist/src/plugin/review.d.ts.map +1 -0
- package/dist/src/plugin/review.js +298 -0
- package/dist/src/plugin/review.js.map +1 -0
- package/dist/src/plugin/runner.d.ts +6 -0
- package/dist/src/plugin/runner.d.ts.map +1 -0
- package/dist/src/plugin/runner.js +65 -0
- package/dist/src/plugin/runner.js.map +1 -0
- package/dist/src/plugin/scan.d.ts +79 -0
- package/dist/src/plugin/scan.d.ts.map +1 -0
- package/dist/src/plugin/scan.js +348 -0
- package/dist/src/plugin/scan.js.map +1 -0
- package/dist/src/plugin/session.d.ts +56 -0
- package/dist/src/plugin/session.d.ts.map +1 -0
- package/dist/src/plugin/session.js +2 -0
- package/dist/src/plugin/session.js.map +1 -0
- package/dist/src/plugin/setup.d.ts +19 -0
- package/dist/src/plugin/setup.d.ts.map +1 -0
- package/dist/src/plugin/setup.js +142 -0
- package/dist/src/plugin/setup.js.map +1 -0
- package/dist/src/plugin/versiongate.d.ts +26 -0
- package/dist/src/plugin/versiongate.d.ts.map +1 -0
- package/dist/src/plugin/versiongate.js +83 -0
- package/dist/src/plugin/versiongate.js.map +1 -0
- package/dist/src/postingkey.d.ts +8 -0
- package/dist/src/postingkey.d.ts.map +1 -0
- package/dist/src/postingkey.js +25 -0
- package/dist/src/postingkey.js.map +1 -0
- package/dist/src/postingpolicy.d.ts +108 -0
- package/dist/src/postingpolicy.d.ts.map +1 -0
- package/dist/src/postingpolicy.js +341 -0
- package/dist/src/postingpolicy.js.map +1 -0
- package/dist/src/pr-identity.d.ts +3 -0
- package/dist/src/pr-identity.d.ts.map +1 -0
- package/dist/src/pr-identity.js +9 -0
- package/dist/src/pr-identity.js.map +1 -0
- package/dist/src/prdelta.d.ts +181 -0
- package/dist/src/prdelta.d.ts.map +1 -0
- package/dist/src/prdelta.js +501 -0
- package/dist/src/prdelta.js.map +1 -0
- package/dist/src/pricing.d.ts +94 -0
- package/dist/src/pricing.d.ts.map +1 -0
- package/dist/src/pricing.js +209 -0
- package/dist/src/pricing.js.map +1 -0
- package/dist/src/priorfindings.d.ts +167 -0
- package/dist/src/priorfindings.d.ts.map +1 -0
- package/dist/src/priorfindings.js +445 -0
- package/dist/src/priorfindings.js.map +1 -0
- package/dist/src/priortasks.d.ts +31 -0
- package/dist/src/priortasks.d.ts.map +1 -0
- package/dist/src/priortasks.js +119 -0
- package/dist/src/priortasks.js.map +1 -0
- package/dist/src/profilelookup.d.ts +59 -0
- package/dist/src/profilelookup.d.ts.map +1 -0
- package/dist/src/profilelookup.js +98 -0
- package/dist/src/profilelookup.js.map +1 -0
- package/dist/src/profileoverrides.d.ts +91 -0
- package/dist/src/profileoverrides.d.ts.map +1 -0
- package/dist/src/profileoverrides.js +313 -0
- package/dist/src/profileoverrides.js.map +1 -0
- package/dist/src/profiles.d.ts +144 -0
- package/dist/src/profiles.d.ts.map +1 -0
- package/dist/src/profiles.js +604 -0
- package/dist/src/profiles.js.map +1 -0
- package/dist/src/promptdoc.d.ts +3 -0
- package/dist/src/promptdoc.d.ts.map +1 -0
- package/dist/src/promptdoc.js +18 -0
- package/dist/src/promptdoc.js.map +1 -0
- package/dist/src/prtarget.d.ts +70 -0
- package/dist/src/prtarget.d.ts.map +1 -0
- package/dist/src/prtarget.js +181 -0
- package/dist/src/prtarget.js.map +1 -0
- package/dist/src/recheckorder.d.ts +32 -0
- package/dist/src/recheckorder.d.ts.map +1 -0
- package/dist/src/recheckorder.js +5 -0
- package/dist/src/recheckorder.js.map +1 -0
- package/dist/src/reviewapi.d.ts +207 -0
- package/dist/src/reviewapi.d.ts.map +1 -0
- package/dist/src/reviewapi.js +939 -0
- package/dist/src/reviewapi.js.map +1 -0
- package/dist/src/reviewbotfindings.d.ts +33 -0
- package/dist/src/reviewbotfindings.d.ts.map +1 -0
- package/dist/src/reviewbotfindings.js +80 -0
- package/dist/src/reviewbotfindings.js.map +1 -0
- package/dist/src/reviewconfig.d.ts +741 -0
- package/dist/src/reviewconfig.d.ts.map +1 -0
- package/dist/src/reviewconfig.js +797 -0
- package/dist/src/reviewconfig.js.map +1 -0
- package/dist/src/reviewdelta.d.ts +51 -0
- package/dist/src/reviewdelta.d.ts.map +1 -0
- package/dist/src/reviewdelta.js +119 -0
- package/dist/src/reviewdelta.js.map +1 -0
- package/dist/src/reviewdest.d.ts +86 -0
- package/dist/src/reviewdest.d.ts.map +1 -0
- package/dist/src/reviewdest.js +142 -0
- package/dist/src/reviewdest.js.map +1 -0
- package/dist/src/reviewerstub.d.ts +12 -0
- package/dist/src/reviewerstub.d.ts.map +1 -0
- package/dist/src/reviewerstub.js +28 -0
- package/dist/src/reviewerstub.js.map +1 -0
- package/dist/src/reviewhost.d.ts +58 -0
- package/dist/src/reviewhost.d.ts.map +1 -0
- package/dist/src/reviewhost.js +135 -0
- package/dist/src/reviewhost.js.map +1 -0
- package/dist/src/reviewpost.d.ts +79 -0
- package/dist/src/reviewpost.d.ts.map +1 -0
- package/dist/src/reviewpost.js +233 -0
- package/dist/src/reviewpost.js.map +1 -0
- package/dist/src/reviewrender.d.ts +154 -0
- package/dist/src/reviewrender.d.ts.map +1 -0
- package/dist/src/reviewrender.js +480 -0
- package/dist/src/reviewrender.js.map +1 -0
- package/dist/src/reviewstate.d.ts +62 -0
- package/dist/src/reviewstate.d.ts.map +1 -0
- package/dist/src/reviewstate.js +167 -0
- package/dist/src/reviewstate.js.map +1 -0
- package/dist/src/reviewstore.d.ts +17 -0
- package/dist/src/reviewstore.d.ts.map +1 -0
- package/dist/src/reviewstore.js +105 -0
- package/dist/src/reviewstore.js.map +1 -0
- package/dist/src/round-progress.d.ts +120 -0
- package/dist/src/round-progress.d.ts.map +1 -0
- package/dist/src/round-progress.js +172 -0
- package/dist/src/round-progress.js.map +1 -0
- package/dist/src/round-stage-deadlines.d.ts +12 -0
- package/dist/src/round-stage-deadlines.d.ts.map +1 -0
- package/dist/src/round-stage-deadlines.js +10 -0
- package/dist/src/round-stage-deadlines.js.map +1 -0
- package/dist/src/session-command.d.ts +19 -0
- package/dist/src/session-command.d.ts.map +1 -0
- package/dist/src/session-command.js +20 -0
- package/dist/src/session-command.js.map +1 -0
- package/dist/src/settledread.d.ts +61 -0
- package/dist/src/settledread.d.ts.map +1 -0
- package/dist/src/settledread.js +135 -0
- package/dist/src/settledread.js.map +1 -0
- package/dist/src/severity.d.ts +167 -0
- package/dist/src/severity.d.ts.map +1 -0
- package/dist/src/severity.js +364 -0
- package/dist/src/severity.js.map +1 -0
- package/dist/src/severityrank.d.ts +8 -0
- package/dist/src/severityrank.d.ts.map +1 -0
- package/dist/src/severityrank.js +16 -0
- package/dist/src/severityrank.js.map +1 -0
- package/dist/src/standing-review.d.ts +45 -0
- package/dist/src/standing-review.d.ts.map +1 -0
- package/dist/src/standing-review.js +43 -0
- package/dist/src/standing-review.js.map +1 -0
- package/dist/src/storerows.d.ts +225 -0
- package/dist/src/storerows.d.ts.map +1 -0
- package/dist/src/storerows.js +7 -0
- package/dist/src/storerows.js.map +1 -0
- package/dist/src/styleguide.d.ts +25 -0
- package/dist/src/styleguide.d.ts.map +1 -0
- package/dist/src/styleguide.js +272 -0
- package/dist/src/styleguide.js.map +1 -0
- package/dist/src/sweepstatus.d.ts +42 -0
- package/dist/src/sweepstatus.d.ts.map +1 -0
- package/dist/src/sweepstatus.js +97 -0
- package/dist/src/sweepstatus.js.map +1 -0
- package/dist/src/templates.d.ts +243 -0
- package/dist/src/templates.d.ts.map +1 -0
- package/dist/src/templates.js +847 -0
- package/dist/src/templates.js.map +1 -0
- package/dist/src/types.d.ts +639 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +90 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/unifieddiff.d.ts +22 -0
- package/dist/src/unifieddiff.d.ts.map +1 -0
- package/dist/src/unifieddiff.js +176 -0
- package/dist/src/unifieddiff.js.map +1 -0
- package/dist/src/yieldloop.d.ts +2 -0
- package/dist/src/yieldloop.d.ts.map +1 -0
- package/dist/src/yieldloop.js +14 -0
- package/dist/src/yieldloop.js.map +1 -0
- package/package.json +60 -4
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import type { ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/**
|
|
3
|
+
* Read-only programs a review session may run directly.
|
|
4
|
+
*
|
|
5
|
+
* **`awk` is deliberately ABSENT, and must not be re-added.** No regex gating
|
|
6
|
+
* of awk is sound: it is a programming language in which `system(x)`,
|
|
7
|
+
* `x | getline`, `print | x` and `print > x` are all first-class and every one
|
|
8
|
+
* takes an ARBITRARY EXPRESSION, so a bare identifier holding the command
|
|
9
|
+
* defeats any rule keyed on the token after the operator. VERIFIED executing:
|
|
10
|
+
*
|
|
11
|
+
* awk 'BEGIN{c="sh"; print "<cmd>" | c}' → ran <cmd>
|
|
12
|
+
* awk 'BEGIN{f="<path>"; print "x" > f}' → wrote <path>
|
|
13
|
+
* awk 'BEGIN{f=".git/config"; printf … >> f}' → then a plain `git diff` ran <cmd>
|
|
14
|
+
*
|
|
15
|
+
* The first is arbitrary execution with no config file touched, so the
|
|
16
|
+
* round-boundary integrity check cannot see it either.
|
|
17
|
+
*
|
|
18
|
+
* The cost is close to zero: `awk` appears in no prompt, no agent and no
|
|
19
|
+
* session-sanctioned script. A reviewer keeps `rg`, `grep`, `jq`, `cut`,
|
|
20
|
+
* `sort`, `uniq`, `head`, `tail`, `wc`, `nl`, `tr` and `sed -n`; `gawk`,
|
|
21
|
+
* `mawk` and `nawk` are off ALLOWED too.
|
|
22
|
+
*
|
|
23
|
+
* `sed` stays, on a narrower argument: its script language is small and
|
|
24
|
+
* fixed — its file/exec verbs are the `e`/`w`/`W`/`r`/`R` commands and the
|
|
25
|
+
* `e`/`w` flags of `s` — so `checkSedInvocation` PARSES every invocation
|
|
26
|
+
* (options, addresses, any `s` delimiter) and refuses anything it cannot
|
|
27
|
+
* classify. awk's language takes an expression anywhere; sed's does not.
|
|
28
|
+
*
|
|
29
|
+
* Exported in ORDER because the sentence every built pass reads ("Allowed
|
|
30
|
+
* commands: …", `packages/pi-plugin/src/include.ts`) is rendered from this array: a model told a
|
|
31
|
+
* tool exists and then refused reads the refusal as a malfunction, so the
|
|
32
|
+
* enforcing half is the only author of the advertised half;
|
|
33
|
+
* `tests/fences.test.ts` holds the advertised set equal to this array, runs
|
|
34
|
+
* every advertised program through `checkBashCommand` (from source), and
|
|
35
|
+
* separately checks the rendered sentence against `packages/pi-plugin/dist/src/include.js`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ALLOWED_PROGRAMS: readonly string[];
|
|
38
|
+
export interface BashCheck {
|
|
39
|
+
allowed: boolean;
|
|
40
|
+
reason?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* What the guard's policy is judged against, resolved: the sandbox root that
|
|
44
|
+
* owns the sanctioned script bytes, whether this is a regression replay
|
|
45
|
+
* session, and the secrets dirs. `createBashGuard` builds one from its config
|
|
46
|
+
* at construction; the exported pure checkers take one as an argument, and
|
|
47
|
+
* `extensions/cli/bash-guard-ambient.ts` supplies the process-derived one.
|
|
48
|
+
*/
|
|
49
|
+
export interface GuardPolicy {
|
|
50
|
+
sandboxRoot: string;
|
|
51
|
+
/** The cwd the secret and /proc belts resolve a relative word against when a
|
|
52
|
+
* `cd` has made the command's own cwd unknown. */
|
|
53
|
+
cwd: string;
|
|
54
|
+
/** A regression replay session (src/replay.ts), spawned with `QCR_REPLAY=1`
|
|
55
|
+
* on its pi's own environment, which no bash command can change. It posts
|
|
56
|
+
* nothing and reads nothing from GitHub, so no sandbox script is sanctioned
|
|
57
|
+
* in it at all: the relative-spelling rule alone was reachable by
|
|
58
|
+
* `cd <sandbox root> && bash scripts/post-review.sh …`. */
|
|
59
|
+
replay: boolean;
|
|
60
|
+
/** A takeover (`QCR_TAKEOVER=1` on its pi's own environment, which no bash
|
|
61
|
+
* command can change): the operator works in the PR's real session and nothing
|
|
62
|
+
* is posted from it. The scripts that post are not sanctioned there; the
|
|
63
|
+
* reading ones are. The daemon refuses a takeover's posts as well. */
|
|
64
|
+
noPost: boolean;
|
|
65
|
+
/** The secret-path context minus the cwd, which is per call. */
|
|
66
|
+
secrets: Omit<SecretPathContext, "cwd">;
|
|
67
|
+
}
|
|
68
|
+
interface ShellWords {
|
|
69
|
+
words: string[];
|
|
70
|
+
/** A quote was still open at the end of the text. On a segment produced by
|
|
71
|
+
* `splitShellSegments` that means the segment was CUT at a `$(` or backtick:
|
|
72
|
+
* the rest of the word is assembled at runtime by a substitution. */
|
|
73
|
+
unterminated: boolean;
|
|
74
|
+
/** A `$'…'` held an escape this function does not decode (`\x3b`, `\073`,
|
|
75
|
+
* `\u003b`): the words carry the escape's letters, not what bash would
|
|
76
|
+
* produce, so a payload built from them is not what bash runs. */
|
|
77
|
+
undecoded: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Split text into shell WORDS: quote-aware, DEQUOTED, split only on unquoted
|
|
81
|
+
* whitespace. `'…'`, `"…"` (with `\"` and `\\`), `$'…'` (ANSI-C: `\n`, `\t`,
|
|
82
|
+
* `\\`, `\'`, `\"`) and backslash escapes are all resolved, so what comes out
|
|
83
|
+
* is what bash would hand the program as argv. Unlike the whitespace re-split
|
|
84
|
+
* in `checkBashCommand`, this preserves separators (`;`, newline, `&&`) that
|
|
85
|
+
* live INSIDE a quoted word — which is exactly what a `bash -c` payload is.
|
|
86
|
+
*/
|
|
87
|
+
export declare function shellWords(s: string): ShellWords;
|
|
88
|
+
/** Quote/substitution-aware segment splitter (a quote-blind split shreds
|
|
89
|
+
* `rg 'a|b'` on the quoted pipe and vets pattern fragments as programs). Rules:
|
|
90
|
+
* - single quotes: everything inside is literal;
|
|
91
|
+
* - double quotes: separators are literal, but `$(` and backticks still
|
|
92
|
+
* execute, so they still split (quote state restored at the matching `)`);
|
|
93
|
+
* - backslash escapes the next char (outside single quotes);
|
|
94
|
+
* - unquoted `; & | && || newline ( )` split; `$(`/`)` track nesting so the
|
|
95
|
+
* command FOLLOWING a substitution lands in its own segment and is vetted
|
|
96
|
+
* (merging it back would let `A="$(cat x)" python3 e.py` through). */
|
|
97
|
+
export declare function splitShellSegments(cmd: string): string[];
|
|
98
|
+
/** The root-credential check, plus the App-secret belt below.
|
|
99
|
+
* Exported so the reason is testable on its own. extensions/cli/bash-guard-ambient.ts
|
|
100
|
+
* is the same call with `ctx` defaulted to this process's own cwd, home and
|
|
101
|
+
* secrets dirs. */
|
|
102
|
+
export declare function checkSecretPaths(cmd: string, ctx: SecretPathContext): BashCheck;
|
|
103
|
+
/**
|
|
104
|
+
* The App-secret belt — and what it is NOT.
|
|
105
|
+
*
|
|
106
|
+
* `cat` is a sanctioned reader, and a posted review body is a channel to
|
|
107
|
+
* GitHub, so without this a prompt-injected session could read
|
|
108
|
+
* `/opt/quickreview/secrets/app.pem` and publish the App's private key. This
|
|
109
|
+
* cheap interim belt refuses any session command, and any read/write tool
|
|
110
|
+
* call, that NAMES one of the App's secret files or the secrets dir itself.
|
|
111
|
+
*
|
|
112
|
+
* It is a SPELLING belt. Variable indirection (`d=/opt/quickreview/sec; cat
|
|
113
|
+
* ${d}rets/app.pem`), a recursive read of an ancestor (`grep -r . /opt`), a
|
|
114
|
+
* symlink, a file list fed to `xargs` — all of these still reach the files,
|
|
115
|
+
* and no amount of pattern work here closes that class. The real fix is that
|
|
116
|
+
* a session cannot read the dir at all: a uid or mount split. Until then this
|
|
117
|
+
* turns the obvious spellings into a loud refusal.
|
|
118
|
+
*
|
|
119
|
+
* The sanctioned scripts keep working because they read the secrets as
|
|
120
|
+
* SUBPROCESSES: `bash scripts/mint-token.sh` names no secret on the session's
|
|
121
|
+
* command line, and only that line is checked.
|
|
122
|
+
*
|
|
123
|
+
* How a word is judged — after quotes, backslashes and `$'…'` escapes are
|
|
124
|
+
* removed, `~`/`$HOME`/`$XDG_CONFIG_HOME`/`$QCR_INSTALL` expanded and `{a,b}`
|
|
125
|
+
* braces expanded:
|
|
126
|
+
* · a path COMPONENT that is a secret file's name (`APP_SECRET_NAME_RE`);
|
|
127
|
+
* · a spelling of a secrets dir on its own (`/opt/quickreview/secrets`,
|
|
128
|
+
* `…/qcr/<install>/secrets`, the old `~/.config/quickreview-bot`);
|
|
129
|
+
* · the word resolved against the cwd (a `cd` earlier in the same command
|
|
130
|
+
* moves it) landing on, or inside, one of the resolved secrets dirs —
|
|
131
|
+
* so `../secrets/app_id` from the sandbox root is caught;
|
|
132
|
+
* · a GLOB that could expand to a secret path (`../secrets/*`,
|
|
133
|
+
* `/opt/*` + `/s*` + `/*`), or one of whose components could match a
|
|
134
|
+
* secret file's name with at least half of that name spelled literally
|
|
135
|
+
* (`app.p*m`, `*.pem`, `openai*key` — but not `*`, `*key` or `*token`,
|
|
136
|
+
* which would refuse ordinary reads).
|
|
137
|
+
* A grep/rg PATTERN and a sed SCRIPT are exempt (the first positional, or the
|
|
138
|
+
* value of `-e`): they read nothing, and a reviewer of code that handles
|
|
139
|
+
* secrets greps for `openai_api_key` as a matter of course.
|
|
140
|
+
*/
|
|
141
|
+
export interface SecretPathContext {
|
|
142
|
+
/** The directory a bare relative word resolves against (the session cwd). */
|
|
143
|
+
cwd: string;
|
|
144
|
+
/** For `~`, `$HOME`, `$XDG_CONFIG_HOME` and `$QCR_INSTALL` expansion. */
|
|
145
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
146
|
+
/** Every secrets dir this install could be using, absolute, no trailing `/`. */
|
|
147
|
+
dirs: readonly string[];
|
|
148
|
+
/** The daemon's IPC run dirs (`<state>/run`: the socket, the capability launch
|
|
149
|
+
* files), absolute, no trailing `/`. Nothing under one is readable. */
|
|
150
|
+
runDirs?: readonly string[];
|
|
151
|
+
}
|
|
152
|
+
/** The in-container secrets mount (deploy/ansible entrypoint `SECRETS`). */
|
|
153
|
+
export declare const CONTAINER_SECRETS_DIR = "/opt/quickreview/secrets";
|
|
154
|
+
/** The files the secrets dir holds, by their shipped names
|
|
155
|
+
* (deploy/collect-secrets.sh, the src/config.ts defaults). */
|
|
156
|
+
export declare const APP_SECRET_FILES: readonly string[];
|
|
157
|
+
/**
|
|
158
|
+
* This process's secrets dirs — self-contained on purpose (no `src/` import):
|
|
159
|
+
* bash-guard is registered GLOBALLY on the VM and in the bench sandbox, and
|
|
160
|
+
* must load wherever pi finds it. Mirrors `locateSecrets` in src/install.ts:
|
|
161
|
+
* the container mount, `$QCR_SECRETS_MOUNT`, `$QC_SECRETS_DIR`,
|
|
162
|
+
* `<config home>/secrets` (including absolute `$QCR_CONFIG_HOME`), the legacy `~/.config/quickreview-bot`, and a
|
|
163
|
+
* `[github] secrets_dir` read best-effort from `$QCR_CONFIG`.
|
|
164
|
+
*/
|
|
165
|
+
export declare function defaultSecretPathContext(env: Readonly<Record<string, string | undefined>>, cwd: string): SecretPathContext;
|
|
166
|
+
/** One expanded, unquoted word judged as a path. */
|
|
167
|
+
export declare function judgeSecretPath(w: string, ctx: SecretPathContext): BashCheck;
|
|
168
|
+
/**
|
|
169
|
+
* The file TOOLS' secret veto. pi's built-in `read` takes a `path` and
|
|
170
|
+
* resolves `~` and a leading `@` itself (VERIFIED against pi 1.0.0's
|
|
171
|
+
* dist/core/tools/read.js schema and path-utils.js `resolveToCwd`), so the
|
|
172
|
+
* judgement the bash belt applies to a word applies to that path — plus the
|
|
173
|
+
* OpenViking root-credential spellings.
|
|
174
|
+
*/
|
|
175
|
+
export declare function checkReadPath(path: string, c: SecretPathContext): BashCheck;
|
|
176
|
+
/** One expanded word judged as a path. */
|
|
177
|
+
export declare function judgeProcPath(w: string, cwd: string): BashCheck;
|
|
178
|
+
/** Refuse a command that names `/proc/<pid>/{environ,mem,cmdline,fd,fdinfo}`. */
|
|
179
|
+
export declare function checkProcSecrets(cmd: string, cwd: string): BashCheck;
|
|
180
|
+
export declare function isGitConfigSurface(path: string): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* This system's OWN policy-carrying surface — the analogue of
|
|
183
|
+
* `isGitConfigSurface`, one level out. `isGitConfigSurface` protects the files
|
|
184
|
+
* that turn an ordinary GIT command into shell execution; this protects the
|
|
185
|
+
* files that decide what every layer of THIS boundary does. A review session
|
|
186
|
+
* READS code (scoping rule 2); it never writes any of these, so a write to one
|
|
187
|
+
* is always a reconfiguration of its own controls:
|
|
188
|
+
*
|
|
189
|
+
* · `config.toml` — the guards' and the gate's configuration. The
|
|
190
|
+
* posting scripts read `dry_run` and every `[guards]` knob out of it per
|
|
191
|
+
* invocation, and `guard_enabled` treats a knob as ON unless it is literally
|
|
192
|
+
* `false`, so ONE write turns guards 1-5 off and flips a dry-run install to
|
|
193
|
+
* live on the next sanctioned post — AGENTS.md invariant 6, by a redirection.
|
|
194
|
+
* · `scripts/**` — the sanctioned posting route (the shims that
|
|
195
|
+
* hand over to the daemon). Overwriting one posts around it.
|
|
196
|
+
* · `dist/**` — the COMPILED artifacts the container actually
|
|
197
|
+
* runs, `packages/pi-plugin/dist/extensions/bash-guard.js` among them: overwrite the compiled
|
|
198
|
+
* guard and the boundary is off for every later round in that container.
|
|
199
|
+
* · `extensions/**` — the guard's own source and the other pi
|
|
200
|
+
* extensions, which `deploy.sh sync` ships and the build compiles.
|
|
201
|
+
* · `prompts/**`, `agents/**`, `seeds/**` — the frozen seeds (rule 6); the
|
|
202
|
+
* `agents/` rule also covers the BUILT `state/agents/**` pass bodies pi
|
|
203
|
+
* loads each round (a `state/agents/…` path has `agents/` after a slash).
|
|
204
|
+
* · `AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, `CLAUDE.MD`
|
|
205
|
+
* — pi's project-context files. pi loads the FIRST of them it finds in the
|
|
206
|
+
* cwd into EVERY session and pass it starts there (`loadContextFileFromDir`,
|
|
207
|
+
* pi 0.87.1, unchanged at 0.99.1 and 1.0.0 — VERIFY-ON-PIN: the candidate list is pi's), and every session
|
|
208
|
+
* and pass runs in the sandbox root. One write plants instructions in every
|
|
209
|
+
* later session until the next deploy — the overseer's included.
|
|
210
|
+
* · `.pi/**` — pi's PROJECT resource dir: `settings.json`,
|
|
211
|
+
* `extensions/`, `mcp.json` (pi 0.99+). Every project is trusted
|
|
212
|
+
* (`defaultProjectTrust = "always"`, the no-stall decision), so a file
|
|
213
|
+
* planted here loads into every later session and pass started in that
|
|
214
|
+
* root: an extension runs as code, a `mcp.json` launches server processes,
|
|
215
|
+
* and a `+builtin:mcp` in project settings re-enables what the global
|
|
216
|
+
* settings switch off (packages/pi-plugin/src/pibuiltins.ts) — project entries override the
|
|
217
|
+
* user's. As a SHAPE this also covers `<pi home>/.pi/agent/…`, the
|
|
218
|
+
* session's own global pi settings and login; a session writes neither.
|
|
219
|
+
*
|
|
220
|
+
* The list is OURS, closed and documented (docs/exec-boundary.md), not a list
|
|
221
|
+
* of attacks. `POLICY_SURFACE_FILES` / `POLICY_SURFACE_DIRS` — top-level names
|
|
222
|
+
* RELATIVE TO THE SANDBOX ROOT — and `POLICY_SURFACE_PATHS` (whole paths under
|
|
223
|
+
* it) are the ONE definition three consumers read:
|
|
224
|
+
* the write/edit tool veto and the shell-redirection scan (both through
|
|
225
|
+
* `isPolicySurface`, as a path SHAPE: the name after any prefix, because the
|
|
226
|
+
* guard does not know the session's cwd) and layer 4's round-boundary
|
|
227
|
+
* integrity check (`policySurfaceWatchPaths` in src/execboundary.ts, as
|
|
228
|
+
* concrete paths under the root — the one layer that also sees the write no
|
|
229
|
+
* command string can show, `T=config.toml; cat p > $T`). Being a SHAPE, the
|
|
230
|
+
* write veto also refuses `scripts/…`, `dist/…` etc. inside the REVIEWED
|
|
231
|
+
* repo's worktree; a reviewer never writes there either (scoping rule 2).
|
|
232
|
+
* `state/agents/**` — the BUILT pass bodies — is refused at the write boundary
|
|
233
|
+
* through the `agents/` shape but deliberately NOT watched by layer 4: the
|
|
234
|
+
* daemon itself rebuilds it mid-round on feedback ingest and the day change.
|
|
235
|
+
*/
|
|
236
|
+
export declare const POLICY_SURFACE_FILES: readonly ["config.toml", "AGENTS.override.md", "AGENTS.md", "AGENTS.MD", "CLAUDE.md", "CLAUDE.MD"];
|
|
237
|
+
export declare const POLICY_SURFACE_DIRS: readonly ["scripts", "dist", "extensions", "prompts", "agents", "seeds", ".pi"];
|
|
238
|
+
/** Policy files named by their PATH under the sandbox root, not a bare name:
|
|
239
|
+
* the review core's export map decides which compiled guard and gate an
|
|
240
|
+
* `@quickchatai/pi-quickreview/...` import loads (every shim, every worker),
|
|
241
|
+
* while a package.json anywhere else is no policy at all. */
|
|
242
|
+
export declare const POLICY_SURFACE_PATHS: readonly ["packages/pi-plugin/package.json"];
|
|
243
|
+
/** Is this path part of this system's own policy surface? Exported so both
|
|
244
|
+
* boundaries ask ONE question — see `POLICY_SURFACE_RE`. */
|
|
245
|
+
export declare function isPolicySurface(path: string): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* The MEMORY-SCOPE files — what decides how far a PR session's OWN memory
|
|
248
|
+
* recall may reach. The daemon publishes both into the session's pi home,
|
|
249
|
+
* beside its `ovcli.conf` (src/memory/ovsession.ts), and the vendored
|
|
250
|
+
* OpenViking extension reads them on every prompt:
|
|
251
|
+
*
|
|
252
|
+
* · `recall-hints/<session>.json` — the RECALL HINT (`ovRecallHintPathIn`):
|
|
253
|
+
* the round's query and the memory AREAS the session's recall and its
|
|
254
|
+
* memory tools may reach (`experiences/` alone — vendored patches
|
|
255
|
+
* 0008/0009/0011). One write of `{"areas":["finding-cases","events"]}`
|
|
256
|
+
* would widen the session's own scope to the finding cases and the
|
|
257
|
+
* feedback events no round may read, until the daemon writes the hint
|
|
258
|
+
* again at the next round.
|
|
259
|
+
* · `retired-uris.json` — the RETIRED list (`ovRetiredPathIn`) the recall
|
|
260
|
+
* excludes. Emptied, it brings retired entries back into every prompt's
|
|
261
|
+
* recall.
|
|
262
|
+
*
|
|
263
|
+
* A review session READS memory and never writes either file; the daemon does,
|
|
264
|
+
* whole and atomically, every round. Matched as a SHAPE like the policy
|
|
265
|
+
* surface — the distinctive name under ANY prefix, because the guard does not
|
|
266
|
+
* know the pi home (and a `cd` into `.openviking/` drops that part of the
|
|
267
|
+
* spelling) — and NOT watched by layer 4: the daemon rewrites the hint at
|
|
268
|
+
* every round's dispatch, so a round-boundary hash would read its own work as
|
|
269
|
+
* a change (the `state/agents/**` reasoning). The write veto is the
|
|
270
|
+
* protection these files have.
|
|
271
|
+
*/
|
|
272
|
+
export declare const MEMORY_SCOPE_SURFACE: readonly ["recall-hints/", "retired-uris.json"];
|
|
273
|
+
/** Is this path one of the memory-scope files a session's recall reads?
|
|
274
|
+
* Exported so both write boundaries ask ONE question. */
|
|
275
|
+
export declare function isMemoryScopeSurface(path: string): boolean;
|
|
276
|
+
/**
|
|
277
|
+
* The WAKE-DELIVERY files — the daemon's inject dirs
|
|
278
|
+
* (`<root>/inject/<session>/`, `PiSessionManager.injectDir`) and the inject
|
|
279
|
+
* bridge's record of what pi accepted. The bridge takes pending wakes in name
|
|
280
|
+
* order and moves each one pi accepts into `.done/`; the daemon reads that
|
|
281
|
+
* move as "this turn is now running" — above all for the overseer, whose
|
|
282
|
+
* Slack command rights are the served turn's (`src/slack/origin.ts`). One
|
|
283
|
+
* planted `.done/<queued wake>.md`, or a queued wake emptied in place (the
|
|
284
|
+
* bridge moves an empty file to `.done/` without serving it), would hand a
|
|
285
|
+
* running turn the rights of one still queued; a file dropped into another
|
|
286
|
+
* session's inject dir is a prompt in that session.
|
|
287
|
+
*
|
|
288
|
+
* A session never writes any of them; the daemon writes the wakes and the
|
|
289
|
+
* bridge moves them. Matched as a SHAPE: the `inject` dir and anything in it
|
|
290
|
+
* under any prefix, a `.done` dir and anything in it (a `cd` into the inject
|
|
291
|
+
* dir drops the `inject/` part), and the wake file's own name
|
|
292
|
+
* (`<ISO stamp>-<seq>[--cmd-<id>].md`, its atomic-write temp included — a `cd`
|
|
293
|
+
* into the session's dir drops every directory). Not watched by layer 4: the
|
|
294
|
+
* daemon and the bridge rewrite these dirs all the time, so a round-boundary
|
|
295
|
+
* hash would report their own work. The write veto is the protection, and a
|
|
296
|
+
* session has no program that moves or removes a file.
|
|
297
|
+
*/
|
|
298
|
+
export declare const DELIVERY_SURFACE: readonly ["inject/", ".done/", "<wake file>.md"];
|
|
299
|
+
/** Is this path one of the wake-delivery files? Exported so both write
|
|
300
|
+
* boundaries ask ONE question. */
|
|
301
|
+
export declare function isDeliverySurface(path: string): boolean;
|
|
302
|
+
/** The full set a session may not write, from ONE definition: git's own config
|
|
303
|
+
* and hook surface, this system's policy surface, the memory-scope files its
|
|
304
|
+
* own recall reads and the wake-delivery files. Both the write/edit tool veto
|
|
305
|
+
* (`checkWritePath`) and the shell-redirection / sed scan
|
|
306
|
+
* (`checkProtectedWrites`) refuse exactly this, so they cannot drift. */
|
|
307
|
+
export declare function isProtectedWriteTarget(path: string): boolean;
|
|
308
|
+
/** The protected path a redirection-target PATTERN can expand onto, or null
|
|
309
|
+
* (also null for a target with no pattern syntax at all). */
|
|
310
|
+
export declare function protectedPatternHit(target: string): string | null;
|
|
311
|
+
/** Whether `text` opens ANSI-C (`$'…'`) or locale (`$"…"`) quoting — forms
|
|
312
|
+
* `dequote` does not decode. Only a `$` OUTSIDE quotes opens one: inside
|
|
313
|
+
* single or double quotes `$'`/`$"` is literal (`--jq 'test("x$")'`).
|
|
314
|
+
* Exported because `src/usage.ts` audits the same forms. */
|
|
315
|
+
export declare function opensUnmodelledQuoting(text: string): boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Every spelling of an OUTPUT redirection, rewritten onto the canonical `>` /
|
|
318
|
+
* `>>` before anything else reads the command, so the write-target scan and
|
|
319
|
+
* the segment splitter both see one form. Exported because `src/usage.ts`
|
|
320
|
+
* borrows it the way it borrows `splitShellSegments` — the TOKENISER, not the
|
|
321
|
+
* policy. Bash has more of these than `>`:
|
|
322
|
+
* · fd-dups (`2>&1`, `>&2`, `1>&-`) name no file and are dropped;
|
|
323
|
+
* · `>&file`, `&>file`, `&>>file` write stdout+stderr to a FILE;
|
|
324
|
+
* · `{v}>file` opens the file on a descriptor bash picks and stores in `v`;
|
|
325
|
+
* · `<>file` opens read-write — `printf x 1<>config.toml` OVERWRITES it;
|
|
326
|
+
* · `>|file` overrides noclobber.
|
|
327
|
+
* All five VERIFIED writing the target; a scan that knew only `>` and `>>`
|
|
328
|
+
* would miss each.
|
|
329
|
+
*/
|
|
330
|
+
export declare function normalizeRedirections(cmd: string): string;
|
|
331
|
+
/**
|
|
332
|
+
* Shell redirections and `sed -i` whose target is a PROTECTED write surface —
|
|
333
|
+
* git's config/hook surface, this system's own policy surface (config.toml,
|
|
334
|
+
* scripts/, dist/, extensions/, prompts/agents/seeds, .pi/, the pi context
|
|
335
|
+
* files) or the memory-scope files a session's recall reads.
|
|
336
|
+
*
|
|
337
|
+
* The segment splitter deliberately skips redirection remnants when hunting for
|
|
338
|
+
* the program token, so `cat evil > config.toml` and `printf '…' > .git/config`
|
|
339
|
+
* both vet as an allowlisted program (`cat`/`printf`) and pass the per-segment
|
|
340
|
+
* check. That is right for finding the PROGRAM and wrong for finding the TARGET,
|
|
341
|
+
* so the target is asked about separately, over the raw command — the same shape
|
|
342
|
+
* `checkSecretPaths` already uses for the root-credential paths, and for the
|
|
343
|
+
* same reason: the path, not the program, is what distinguishes it. This is one
|
|
344
|
+
* of the TWO boundaries `isProtectedWriteTarget` binds; the other is the
|
|
345
|
+
* write/edit tool veto in `checkWritePath`, and both read the same predicate so
|
|
346
|
+
* they cannot drift apart.
|
|
347
|
+
*
|
|
348
|
+
* `tee`, `cp`, `mv` and `dd` are the other ways to write a named file, and they
|
|
349
|
+
* need no case here: none is on `ALLOWED`, so `checkProgram` refuses them
|
|
350
|
+
* outright whatever their target. `sort -o`, `find -fprintf` and `awk` are
|
|
351
|
+
* refused whole (reader-mode rules / off the allowlist), so they cannot reach a
|
|
352
|
+
* target either. `sed -i` is the one allowlisted writer that names its target as
|
|
353
|
+
* a plain argument rather than after a `>`; the reader-mode rules already refuse
|
|
354
|
+
* `sed -i` outright, so this scan is defense in depth for it. The
|
|
355
|
+
* redirection itself has more spellings than `>`/`>>` — see
|
|
356
|
+
* `normalizeRedirections`, which folds all of them onto those two first.
|
|
357
|
+
*/
|
|
358
|
+
export declare function checkProtectedWrites(cmd: string): BashCheck;
|
|
359
|
+
/**
|
|
360
|
+
* The target of every UNQUOTED output redirection in a command (after
|
|
361
|
+
* `normalizeRedirections` has folded the spellings onto `>`/`>>`), each with
|
|
362
|
+
* its quoting removed as bash removes it — `$'…'` and `$"…"` included. A
|
|
363
|
+
* `>` inside single or double quotes, or escaped, is text, not an operator;
|
|
364
|
+
* one glued to the word before it (`x>file`) is an operator. Process
|
|
365
|
+
* substitution (`>(…)`) names no file and yields nothing. Exported because
|
|
366
|
+
* `src/usage.ts` borrows it the way it borrows `splitShellSegments` — the
|
|
367
|
+
* TOKENISER, not the policy.
|
|
368
|
+
*/
|
|
369
|
+
export declare function redirectTargets(cmd: string): string[];
|
|
370
|
+
/** Pure policy check over a full bash command string: split into segments
|
|
371
|
+
* (quote-aware) and vet each segment's first program token. */
|
|
372
|
+
export declare function checkBashCommand(cmd: string, depth: number, cwd: string | null, policy: GuardPolicy): BashCheck;
|
|
373
|
+
/**
|
|
374
|
+
* sed, read as sed reads it. The regex rules above match spellings; sed's
|
|
375
|
+
* script language is small enough to PARSE, so the decision is made on the
|
|
376
|
+
* parse: every option is classified, every script is split into commands, and
|
|
377
|
+
* the guard allows only an invocation whose every part it understood and none
|
|
378
|
+
* of which writes, reads another file or runs a command. Fails closed: an
|
|
379
|
+
* option it does not know, an abbreviation it cannot resolve to one safe
|
|
380
|
+
* option, a script it cannot finish parsing, a script it cannot see (a
|
|
381
|
+
* `$`-expansion or a backtick in an argument; `xargs`, which can append
|
|
382
|
+
* options and scripts from stdin) are all refused.
|
|
383
|
+
*
|
|
384
|
+
* What it refuses inside a script: the `e`, `w`, `W`, `r` and `R` commands
|
|
385
|
+
* (run a command, write a file, read a file into the stream), at any address
|
|
386
|
+
* (`/re/`, `\cREc`, a number, `$`, `first~step`, `addr,+N`, negated with `!`);
|
|
387
|
+
* and an `s` command whose flags carry `e` (run the pattern space as a
|
|
388
|
+
* command) or `w` (write) — with ANY delimiter, flags in any order.
|
|
389
|
+
*/
|
|
390
|
+
export declare function checkSedInvocation(words: readonly string[]): string | null;
|
|
391
|
+
/** The first command in a sed script that writes, reads a file or runs a
|
|
392
|
+
* command — or that the parser cannot classify — or null when every command
|
|
393
|
+
* is a plain stream edit. */
|
|
394
|
+
export declare function sedScriptDanger(script: string): string | null;
|
|
395
|
+
/** Shell words of a sed invocation's argument text, as bash will hand them to
|
|
396
|
+
* sed — or null when a word's value is not knowable from the text (a `$`
|
|
397
|
+
* expansion, ANSI-C or locale quoting, a backtick, an unclosed quote). */
|
|
398
|
+
export declare function sedWords(text: string): string[] | null;
|
|
399
|
+
/**
|
|
400
|
+
* Does this invocation of an allowlisted reader use one of its write/exec
|
|
401
|
+
* modes? Exported so the reason is testable on its own.
|
|
402
|
+
*/
|
|
403
|
+
export declare function checkReaderModes(prog: string, args: readonly string[], rawArgs?: readonly string[], rawText?: string): BashCheck;
|
|
404
|
+
/**
|
|
405
|
+
* The write/edit tools' policy check. The write half of the two boundaries
|
|
406
|
+
* `isProtectedWriteTarget` binds — the other is the shell redirection /
|
|
407
|
+
* `sed -i` scan in `checkProtectedWrites`, and both read the same predicate so
|
|
408
|
+
* a session cannot write through one what it is refused through the other.
|
|
409
|
+
* Refuses git's config/hook surface, this system's own policy surface
|
|
410
|
+
* (config.toml, scripts/, dist/, extensions/, prompts/agents/seeds, .pi/, the
|
|
411
|
+
* pi context files) and the memory-scope files its recall reads (the recall
|
|
412
|
+
* hint, the retired list); everything else a session writes — the verdict file,
|
|
413
|
+
* the ledger, /tmp bodies — is allowed. This is not a write allowlist.
|
|
414
|
+
*/
|
|
415
|
+
export declare function checkWritePath(path: string): BashCheck;
|
|
416
|
+
/**
|
|
417
|
+
* What one bash-guard needs, resolved: no env is read past this. Only these
|
|
418
|
+
* inputs are configurable. The policy itself (the program allowlist, the
|
|
419
|
+
* secret-path and /proc rules, the protected write surfaces) is code in this
|
|
420
|
+
* file, and the secrets dirs below are a FLOOR the guard adds the container's
|
|
421
|
+
* own mount to; no profile layer (packages/pi-plugin/src/profileoverrides.ts) reaches either, and
|
|
422
|
+
* the engine host builds this from the install, never from a profile.
|
|
423
|
+
*/
|
|
424
|
+
export interface BashGuardConfig {
|
|
425
|
+
/** The daemon-selected checkout that owns the sanctioned script bytes. */
|
|
426
|
+
sandboxRoot: string;
|
|
427
|
+
/** The cwd a tool call is judged from when pi's context names none. Omitted:
|
|
428
|
+
* the sandbox root. */
|
|
429
|
+
cwd?: string;
|
|
430
|
+
/** A regression replay session: no sandbox script is sanctioned at all. */
|
|
431
|
+
replay: boolean;
|
|
432
|
+
/** A takeover: the scripts that post are not sanctioned. Omitted: false. */
|
|
433
|
+
noPost?: boolean;
|
|
434
|
+
/** Every secrets dir this install could be using, absolute. The container
|
|
435
|
+
* mount (`CONTAINER_SECRETS_DIR`) is always added. */
|
|
436
|
+
secretDirs: readonly string[];
|
|
437
|
+
/** HOME, XDG_CONFIG_HOME and QCR_INSTALL, the variables a secrets path is
|
|
438
|
+
* spelled with in a command, plus QCR_IPC_SOCKET, which locates the IPC
|
|
439
|
+
* run dir. Unset falls back to the
|
|
440
|
+
* defaults `defaultSecretPathContext` uses. */
|
|
441
|
+
pathEnv?: Readonly<Record<string, string | undefined>>;
|
|
442
|
+
}
|
|
443
|
+
/** The three env-decoded guard inputs: the sandbox root (QCR_SANDBOX_ROOT, else
|
|
444
|
+
* the cwd), QCR_REPLAY and QCR_TAKEOVER. The one place the env is read for them. */
|
|
445
|
+
export declare function guardFlagsFromEnv(env: Readonly<Record<string, string | undefined>>, cwd: string): {
|
|
446
|
+
sandboxRoot: string;
|
|
447
|
+
replay: boolean;
|
|
448
|
+
noPost: boolean;
|
|
449
|
+
};
|
|
450
|
+
/** The config the env describes: QCR_SANDBOX_ROOT (else the cwd), QCR_REPLAY,
|
|
451
|
+
* QCR_TAKEOVER, and the secrets dirs `defaultSecretPathContext` resolves from the same env. */
|
|
452
|
+
export declare function bashGuardConfigFromEnv(env: Readonly<Record<string, string | undefined>>, cwd: string): BashGuardConfig;
|
|
453
|
+
/**
|
|
454
|
+
* The factory a session loads: the guard over this config. A pi loaded by
|
|
455
|
+
* path gets it through the env shim, extensions/cli/bash-guard.ts, and an SDK
|
|
456
|
+
* session as this extension factory. VERIFIED (pi control-surface findings §5):
|
|
457
|
+
* a tool_call handler can return { block: true, reason } to veto the call, and
|
|
458
|
+
* event.input is mutable. pi 1.3.0 emits `{ type: "tool_call", toolName,
|
|
459
|
+
* toolCallId, input }` and its read/grep/find/ls tools take `path` (grep also
|
|
460
|
+
* `glob`).
|
|
461
|
+
* `toolName` and `input` on the event payload are seen in production (above).
|
|
462
|
+
* // VERIFY-ON-PIN: `path`/`file_path` on a file tool's input (following
|
|
463
|
+
* extensions/companion-guard.ts, which already vetoes writes this way).
|
|
464
|
+
*/
|
|
465
|
+
export declare function createBashGuard(config: BashGuardConfig): ExtensionFactory;
|
|
466
|
+
export {};
|
|
467
|
+
//# sourceMappingURL=bash-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash-guard.d.ts","sourceRoot":"","sources":["../../extensions/bash-guard.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EA6B7C,CAAC;AA6EF,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB;sDACkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ;;;;+DAI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