@quickchatai/pi-quickreview 0.0.0-stage → 1.2.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 +1099 -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 +113 -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 +377 -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 +235 -0
- package/dist/src/engine/pisdk.d.ts.map +1 -0
- package/dist/src/engine/pisdk.js +577 -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 +70 -0
- package/dist/src/githubAuth.d.ts.map +1 -0
- package/dist/src/githubAuth.js +183 -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 +106 -0
- package/dist/src/guards.d.ts.map +1 -0
- package/dist/src/guards.js +365 -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/identity.d.ts +34 -0
- package/dist/src/identity.d.ts.map +1 -0
- package/dist/src/identity.js +67 -0
- package/dist/src/identity.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/modelroute.d.ts +38 -0
- package/dist/src/modelroute.d.ts.map +1 -0
- package/dist/src/modelroute.js +105 -0
- package/dist/src/modelroute.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 +42 -0
- package/dist/src/plugin/login.d.ts.map +1 -0
- package/dist/src/plugin/login.js +82 -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 +302 -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 +753 -0
- package/dist/src/reviewconfig.d.ts.map +1 -0
- package/dist/src/reviewconfig.js +805 -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,59 @@
|
|
|
1
|
+
/** Whether `name` is a plain path segment — the one admission rule behind
|
|
2
|
+
* `assertPathSegment` and every listing that skips what it would refuse. */
|
|
3
|
+
export declare function isPathSegment(name: string): boolean;
|
|
4
|
+
/** Refuse a name that could escape its parent directory. `kind` names what the
|
|
5
|
+
* segment is for, so the error says which knob is wrong. */
|
|
6
|
+
export declare function assertPathSegment(kind: string, name: string): string;
|
|
7
|
+
/** The directory, in every home, that holds one subdirectory per profile. */
|
|
8
|
+
export declare const PROFILES_DIR = "profiles";
|
|
9
|
+
/**
|
|
10
|
+
* The checkout's generic profiles — the ones that belong to the app, not to
|
|
11
|
+
* any install: the examples, and `default`, the shipped behaviour every
|
|
12
|
+
* generated profile extends. They are the only profiles the lookup reads
|
|
13
|
+
* from the checkout. Any other directory under the checkout's `profiles/` is
|
|
14
|
+
* an install's own profile stranded in its old place: never read, and
|
|
15
|
+
* `qcr install migrate` moves it into the config home. A new example is
|
|
16
|
+
* registered here (a test holds the checkout to it, and the shell mirror's
|
|
17
|
+
* `QCR_EXAMPLE_PROFILES` to this list).
|
|
18
|
+
*/
|
|
19
|
+
export declare const EXAMPLE_PROFILES: readonly string[];
|
|
20
|
+
/** Which search place a profile was found in. */
|
|
21
|
+
export type ProfileSource = "home" | "override" | "checkout";
|
|
22
|
+
/** One place profiles are looked up in. */
|
|
23
|
+
export interface ProfilePlace {
|
|
24
|
+
dir: string;
|
|
25
|
+
source: ProfileSource;
|
|
26
|
+
}
|
|
27
|
+
/** Every search place, in order, deduplicated (the first place a directory
|
|
28
|
+
* is reached by names its source): the `homes`, then the checkout's. */
|
|
29
|
+
export declare function profileSearchPlaces(root: string, homes: readonly ProfilePlace[]): ProfilePlace[];
|
|
30
|
+
export interface LocatedProfile {
|
|
31
|
+
name: string;
|
|
32
|
+
dir: string;
|
|
33
|
+
source: ProfileSource;
|
|
34
|
+
}
|
|
35
|
+
export declare function isDirectory(path: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Find the named profile: the first search place that holds it as a
|
|
38
|
+
* directory — the checkout only for a generic example — or `null` when none
|
|
39
|
+
* does (each loader words its own not-found). The name is a plain path
|
|
40
|
+
* segment or a throw — `../x`, `a/b` and kin never reach a join.
|
|
41
|
+
*/
|
|
42
|
+
export declare function findProfile(opts: {
|
|
43
|
+
root: string;
|
|
44
|
+
profile: string;
|
|
45
|
+
homes: readonly ProfilePlace[];
|
|
46
|
+
isDir?: (path: string) => boolean;
|
|
47
|
+
}): LocatedProfile | null;
|
|
48
|
+
/**
|
|
49
|
+
* The checkout's `profiles/<name>` when it is an install's own profile left
|
|
50
|
+
* there (not a generic example) — stranded, never read. Only for a
|
|
51
|
+
* not-found to name `qcr install migrate`; null when there is none, or when
|
|
52
|
+
* one of the `homes` is the checkout's `profiles/` (then it was read).
|
|
53
|
+
*/
|
|
54
|
+
export declare function strandedProfile(opts: {
|
|
55
|
+
root: string;
|
|
56
|
+
profile: string;
|
|
57
|
+
homes: readonly ProfilePlace[];
|
|
58
|
+
}): string | null;
|
|
59
|
+
//# sourceMappingURL=profilelookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profilelookup.d.ts","sourceRoot":"","sources":["../../src/profilelookup.ts"],"names":[],"mappings":"AAmBA;4EAC4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;4DAC4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
|
2
|
+
// inputs: the profile directories outside the checkout (the install's homes)
|
|
3
|
+
// are an explicit argument, resolved by the caller (src/homes.ts
|
|
4
|
+
// `homeProfilePlaces` from the environment), so the review core never reads
|
|
5
|
+
// the environment or a home itself.
|
|
6
|
+
//
|
|
7
|
+
// The search order (the first place that holds the profile wins):
|
|
8
|
+
// 1. the install's config home — `<home>/profiles/`
|
|
9
|
+
// 2. `profiles/` beside `$QCR_CONFIG`, when it is set (the compose route's
|
|
10
|
+
// mounted config home; the VM's shipped one; the bench image's)
|
|
11
|
+
// 3. the checkout's `profiles/` — the generic examples only
|
|
12
|
+
// Places 1 and 2 are the caller's `homes`; place 3 is `<root>/profiles`.
|
|
13
|
+
import { statSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
/** A single path segment an install or a profile may be named by.
|
|
16
|
+
* No separators, no leading dot, so `..` and `a/../../b` are unspellable. */
|
|
17
|
+
const SEGMENT_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
18
|
+
/** Whether `name` is a plain path segment — the one admission rule behind
|
|
19
|
+
* `assertPathSegment` and every listing that skips what it would refuse. */
|
|
20
|
+
export function isPathSegment(name) {
|
|
21
|
+
return SEGMENT_RE.test(name) && !name.includes("..");
|
|
22
|
+
}
|
|
23
|
+
/** Refuse a name that could escape its parent directory. `kind` names what the
|
|
24
|
+
* segment is for, so the error says which knob is wrong. */
|
|
25
|
+
export function assertPathSegment(kind, name) {
|
|
26
|
+
if (!isPathSegment(name)) {
|
|
27
|
+
throw new Error(`${kind} ${JSON.stringify(name)} is not a plain name — letters, digits, '.', '_' and '-' only, no path separators or '..'`);
|
|
28
|
+
}
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
/** The directory, in every home, that holds one subdirectory per profile. */
|
|
32
|
+
export const PROFILES_DIR = "profiles";
|
|
33
|
+
/**
|
|
34
|
+
* The checkout's generic profiles — the ones that belong to the app, not to
|
|
35
|
+
* any install: the examples, and `default`, the shipped behaviour every
|
|
36
|
+
* generated profile extends. They are the only profiles the lookup reads
|
|
37
|
+
* from the checkout. Any other directory under the checkout's `profiles/` is
|
|
38
|
+
* an install's own profile stranded in its old place: never read, and
|
|
39
|
+
* `qcr install migrate` moves it into the config home. A new example is
|
|
40
|
+
* registered here (a test holds the checkout to it, and the shell mirror's
|
|
41
|
+
* `QCR_EXAMPLE_PROFILES` to this list).
|
|
42
|
+
*/
|
|
43
|
+
export const EXAMPLE_PROFILES = [
|
|
44
|
+
"default",
|
|
45
|
+
"example-django",
|
|
46
|
+
"minimal",
|
|
47
|
+
"snappy",
|
|
48
|
+
"fast",
|
|
49
|
+
];
|
|
50
|
+
/** Every search place, in order, deduplicated (the first place a directory
|
|
51
|
+
* is reached by names its source): the `homes`, then the checkout's. */
|
|
52
|
+
export function profileSearchPlaces(root, homes) {
|
|
53
|
+
const places = [...homes, { dir: join(root, PROFILES_DIR), source: "checkout" }];
|
|
54
|
+
return places.filter((p, i) => places.findIndex((q) => q.dir === p.dir) === i);
|
|
55
|
+
}
|
|
56
|
+
export function isDirectory(path) {
|
|
57
|
+
try {
|
|
58
|
+
return statSync(path).isDirectory();
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Find the named profile: the first search place that holds it as a
|
|
66
|
+
* directory — the checkout only for a generic example — or `null` when none
|
|
67
|
+
* does (each loader words its own not-found). The name is a plain path
|
|
68
|
+
* segment or a throw — `../x`, `a/b` and kin never reach a join.
|
|
69
|
+
*/
|
|
70
|
+
export function findProfile(opts) {
|
|
71
|
+
const name = assertPathSegment("profile", opts.profile);
|
|
72
|
+
const isDir = opts.isDir ?? isDirectory;
|
|
73
|
+
for (const place of profileSearchPlaces(opts.root, opts.homes)) {
|
|
74
|
+
if (place.source === "checkout" && !EXAMPLE_PROFILES.includes(name))
|
|
75
|
+
continue;
|
|
76
|
+
const dir = join(place.dir, name);
|
|
77
|
+
if (isDir(dir))
|
|
78
|
+
return { name, dir, source: place.source };
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The checkout's `profiles/<name>` when it is an install's own profile left
|
|
84
|
+
* there (not a generic example) — stranded, never read. Only for a
|
|
85
|
+
* not-found to name `qcr install migrate`; null when there is none, or when
|
|
86
|
+
* one of the `homes` is the checkout's `profiles/` (then it was read).
|
|
87
|
+
*/
|
|
88
|
+
export function strandedProfile(opts) {
|
|
89
|
+
const name = assertPathSegment("profile", opts.profile);
|
|
90
|
+
if (EXAMPLE_PROFILES.includes(name))
|
|
91
|
+
return null;
|
|
92
|
+
const checkout = join(opts.root, PROFILES_DIR);
|
|
93
|
+
if (!profileSearchPlaces(opts.root, opts.homes).some((p) => p.dir === checkout && p.source === "checkout"))
|
|
94
|
+
return null;
|
|
95
|
+
const dir = join(checkout, name);
|
|
96
|
+
return isDirectory(dir) ? dir : null;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=profilelookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profilelookup.js","sourceRoot":"","sources":["../../src/profilelookup.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,6EAA6E;AAC7E,iEAAiE;AACjE,4EAA4E;AAC5E,oCAAoC;AACpC,EAAE;AACF,kEAAkE;AAClE,sDAAsD;AACtD,6EAA6E;AAC7E,qEAAqE;AACrE,8DAA8D;AAC9D,yEAAyE;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;6EAC6E;AAC7E,MAAM,UAAU,GAAG,mCAAmC,CAAC;AAEvD;4EAC4E;AAC5E,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAA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
|
|
|
1
|
+
import { type ProfileLookup } from "./profiles.js";
|
|
2
|
+
/** The directory in the repo that holds the repo profile. */
|
|
3
|
+
export declare const REPO_PROFILE_DIR = ".qcr";
|
|
4
|
+
/** Where a replacement came from. */
|
|
5
|
+
export type OverrideOrigin = "user" | "repo";
|
|
6
|
+
/** One directory of override files, `agents/` and `prompts/` under it. */
|
|
7
|
+
export interface OverrideLayer {
|
|
8
|
+
origin: OverrideOrigin;
|
|
9
|
+
/** The profile's name (`.qcr` for the repo profile). */
|
|
10
|
+
name: string;
|
|
11
|
+
dir: string;
|
|
12
|
+
}
|
|
13
|
+
/** One shipped file a layer replaced with different bytes. */
|
|
14
|
+
export interface OverrideRecord {
|
|
15
|
+
/** The shipped file, relative to the app root: `agents/pass-security.md`. */
|
|
16
|
+
path: string;
|
|
17
|
+
origin: OverrideOrigin;
|
|
18
|
+
/** The profile whose file won. */
|
|
19
|
+
layer: string;
|
|
20
|
+
/** sha256 of the replacement. */
|
|
21
|
+
sha256: string;
|
|
22
|
+
/** sha256 of the shipped file. */
|
|
23
|
+
shipped_sha256: string;
|
|
24
|
+
/** Whether the shipped file is one of the frozen seeds (AGENTS.md invariant 3). */
|
|
25
|
+
seed: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface Customisation {
|
|
28
|
+
customised: boolean;
|
|
29
|
+
overrides: OverrideRecord[];
|
|
30
|
+
}
|
|
31
|
+
export interface OverrideSet {
|
|
32
|
+
/** Lowest precedence first: the repo profile, then the user's chain. */
|
|
33
|
+
layers: OverrideLayer[];
|
|
34
|
+
/** What a layer carried that was not applied, one line each. */
|
|
35
|
+
ignored: string[];
|
|
36
|
+
/** The loaders' view of the same layers (packages/pi-plugin/src/profiles.ts). */
|
|
37
|
+
lookup: ProfileLookup;
|
|
38
|
+
}
|
|
39
|
+
/** The seed manifest's `path → sha256`, or null when the install ships none
|
|
40
|
+
* (then a shipped file is compared by its own hash). Never throws. */
|
|
41
|
+
export declare function loadSeedManifest(root: string): Record<string, string> | null;
|
|
42
|
+
/**
|
|
43
|
+
* Extract the repo profile from `ref` (a commit, the review's BASE) into
|
|
44
|
+
* `destDir`, reading git objects only: the working tree and the PR head are
|
|
45
|
+
* never consulted. Only the files in `REPO_FILE_RE` come out, as regular
|
|
46
|
+
* blobs under the size caps; a symlink, a submodule, an oversized file and
|
|
47
|
+
* anything outside the list is dropped and named in `ignored`. `dir` is null
|
|
48
|
+
* when the base has no `.qcr/` (or nothing in it a repo may carry).
|
|
49
|
+
*/
|
|
50
|
+
export declare function extractRepoProfile(o: {
|
|
51
|
+
gitDir: string;
|
|
52
|
+
ref: string;
|
|
53
|
+
destDir: string;
|
|
54
|
+
}): {
|
|
55
|
+
dir: string | null;
|
|
56
|
+
ignored: string[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The override layers of one run: the repo profile (when `repo` names a git
|
|
60
|
+
* dir and a base commit) under the user's named profile and everything it
|
|
61
|
+
* extends. Files with no shipped namesake apply to nothing and are reported.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveOverrides(o: {
|
|
64
|
+
root: string;
|
|
65
|
+
/** `[review] profile`; "" is no named profile. */
|
|
66
|
+
profile: string;
|
|
67
|
+
lookup?: ProfileLookup;
|
|
68
|
+
repo?: {
|
|
69
|
+
gitDir: string;
|
|
70
|
+
baseRef: string;
|
|
71
|
+
destDir: string;
|
|
72
|
+
};
|
|
73
|
+
}): OverrideSet;
|
|
74
|
+
/** Whether any layer carries a file that replaces a shipped one. */
|
|
75
|
+
export declare function hasOverrideFiles(root: string, set: OverrideSet): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The `readFile` for `buildAgents` and the prompt renderers: a shipped
|
|
78
|
+
* `agents/` or `prompts/` file under `root` reads from the winning layer when
|
|
79
|
+
* one carries it, and everything else reads as usual. Undefined when no layer
|
|
80
|
+
* replaces anything, so callers that pass it through change nothing.
|
|
81
|
+
*/
|
|
82
|
+
export declare function overrideReader(root: string, set: OverrideSet): ((p: string) => string) | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Which shipped files this run's layers replaced with different bytes. The
|
|
85
|
+
* shipped hash is the seed manifest's for a seed, else the file's own. A
|
|
86
|
+
* run with no replacement returns at once, without reading the manifest.
|
|
87
|
+
*/
|
|
88
|
+
export declare function assessOverrides(root: string, set: OverrideSet): Customisation;
|
|
89
|
+
/** The line a report footer and the terminal carry for a customised run. */
|
|
90
|
+
export declare function customisedNote(c: Customisation): string;
|
|
91
|
+
//# sourceMappingURL=profileoverrides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileoverrides.d.ts","sourceRoot":"","sources":["../../src/profileoverrides.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEzF,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,SAAkB,CAAC;AAEhD,qCAAqC;AACrC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,MAAM,EAAE,aAAa,EAAE,CAAC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GvD"}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// Profile overrides of the shipped agents and prompts, and the "customised"
|
|
2
|
+
// mark they put on a review.
|
|
3
|
+
//
|
|
4
|
+
// Two profiles may replace a shipped file, and one set of rules says which:
|
|
5
|
+
//
|
|
6
|
+
// * the USER profile — the named profile (`[review] profile`) and the
|
|
7
|
+
// profiles it extends, found in the install's config home. On the user's
|
|
8
|
+
// own install it is the final word: it wins over the repo profile.
|
|
9
|
+
// * the REPO profile — `.qcr/` in the reviewed repo, read from the BASE
|
|
10
|
+
// commit with git, never from the checkout or the PR head: a PR cannot
|
|
11
|
+
// change the profile that reviews it. It is the lowest layer, and it can
|
|
12
|
+
// say less: only the files and keys listed below. Everything else in
|
|
13
|
+
// `.qcr/` is dropped and reported, never applied.
|
|
14
|
+
//
|
|
15
|
+
// What a layer may carry: `agents/<name>.md` and `prompts/<name>.md`, each
|
|
16
|
+
// replacing the shipped file of that name (a file with no shipped namesake
|
|
17
|
+
// replaces nothing and is reported); and the profile's own settings,
|
|
18
|
+
// `profile.toml`, `heuristics.toml` and `addenda/*.md`, which the profile
|
|
19
|
+
// loaders read (packages/pi-plugin/src/profiles.ts). A repo's `profile.toml` is cut down to
|
|
20
|
+
// `ecosystem`, `[lenses]`, `[scan]`, `[posting]` and `[addenda]`.
|
|
21
|
+
//
|
|
22
|
+
// What no layer can reach: the bash-guard policy (extensions/), the secret
|
|
23
|
+
// dirs, and the posting gate (`dry_run`, the MutationGate). None of them is a
|
|
24
|
+
// file this module reads or a key a profile loader knows, so a profile has no
|
|
25
|
+
// way to name them; the repo profile's extraction also refuses the keys that
|
|
26
|
+
// look like them, so the refusal is visible rather than a silent no-op.
|
|
27
|
+
//
|
|
28
|
+
// The mark: each replacement is hashed against the shipped file (the seed
|
|
29
|
+
// manifest's hash for a seed, the file's own hash otherwise). A replacement
|
|
30
|
+
// whose hash differs puts the run in `customised` and lists the file in
|
|
31
|
+
// `overrides[]`; a byte-identical copy changes nothing and marks nothing. With
|
|
32
|
+
// no replacement at all, nothing here runs a model, reads the manifest or
|
|
33
|
+
// hands a callback to anyone, so an uncustomised run is the run it always was.
|
|
34
|
+
// Seeds themselves are never written: layers are read-only inputs.
|
|
35
|
+
import { createHash } from "node:crypto";
|
|
36
|
+
import { execFileSync } from "node:child_process";
|
|
37
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, writeFileSync, } from "node:fs";
|
|
38
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
39
|
+
import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
40
|
+
import { findProfile } from "./profilelookup.js";
|
|
41
|
+
import { REPO_LAYER_NAME, resolveProfileChain } from "./profiles.js";
|
|
42
|
+
/** The directory in the repo that holds the repo profile. */
|
|
43
|
+
export const REPO_PROFILE_DIR = REPO_LAYER_NAME;
|
|
44
|
+
const SHIPPED_DIRS = ["agents", "prompts"];
|
|
45
|
+
const NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
46
|
+
/** Per-file and total caps on what is pulled out of a repo's `.qcr/`. */
|
|
47
|
+
const MAX_FILE_BYTES = 256 * 1024;
|
|
48
|
+
const MAX_TOTAL_BYTES = 2 * 1024 * 1024;
|
|
49
|
+
const MAX_IGNORED_LINES = 20;
|
|
50
|
+
const sha256 = (data) => createHash("sha256").update(data).digest("hex");
|
|
51
|
+
// ---- the seed manifest ---------------------------------------------------------
|
|
52
|
+
/** Where the runtime reads the seed manifest: baked beside the code in the
|
|
53
|
+
* image (`<root>/seed-manifest.json`), else the checkout's pinned copy. */
|
|
54
|
+
const MANIFEST_PLACES = ["seed-manifest.json", join("tests", "fixtures", "seed-manifest.json")];
|
|
55
|
+
/** The seed manifest's `path → sha256`, or null when the install ships none
|
|
56
|
+
* (then a shipped file is compared by its own hash). Never throws. */
|
|
57
|
+
export function loadSeedManifest(root) {
|
|
58
|
+
for (const place of MANIFEST_PLACES) {
|
|
59
|
+
try {
|
|
60
|
+
const doc = JSON.parse(readFileSync(join(root, place), "utf8"));
|
|
61
|
+
if (typeof doc.files !== "object" || doc.files === null)
|
|
62
|
+
continue;
|
|
63
|
+
const files = {};
|
|
64
|
+
for (const [k, v] of Object.entries(doc.files))
|
|
65
|
+
if (typeof v === "string")
|
|
66
|
+
files[k] = v;
|
|
67
|
+
return files;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// absent or unreadable: try the next place
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
// ---- reading a layer -------------------------------------------------------------
|
|
76
|
+
/** The override files a layer carries: `<dir>/agents/*.md` and
|
|
77
|
+
* `<dir>/prompts/*.md`, regular files only, keyed by shipped path. */
|
|
78
|
+
function layerFiles(layer, oversized) {
|
|
79
|
+
const out = new Map();
|
|
80
|
+
for (const sub of SHIPPED_DIRS) {
|
|
81
|
+
let names;
|
|
82
|
+
try {
|
|
83
|
+
names = readdirSync(join(layer.dir, sub))
|
|
84
|
+
.filter((f) => f.endsWith(".md") && NAME_RE.test(f))
|
|
85
|
+
.sort();
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
for (const f of names) {
|
|
91
|
+
const file = join(layer.dir, sub, f);
|
|
92
|
+
try {
|
|
93
|
+
const st = lstatSync(file);
|
|
94
|
+
if (st.isFile() && st.size <= MAX_FILE_BYTES)
|
|
95
|
+
out.set(`${sub}/${f}`, file);
|
|
96
|
+
else if (st.isFile())
|
|
97
|
+
oversized?.push(`${sub}/${f}`);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// gone between the listing and the stat
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
/** Each shipped path's winning file, over the layers (later wins). */
|
|
107
|
+
function winners(set) {
|
|
108
|
+
const out = new Map();
|
|
109
|
+
for (const layer of set.layers)
|
|
110
|
+
for (const [path, file] of layerFiles(layer))
|
|
111
|
+
out.set(path, { layer, file });
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
/** Whether a shipped file of that path exists to be replaced. */
|
|
115
|
+
const shipped = (root, path) => existsSync(join(root, path));
|
|
116
|
+
// ---- the repo profile --------------------------------------------------------------
|
|
117
|
+
/** Top-level `profile.toml` keys a repo profile may set. */
|
|
118
|
+
const REPO_TOML_KEYS = new Set(["ecosystem", "lenses", "scan", "posting", "addenda"]);
|
|
119
|
+
/** Keys named for what they would reach, so the refusal says why. */
|
|
120
|
+
const GUARDED_KEY = /^(dry_run|github|secrets?(_dir)?|guard|bash_guard|gate|posting_gate)$/i;
|
|
121
|
+
const REPO_FILE_RE = /^(?:profile\.toml|heuristics\.toml|(?:addenda|agents|prompts)\/[A-Za-z0-9][A-Za-z0-9._-]*\.md)$/;
|
|
122
|
+
const GIT_ENV = {
|
|
123
|
+
...process.env,
|
|
124
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
125
|
+
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
126
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
127
|
+
};
|
|
128
|
+
function gitOut(gitDir, args, maxBuffer = MAX_FILE_BYTES * 2) {
|
|
129
|
+
return execFileSync("git", ["-C", gitDir, ...args], {
|
|
130
|
+
env: GIT_ENV,
|
|
131
|
+
maxBuffer,
|
|
132
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** `profile.toml` cut down to what a repo may say; the rest named in `ignored`. */
|
|
136
|
+
function sanitizeRepoToml(raw, ignored) {
|
|
137
|
+
let doc;
|
|
138
|
+
try {
|
|
139
|
+
doc = parseToml(raw);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
throw new Error(`the repo profile ${REPO_PROFILE_DIR}/profile.toml is not valid TOML: ${String(err instanceof Error ? err.message : err)}`, { cause: err });
|
|
143
|
+
}
|
|
144
|
+
const kept = {};
|
|
145
|
+
for (const [key, value] of Object.entries(doc)) {
|
|
146
|
+
if (REPO_TOML_KEYS.has(key))
|
|
147
|
+
kept[key] = value;
|
|
148
|
+
else
|
|
149
|
+
ignored.push(GUARDED_KEY.test(key)
|
|
150
|
+
? `${REPO_PROFILE_DIR}/profile.toml: "${key}" is guarded; a repo profile cannot set it`
|
|
151
|
+
: `${REPO_PROFILE_DIR}/profile.toml: "${key}" is not a key a repo profile may set`);
|
|
152
|
+
}
|
|
153
|
+
return stringifyToml(kept);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Extract the repo profile from `ref` (a commit, the review's BASE) into
|
|
157
|
+
* `destDir`, reading git objects only: the working tree and the PR head are
|
|
158
|
+
* never consulted. Only the files in `REPO_FILE_RE` come out, as regular
|
|
159
|
+
* blobs under the size caps; a symlink, a submodule, an oversized file and
|
|
160
|
+
* anything outside the list is dropped and named in `ignored`. `dir` is null
|
|
161
|
+
* when the base has no `.qcr/` (or nothing in it a repo may carry).
|
|
162
|
+
*/
|
|
163
|
+
export function extractRepoProfile(o) {
|
|
164
|
+
if (!/^[0-9a-f]{7,64}$/i.test(o.ref))
|
|
165
|
+
throw new Error(`the repo profile is read from a commit, not ${JSON.stringify(o.ref)}`);
|
|
166
|
+
const ignored = [];
|
|
167
|
+
let listing;
|
|
168
|
+
try {
|
|
169
|
+
listing = gitOut(o.gitDir, ["ls-tree", "-r", "-z", "--long", o.ref, "--", REPO_PROFILE_DIR], 8 * 1024 * 1024).toString("utf8");
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// an unreadable base is no repo profile; the review's own git use reports it
|
|
173
|
+
return { dir: null, ignored };
|
|
174
|
+
}
|
|
175
|
+
let total = 0;
|
|
176
|
+
let wrote = false;
|
|
177
|
+
for (const entry of listing.split("\0").filter(Boolean)) {
|
|
178
|
+
const tab = entry.indexOf("\t");
|
|
179
|
+
const [mode, type, sha, size] = entry.slice(0, tab).split(/\s+/);
|
|
180
|
+
const path = entry.slice(tab + 1);
|
|
181
|
+
const rel = path.slice(REPO_PROFILE_DIR.length + 1);
|
|
182
|
+
const label = `${REPO_PROFILE_DIR}/${rel}`;
|
|
183
|
+
if (type !== "blob" || (mode !== "100644" && mode !== "100755")) {
|
|
184
|
+
ignored.push(`${label}: not a regular file (mode ${mode})`);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (!REPO_FILE_RE.test(rel)) {
|
|
188
|
+
ignored.push(`${label}: not a file a repo profile may carry`);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const bytes = Number(size);
|
|
192
|
+
if (!Number.isFinite(bytes) || bytes > MAX_FILE_BYTES || total + bytes > MAX_TOTAL_BYTES) {
|
|
193
|
+
ignored.push(`${label}: over the size cap`);
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
total += bytes;
|
|
197
|
+
let text = gitOut(o.gitDir, ["cat-file", "blob", sha]).toString("utf8");
|
|
198
|
+
if (rel === "profile.toml")
|
|
199
|
+
text = sanitizeRepoToml(text, ignored);
|
|
200
|
+
const dest = join(o.destDir, rel);
|
|
201
|
+
mkdirSync(join(dest, ".."), { recursive: true, mode: 0o700 });
|
|
202
|
+
writeFileSync(dest, text, { mode: 0o600 });
|
|
203
|
+
wrote = true;
|
|
204
|
+
}
|
|
205
|
+
return { dir: wrote ? o.destDir : null, ignored: capIgnored(ignored) };
|
|
206
|
+
}
|
|
207
|
+
function capIgnored(lines) {
|
|
208
|
+
return lines.length <= MAX_IGNORED_LINES
|
|
209
|
+
? lines
|
|
210
|
+
: [...lines.slice(0, MAX_IGNORED_LINES), `…and ${lines.length - MAX_IGNORED_LINES} more`];
|
|
211
|
+
}
|
|
212
|
+
// ---- the layers of one run -----------------------------------------------------------
|
|
213
|
+
/**
|
|
214
|
+
* The override layers of one run: the repo profile (when `repo` names a git
|
|
215
|
+
* dir and a base commit) under the user's named profile and everything it
|
|
216
|
+
* extends. Files with no shipped namesake apply to nothing and are reported.
|
|
217
|
+
*/
|
|
218
|
+
export function resolveOverrides(o) {
|
|
219
|
+
const layers = [];
|
|
220
|
+
const ignored = [];
|
|
221
|
+
const lookup = { ...(o.lookup ?? {}) };
|
|
222
|
+
if (o.repo) {
|
|
223
|
+
const r = extractRepoProfile({
|
|
224
|
+
gitDir: o.repo.gitDir,
|
|
225
|
+
ref: o.repo.baseRef,
|
|
226
|
+
destDir: o.repo.destDir,
|
|
227
|
+
});
|
|
228
|
+
ignored.push(...r.ignored);
|
|
229
|
+
if (r.dir !== null) {
|
|
230
|
+
layers.push({ origin: "repo", name: REPO_PROFILE_DIR, dir: r.dir });
|
|
231
|
+
lookup.repoProfile = { dir: r.dir };
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
// A profile found nowhere is no named chain, as for the tuning loaders.
|
|
235
|
+
const named = o.profile === "" ||
|
|
236
|
+
!findProfile({ root: o.root, profile: o.profile, homes: o.lookup?.homes ?? [] })
|
|
237
|
+
? []
|
|
238
|
+
: resolveProfileChain(o.root, o.profile, o.lookup ?? {});
|
|
239
|
+
for (const l of named)
|
|
240
|
+
layers.push({ origin: "user", name: l.name, dir: l.dir });
|
|
241
|
+
const set = { layers, ignored, lookup };
|
|
242
|
+
for (const layer of layers) {
|
|
243
|
+
const over = [];
|
|
244
|
+
for (const path of layerFiles(layer, over).keys())
|
|
245
|
+
if (!shipped(o.root, path))
|
|
246
|
+
ignored.push(`${layer.name}/${path}: no shipped file of that name to replace, so it applies to nothing`);
|
|
247
|
+
for (const path of over)
|
|
248
|
+
ignored.push(`${layer.name}/${path}: over the size cap`);
|
|
249
|
+
}
|
|
250
|
+
set.ignored = capIgnored(ignored);
|
|
251
|
+
return set;
|
|
252
|
+
}
|
|
253
|
+
/** Whether any layer carries a file that replaces a shipped one. */
|
|
254
|
+
export function hasOverrideFiles(root, set) {
|
|
255
|
+
for (const path of winners(set).keys())
|
|
256
|
+
if (shipped(root, path))
|
|
257
|
+
return true;
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The `readFile` for `buildAgents` and the prompt renderers: a shipped
|
|
262
|
+
* `agents/` or `prompts/` file under `root` reads from the winning layer when
|
|
263
|
+
* one carries it, and everything else reads as usual. Undefined when no layer
|
|
264
|
+
* replaces anything, so callers that pass it through change nothing.
|
|
265
|
+
*/
|
|
266
|
+
export function overrideReader(root, set) {
|
|
267
|
+
const won = new Map();
|
|
268
|
+
for (const [path, w] of winners(set))
|
|
269
|
+
if (shipped(root, path))
|
|
270
|
+
won.set(path, w.file);
|
|
271
|
+
if (won.size === 0)
|
|
272
|
+
return undefined;
|
|
273
|
+
const base = resolve(root);
|
|
274
|
+
return (p) => {
|
|
275
|
+
const rel = relative(base, resolve(p)).split(sep).join("/");
|
|
276
|
+
const file = won.get(rel);
|
|
277
|
+
return readFileSync(file ?? p, "utf8");
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Which shipped files this run's layers replaced with different bytes. The
|
|
282
|
+
* shipped hash is the seed manifest's for a seed, else the file's own. A
|
|
283
|
+
* run with no replacement returns at once, without reading the manifest.
|
|
284
|
+
*/
|
|
285
|
+
export function assessOverrides(root, set) {
|
|
286
|
+
const manifest = loadSeedManifest(root);
|
|
287
|
+
const overrides = [];
|
|
288
|
+
for (const [path, w] of winners(set)) {
|
|
289
|
+
if (!shipped(root, path))
|
|
290
|
+
continue;
|
|
291
|
+
const mine = sha256(readFileSync(w.file));
|
|
292
|
+
const seeded = manifest?.[path];
|
|
293
|
+
const theirs = seeded ?? sha256(readFileSync(join(root, path)));
|
|
294
|
+
if (mine === theirs)
|
|
295
|
+
continue;
|
|
296
|
+
overrides.push({
|
|
297
|
+
path,
|
|
298
|
+
origin: w.layer.origin,
|
|
299
|
+
layer: w.layer.name,
|
|
300
|
+
sha256: mine,
|
|
301
|
+
shipped_sha256: theirs,
|
|
302
|
+
seed: seeded !== undefined,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
overrides.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
306
|
+
return { customised: overrides.length > 0, overrides };
|
|
307
|
+
}
|
|
308
|
+
/** The line a report footer and the terminal carry for a customised run. */
|
|
309
|
+
export function customisedNote(c) {
|
|
310
|
+
const files = c.overrides.map((o) => `${o.path} (${o.origin} profile)`).join(", ");
|
|
311
|
+
return `Customised: this review ran with ${c.overrides.length} shipped file${c.overrides.length === 1 ? "" : "s"} replaced by a profile: ${files}.`;
|
|
312
|
+
}
|
|
313
|
+
//# sourceMappingURL=profileoverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileoverrides.js","sourceRoot":"","sources":["../../src/profileoverrides.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6BAA6B;AAC7B,EAAE;AACF,4EAA4E;AAC5E,EAAE;AACF,wEAAwE;AACxE,6EAA6E;AAC7E,uEAAuE;AACvE,0EAA0E;AAC1E,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAqE;AACrE,0EAA0E;AAC1E,4FAA4F;AAC5F,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,+EAA+E;AAC/E,0EAA0E;AAC1E,+EAA+E;AAC/E,mEAAmE;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAA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