Base Contracts

July 30, 2026 ยท View on GitHub

Base contracts are documented promises that should fail loudly when behavior, docs, tests, generated guidance, or workflow policy drift apart. This registry maps the first high-value contracts to their source of truth and executable enforcement.

Use this page during product reviews and large review-batch triage. If a finding says "the docs say X but the code does Y", add or update a contract row before treating the fix as complete.

Contract Registry

ContractSource of truthEnforced byFailure modeArea
GitHub workflow policyGitHub Workflow, CI Supply Chain Policy, .github/workflows/*.ymltests/test_github_workflows.pyWorkflow permissions, concurrency, timeout, token, supported Python, or generated-guidance policy driftCI
Workspace manifest repository URL policyWorkspace Manifest, cli/python/base_projects/workspace_manifest.pycli/python/base_projects/tests/test_workspace_manifest.pyA documented accepted URL form is rejected, or an insecure http:// repository URL passes silentlyWorkspace
Workspace manifest source policyWorkspace Manifest, cli/python/base_projects/workspace_pull.pycli/python/base_projects/tests/test_workspace_pull.pyworkspace.manifest_source accepts cleartext HTTP or overwrites a local manifest after an invalid fetchWorkspace
Project installer template integrityProject Installers, templates/project-install.shcli/bash/commands/basectl/tests/repo.batsThe maintained installer template downloads and executes a Base installer without honoring configured SHA-256 verificationSecurity
Base-owned remote shell installer policyRemote Installer Policy, cli/python/base_setup/remote_installers.py, standalone Homebrew entry pointstests/test_remote_installer_policy.py, cli/python/base_setup/tests/test_remote_installers.py, focused Homebrew BATS testsA Base-owned installer bypasses the registry, its documented URL drifts, or a managed uv/mise override executes unverified or different bytesSecurity
CLI local log file privacyLocal Observability, base_cli/logging.pybase-cli/tests/test_logging.pyPersistent CLI log files are created with permissive permissions, exposing command details before Base can restrict themSecurity
CLI docs, help, and completion driftCommand Quick Reference, .ai-context/COMMANDS.md, bin/basectl, shell completion scriptscli/bash/commands/basectl/tests/docs.bats, cli/bash/commands/basectl/tests/help.bats, cli/bash/commands/basectl/tests/completions.batsPublic help, docs shortcut behavior, command reference, AI context, or completions no longer match the shipped command surfaceCLI
Public command and JSON stability tiersStability Tiers, Command Quick Reference, Doctor Finding IDstests/test_stability_tiers_docs.pyPublic command tiers, JSON compatibility rules, or stable finding ID guarantees become undocumented or drift from command docsProduct
Read-only inspection JSONInspection JSON, Command Quick Referencecli/bash/commands/basectl/tests/inspection-json.bats, cli/python/base_release/tests/test_engine.py, base-cli/tests/test_inspection.py, tests/test_stability_tiers_docs.pyA scoped command emits prose or invalid JSON, changes the v1 envelope, loses finding/error semantics, or diverges from text-mode exit policyCLI
Project metadata defaults.github/base-project.yml, GitHub Workflow, Repository Baselinecli/python/base_github_projects/tests/, cli/bash/commands/basectl/tests/gh.bats, cli/bash/commands/basectl/tests/repo.batsIssue defaults, Project field options, or repo-visible Project configuration drift from the Base Project schemaProduct
Canonical positioning documentationProduct Requirements, Product Assessment, Why Base, and the canonical introduction surfacestests/test_contract_hardening.pyA canonical newcomer, contributor, or agent surface reintroduces retired product positioning or drops the accepted local-operating-contract thesis and outcome loopProduct

Contract Check Runner

Default Python validation includes the top-level Python contract tests. That means python -m pytest in CI and ./bin/base-test in a source checkout fail when GitHub workflow policy or the contract registry drifts.

Run the focused cross-surface contract slice with:

tests/contracts/run.sh

The runner intentionally composes existing focused tests. It is not a replacement for the full suite. Use it when:

  • a review batch reports docs/implementation drift;
  • a change edits workflow policy, public command docs, generated guidance, workspace manifest policy, or project installer behavior;
  • a PR needs a fast contract-focused signal before broader validation.

Review Finding Taxonomy

Classify future review findings before opening issues:

  • implementation bug: shipped behavior is wrong even if docs are silent.
  • docs/implementation drift: docs and behavior disagree.
  • missing regression test: a fixed bug has no focused test.
  • missing policy test: a documented policy has no executable guard.
  • duplicated helper/API drift: parallel helpers disagree or invite inconsistent fixes.
  • stale generated artifact: generated guidance, completions, or exported context is out of date.

This classification should appear in issue bodies for review-driven findings. It keeps future passes focused on the failure mode instead of producing another undifferentiated backlog.