mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 00:03:15 +01:00
gstack-eval-plan price-gate --gate "<exact command>" reads a GSTACK_EVAL_CALLS v1 file (--plan-file, else the base policy's price_file at HEAD), checks its binding (gate command string equality, head with only the plan file changed since, every input's sha256 at HEAD), prices each call purpose (aggregate totals) and each one-call reservation, and writes a receipt binding the price to the gate, head, inputs and plan bytes. Unpriced models print unknown, never zero (EVAL_PRICE_MISSING); a missing plan or no call lines is EVAL_GATE_UNPRICED unless --allow-unpriced records an owner override; over --cap-usd / --smoke-cap-usd is EVAL_GATE_OVER_CAP; malformed or partial files refuse EVAL_DRY_RUN_FAILED and stale ones EVAL_PLAN_STALE. dry-run --cap adds the same reservation-fits-cap check. Wire format, receipt and the reference emitter (formatEvalCalls): docs/eval-calls.md. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
176 lines
11 KiB
Bash
176 lines
11 KiB
Bash
# shellcheck shell=bash
|
|
# gstack-doctor-components.sh — GENERATED from lib/doctor-components.ts and
|
|
# lib/result-codes.ts by scripts/gen-doctor-components.ts (bun run gen:skill-docs). Do not edit; the
|
|
# freshness test is test/doctor-components.test.ts. Sourced by
|
|
# bin/gstack-doctor-check.sh; Bash 3.2 builtins only.
|
|
|
|
GSTACK_DOCTOR_COMPONENTS="claude codex patch codex-cli browse-bundle browser cso runtime pins state-root privacy cores revision"
|
|
GSTACK_DOCTOR_CORE="runtime pins state-root privacy cores revision"
|
|
GSTACK_DOCTOR_HOSTS="claude codex"
|
|
GSTACK_DOCTOR_OPTIONAL="codex-cli cso"
|
|
GSTACK_DOCTOR_SKILLS="autoplan plan-ceo-review plan-eng-review plan-design-review plan-devex-review plan-tune office-hours spec review ship investigate codex cso browse qa qa-only design-review design-consultation design-html devex-review scrape skillify canary benchmark make-pdf diagram pair-agent open-gstack-browser setup-browser-cookies connect-chrome land-and-deploy benchmark-models careful claude-code context-restore context-save design-shotgun deslop-shared-libs document-generate document-release eval-plan freeze gstack-upgrade guard health ios-clean ios-design-review ios-fix ios-qa ios-sync landing-report learn retro setup-deploy setup-gbrain sync-gbrain test-audit unfreeze"
|
|
GSTACK_BROWSER_LAZY_REASON="lazy; gstack-browser-ensure installs on first use"
|
|
|
|
# gstack_doctor_component_title ID — the human title; returns 1 for an unknown id.
|
|
gstack_doctor_component_title() {
|
|
case "$1" in
|
|
claude) printf '%s' 'Claude skills' ;;
|
|
codex) printf '%s' 'Codex skills' ;;
|
|
patch) printf '%s' 'Astra behavioral patch in the Codex render' ;;
|
|
codex-cli) printf '%s' 'Codex CLI (outside voice)' ;;
|
|
browse-bundle) printf '%s' 'browse bundle' ;;
|
|
browser) printf '%s' 'Chromium launch and render' ;;
|
|
cso) printf '%s' 'CSO native helper' ;;
|
|
runtime) printf '%s' 'gstack runtime (Bun)' ;;
|
|
pins) printf '%s' 'project pins' ;;
|
|
state-root) printf '%s' 'state root' ;;
|
|
privacy) printf '%s' 'privacy' ;;
|
|
cores) printf '%s' 'cores' ;;
|
|
revision) printf '%s' 'revision' ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
# gstack_doctor_component_kind ID — core | host | component | optional; returns 1 for an unknown id.
|
|
gstack_doctor_component_kind() {
|
|
case "$1" in
|
|
claude) printf '%s' 'host' ;;
|
|
codex) printf '%s' 'host' ;;
|
|
patch) printf '%s' 'component' ;;
|
|
codex-cli) printf '%s' 'optional' ;;
|
|
browse-bundle) printf '%s' 'component' ;;
|
|
browser) printf '%s' 'component' ;;
|
|
cso) printf '%s' 'optional' ;;
|
|
runtime) printf '%s' 'core' ;;
|
|
pins) printf '%s' 'core' ;;
|
|
state-root) printf '%s' 'core' ;;
|
|
privacy) printf '%s' 'core' ;;
|
|
cores) printf '%s' 'core' ;;
|
|
revision) printf '%s' 'core' ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
# gstack_doctor_skill_requires SKILL — the non-core ids the skill needs; returns 1 for an unknown skill.
|
|
gstack_doctor_skill_requires() {
|
|
case "$1" in
|
|
autoplan|plan-ceo-review|plan-eng-review|plan-design-review|plan-devex-review|plan-tune|office-hours|spec|review|ship|investigate) printf '%s' 'claude codex patch' ;;
|
|
codex) printf '%s' 'claude codex patch codex-cli' ;;
|
|
cso) printf '%s' 'claude cso' ;;
|
|
browse|qa|qa-only|design-review|design-consultation|design-html|devex-review|scrape|skillify|canary|benchmark|make-pdf|diagram|pair-agent|open-gstack-browser|setup-browser-cookies|connect-chrome|land-and-deploy) printf '%s' 'claude codex patch browse-bundle browser' ;;
|
|
benchmark-models|careful|claude-code|context-restore|context-save|design-shotgun|deslop-shared-libs|document-generate|document-release|eval-plan|freeze|gstack-upgrade|guard|health|ios-clean|ios-design-review|ios-fix|ios-qa|ios-sync|landing-report|learn|retro|setup-deploy|setup-gbrain|sync-gbrain|test-audit|unfreeze) printf '%s' 'claude' ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
# gstack_doctor_skill_optional SKILL — ids that SKIP when absent; returns 1 for an unknown skill.
|
|
gstack_doctor_skill_optional() {
|
|
case "$1" in
|
|
autoplan|plan-ceo-review|plan-eng-review|plan-design-review|plan-devex-review|plan-tune|office-hours|spec|review|ship|investigate) printf '%s' 'codex-cli' ;;
|
|
codex) printf '%s' '' ;;
|
|
cso) printf '%s' '' ;;
|
|
browse|qa|qa-only|design-review|design-consultation|design-html|devex-review|scrape|skillify|canary|benchmark|make-pdf|diagram|pair-agent|open-gstack-browser|setup-browser-cookies|connect-chrome|land-and-deploy) printf '%s' 'codex-cli' ;;
|
|
benchmark-models|careful|claude-code|context-restore|context-save|design-shotgun|deslop-shared-libs|document-generate|document-release|eval-plan|freeze|gstack-upgrade|guard|health|ios-clean|ios-design-review|ios-fix|ios-qa|ios-sync|landing-report|learn|retro|setup-deploy|setup-gbrain|sync-gbrain|test-audit|unfreeze) printf '%s' '' ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
# gstack_result_anchor CODE — the docs/troubleshooting.md anchor for a lib/result-codes.ts code; returns 1 for an unknown code.
|
|
gstack_result_anchor() {
|
|
case "$1" in
|
|
ARTIFACT_INVALID_JSON) printf '%s' 'artifact-invalid-json' ;;
|
|
ARTIFACT_UNSUPPORTED_VERSION) printf '%s' 'artifact-unsupported-version' ;;
|
|
ARTIFACT_SCHEMA) printf '%s' 'artifact-schema' ;;
|
|
ARTIFACT_MISSING) printf '%s' 'artifact-missing' ;;
|
|
ARTIFACT_STALE) printf '%s' 'artifact-stale' ;;
|
|
ARTIFACT_PATH_ESCAPE) printf '%s' 'artifact-path-escape' ;;
|
|
ARTIFACT_MALFORMED_JSONL) printf '%s' 'artifact-malformed-jsonl' ;;
|
|
ARTIFACT_DUPLICATE_ID) printf '%s' 'artifact-duplicate-id' ;;
|
|
ARTIFACT_UNBOUND_ID) printf '%s' 'artifact-unbound-id' ;;
|
|
ARTIFACT_DANGLING_REF) printf '%s' 'artifact-dangling-ref' ;;
|
|
ARTIFACT_DEPENDENCY_CYCLE) printf '%s' 'artifact-dependency-cycle' ;;
|
|
ARTIFACT_COUNT_MISMATCH) printf '%s' 'artifact-count-mismatch' ;;
|
|
ARTIFACT_RUN_INTERRUPTED) printf '%s' 'artifact-run-interrupted' ;;
|
|
ARTIFACT_REVIEWER_MISSING) printf '%s' 'artifact-reviewer-missing' ;;
|
|
ARTIFACT_GUARD_LINE_MISSING) printf '%s' 'artifact-guard-line-missing' ;;
|
|
GUARD_NOT_INSTALLED) printf '%s' 'guard-not-installed' ;;
|
|
REVIEW_STATUS_MISMATCH) printf '%s' 'review-status-mismatch' ;;
|
|
GATE_REV_STALE) printf '%s' 'gate-rev-stale' ;;
|
|
GATE_REPLY_UNPARSED) printf '%s' 'gate-reply-unparsed' ;;
|
|
COMPONENT_MISSING) printf '%s' 'doctor-component-missing' ;;
|
|
RUNTIME_BELOW_MINIMUM) printf '%s' 'doctor-runtime-below-minimum' ;;
|
|
PROJECT_PIN_MISMATCH) printf '%s' 'doctor-project-pin-mismatch' ;;
|
|
REVISION_UNMET) printf '%s' 'doctor-revision-unmet' ;;
|
|
RUNTIME_PIN_CONFLICT) printf '%s' 'capy-install-runtime-conflict' ;;
|
|
BROWSER_UNAVAILABLE) printf '%s' 'browser-ensure-failed' ;;
|
|
INSTALL_PREFLIGHT_FAILED) printf '%s' 'capy-install-preflight-failed' ;;
|
|
POLICY_SOURCE_UNAVAILABLE) printf '%s' 'policy-source-unavailable' ;;
|
|
POLICY_INVALID) printf '%s' 'policy-invalid' ;;
|
|
POLICY_CONTAINMENT) printf '%s' 'policy-containment' ;;
|
|
POLICY_EXISTS) printf '%s' 'policy-exists' ;;
|
|
REPO_COMMANDS_NOT_ALLOWED) printf '%s' 'repo-commands-not-allowed' ;;
|
|
QUEUE_STALE) printf '%s' 'queue-stale' ;;
|
|
RESTAMP_VERSION_SOURCE) printf '%s' 'restamp-version-source' ;;
|
|
RESTAMP_MERGE_CONFLICT) printf '%s' 'restamp-merge-conflict' ;;
|
|
RESTAMP_RELEASE_TOOL_FAILED) printf '%s' 'restamp-release-tool-failed' ;;
|
|
RESTAMP_OUTPUT_OUTSIDE_ALLOWED) printf '%s' 'restamp-output-outside-allowed' ;;
|
|
RESTAMP_CONFLICT) printf '%s' 'restamp-conflict' ;;
|
|
RESTAMP_PREDECESSOR_MOVED) printf '%s' 'restamp-predecessor-moved' ;;
|
|
CHANGELOG_DUPLICATE_HEADING) printf '%s' 'changelog-duplicate-heading' ;;
|
|
CHANGELOG_TOP_MISMATCH) printf '%s' 'changelog-top-mismatch' ;;
|
|
CHANGELOG_SECTION_MISSING) printf '%s' 'changelog-section-missing' ;;
|
|
GATE_REUSE_NOT_ELIGIBLE) printf '%s' 'gate-reuse-not-eligible' ;;
|
|
EVIDENCE_IDENTITY_UNKNOWN) printf '%s' 'evidence-identity-unknown' ;;
|
|
EVIDENCE_BUNDLE_INVALID) printf '%s' 'evidence-bundle-invalid' ;;
|
|
PREREGISTRATION_NOT_ANCESTOR) printf '%s' 'preregistration-not-ancestor' ;;
|
|
HISTORY_POLICY_VIOLATION) printf '%s' 'history-policy-violation' ;;
|
|
RECEIPT_MISSING) printf '%s' 'receipt-missing' ;;
|
|
RECEIPT_INVALID) printf '%s' 'receipt-invalid' ;;
|
|
EXECUTION_UNKNOWN) printf '%s' 'execution-unknown' ;;
|
|
RUN_LOCKED) printf '%s' 'run-locked' ;;
|
|
RUN_NOT_INITIALIZED) printf '%s' 'run-not-initialized' ;;
|
|
PHASE_NOT_AWAITING) printf '%s' 'phase-not-awaiting' ;;
|
|
ATTEMPT_MISMATCH) printf '%s' 'attempt-mismatch' ;;
|
|
RESULT_RECEIPT_MISSING) printf '%s' 'result-receipt-missing' ;;
|
|
RESULT_FINDINGS_MISSING) printf '%s' 'result-findings-missing' ;;
|
|
MODEL_FAMILY_CONFLICT) printf '%s' 'model-family-conflict' ;;
|
|
SPEND_CAP_EXCEEDED) printf '%s' 'spend-cap-exceeded' ;;
|
|
CONSENSUS_MISSING) printf '%s' 'consensus-missing' ;;
|
|
OUTSIDE_RUNNER_UNAVAILABLE) printf '%s' 'outside-runner-unavailable' ;;
|
|
REALITY_ROW_MISSING) printf '%s' 'reality-row-missing' ;;
|
|
REALITY_RECEIPT_MISSING) printf '%s' 'reality-receipt-missing' ;;
|
|
REGEN_REGISTRY_INVALID) printf '%s' 'regen-registry-invalid' ;;
|
|
REGEN_CONTAINMENT) printf '%s' 'regen-containment' ;;
|
|
REGEN_STALE) printf '%s' 'regen-stale' ;;
|
|
REGEN_COMMAND_FAILED) printf '%s' 'regen-command-failed' ;;
|
|
PREGATE_CONFIG_INVALID) printf '%s' 'pregate-config-invalid' ;;
|
|
PREGATE_SECRETS) printf '%s' 'pregate-secrets' ;;
|
|
PREGATE_STRAYS) printf '%s' 'pregate-strays' ;;
|
|
PREGATE_LITERALS) printf '%s' 'pregate-literals' ;;
|
|
PREGATE_NO_LANE) printf '%s' 'pregate-no-lane' ;;
|
|
PREGATE_LANE_FAILED) printf '%s' 'pregate-lane-failed' ;;
|
|
PREGATE_INCOMPLETE) printf '%s' 'pregate-incomplete' ;;
|
|
PREGATE_STALE) printf '%s' 'pregate-stale' ;;
|
|
PREGATE_REMOTE_UNCLEARED) printf '%s' 'pregate-remote-uncleared' ;;
|
|
ISSUE_UNREADABLE) printf '%s' 'issue-unreadable' ;;
|
|
PREREG_INCOMPLETE) printf '%s' 'prereg-incomplete' ;;
|
|
EVAL_PRICE_MISSING) printf '%s' 'eval-price-missing' ;;
|
|
EVAL_DRY_RUN_FAILED) printf '%s' 'eval-dry-run-failed' ;;
|
|
EVAL_ARMS_UNRESOLVED) printf '%s' 'eval-arms-unresolved' ;;
|
|
EVAL_BUDGET_EXHAUSTED) printf '%s' 'eval-budget-exhausted' ;;
|
|
LANE_CONFLICT) printf '%s' 'lane-conflict' ;;
|
|
LANE_REF_UNAVAILABLE) printf '%s' 'lane-ref-unavailable' ;;
|
|
EVIDENCE_UNVERIFIED) printf '%s' 'evidence-unverified' ;;
|
|
BANNED_TERM_FOUND) printf '%s' 'banned-term-found' ;;
|
|
BANNED_TERMS_INVALID) printf '%s' 'banned-terms-invalid' ;;
|
|
CONTRIBUTOR_SOURCE_UNAVAILABLE) printf '%s' 'contributor-source-unavailable' ;;
|
|
BRIEF_INPUT_MISSING) printf '%s' 'brief-input-missing' ;;
|
|
DRAFT_DIRECTION_UNRESOLVED) printf '%s' 'draft-direction-unresolved' ;;
|
|
PREGATE_GUARD_FAILED) printf '%s' 'pregate-guard-failed' ;;
|
|
EVAL_GATE_UNPRICED) printf '%s' 'eval-gate-unpriced' ;;
|
|
EVAL_GATE_OVER_CAP) printf '%s' 'eval-gate-over-cap' ;;
|
|
EVAL_PLAN_STALE) printf '%s' 'eval-plan-stale' ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|