Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
399d750
fix(security): close SSRF egress gap for non-globally-routable addresses
claude Jul 30, 2026
035a7cb
fix(security): suppress five verified false-positive Semgrep findings
claude Aug 3, 2026
e36ecda
fix(fuzz): pin atheris per-interpreter (3.0.0 for <3.13, 3.1.0 for >=…
claude Aug 3, 2026
0703a6b
docs: start changelog for security and coverage fixes
seonghobae Aug 3, 2026
f969c6b
fix(fuzz): mirror atheris per-interpreter split into pyproject [fuzz]…
claude Aug 4, 2026
9a08d65
fix(security): add DNS-pinned provider transport
seonghobae Aug 4, 2026
179204f
fix(security): install DNS-pinned provider transport
seonghobae Aug 4, 2026
4a95e5e
test(security): cover DNS-pinned provider transport
seonghobae Aug 4, 2026
0d183be
docs: record DNS-pinned provider transport
seonghobae Aug 4, 2026
b9163f4
test(security): use one shared DNS seam
seonghobae Aug 4, 2026
bc301be
docs: design interpreter-portable Atheris lock
seonghobae Aug 5, 2026
2ddc31f
docs: plan interpreter-portable Atheris lock
seonghobae Aug 5, 2026
75737bb
test(fuzz): require interpreter-portable Atheris lock
seonghobae Aug 5, 2026
b56c01d
build(fuzz): partition Atheris by interpreter
seonghobae Aug 5, 2026
948984f
build(fuzz): document interpreter-specific Atheris inputs
seonghobae Aug 5, 2026
5f1fa0f
build(fuzz): lock Atheris for supported interpreters
seonghobae Aug 5, 2026
9517520
docs(fuzz): record interpreter lock evidence
seonghobae Aug 5, 2026
b4e0ccd
docs(fuzz): initialize changelog for portable lock
seonghobae Aug 5, 2026
7b272c9
test(fuzz): parse universal lock entries without cross-entry capture
seonghobae Aug 5, 2026
f770377
docs: align security changelog before branch integration
seonghobae Aug 5, 2026
50f497a
build(fuzz): align interpreter lock input for security integration
seonghobae Aug 5, 2026
02fb4ce
Merge b9163f4e088318b3a9d4498868639993845567f5 into 50f497a5e64b3e429…
seonghobae Aug 5, 2026
cfd42f3
docs: record interpreter lock evidence after security integration
seonghobae Aug 5, 2026
447ccf5
chore: stage one-shot provider transport integration
seonghobae Aug 5, 2026
fddd67a
chore: run reviewed provider transport integration
seonghobae Aug 5, 2026
98446c1
chore: allow explicit one-shot retrigger
seonghobae Aug 5, 2026
a7607c9
chore: supersede stale one-shot runs
seonghobae Aug 5, 2026
ff97606
fix: normalize one-shot generated file endings
seonghobae Aug 5, 2026
4e32cca
fix(security): make provider pinning import-safe
github-actions[bot] Aug 5, 2026
2f3dd04
docs(import): make side-effect-free package contract explicit
seonghobae Aug 5, 2026
9dbea15
ci: repair PR 96 loopback HTTP boundary
seonghobae Aug 5, 2026
549c474
ci: stage valid PR 96 loopback repair script
seonghobae Aug 5, 2026
87a3b40
ci: run valid PR 96 loopback repair
seonghobae Aug 5, 2026
e1cfc6e
fix(security): restrict plain HTTP providers to loopback
github-actions[bot] Aug 5, 2026
03124cf
docs(security): clarify loopback HTTP guarantees
seonghobae Aug 5, 2026
7283a26
docs(ci): record trusted reusable-workflow retry boundary
seonghobae Aug 5, 2026
8b479f5
docs(changelog): record central coverage retry evidence
seonghobae Aug 5, 2026
db85cdf
test(security): require bounded provider responses
seonghobae Aug 7, 2026
183c792
fix(security): bound provider response consumption
seonghobae Aug 7, 2026
62f3e71
docs(changelog): record bounded provider responses
seonghobae Aug 7, 2026
797f730
docs(security): doctor provider response bounds
seonghobae Aug 7, 2026
ecad520
test(security): make bounded HTTP response double valid
seonghobae Aug 7, 2026
d545ba5
test(security): reject oversized provider response headers
seonghobae Aug 7, 2026
fee52f0
test(security): cover provider framing edge cases
seonghobae Aug 7, 2026
7ebbdac
fix(security): validate provider response framing early
seonghobae Aug 7, 2026
e401d3e
refactor(security): remove unreachable header type branch
seonghobae Aug 7, 2026
5bd8c2f
docs(security): record provider framing preflight
seonghobae Aug 7, 2026
0974d94
docs(changelog): record provider framing validation
seonghobae Aug 7, 2026
e032de3
test(security): reject non-HTTP whitespace in content length
seonghobae Aug 7, 2026
f49c410
fix(security): accept only HTTP optional whitespace
seonghobae Aug 7, 2026
c44541e
docs(security): constrain content-length whitespace
seonghobae Aug 7, 2026
605edee
test(security): preserve valid HTTP optional whitespace
seonghobae Aug 7, 2026
4de7eee
test(ci): require stacked PR exact-head checkout
seonghobae Aug 7, 2026
7fa66b4
fix(ci): test exact PR heads across stacks
seonghobae Aug 7, 2026
608c733
fix(ci): fuzz exact PR heads across stacks
seonghobae Aug 7, 2026
e10a1be
fix(ci): secure exact PR heads across stacks
seonghobae Aug 7, 2026
5a3e90f
docs(ci): record exact-head stacked PR evidence
seonghobae Aug 7, 2026
2df63e0
docs(changelog): record exact-head stacked PR checks
seonghobae Aug 7, 2026
89ad7cb
docs(ci): normalize APA references for exact-head evidence
seonghobae Aug 7, 2026
89a457a
test(streaming): fail closed on incomplete provider streams
seonghobae Aug 7, 2026
fdac089
fix(streaming): reject truncated provider SSE
seonghobae Aug 7, 2026
2e35d9f
docs(streaming): record fail-closed SSE completion contract
seonghobae Aug 7, 2026
f23e738
docs(changelog): note incomplete SSE rejection
seonghobae Aug 7, 2026
f4f6507
test(stream): require event-stream provider media type
seonghobae Aug 7, 2026
529182d
fix(stream): fail closed on non-SSE provider responses
seonghobae Aug 7, 2026
af1b8ec
test(stream): cover SSE media-type enforcement
seonghobae Aug 7, 2026
7b74e15
docs(stream): record fail-closed SSE media contract
seonghobae Aug 7, 2026
87eb2a3
docs(stream): record SSE media-type hardening
seonghobae Aug 7, 2026
c2589c0
test(security): expose revoked provider credential egress
seonghobae Aug 7, 2026
66dcbef
test(security): pin revoked credential failure to pre-socket boundary
seonghobae Aug 7, 2026
eb801d5
fix(security): block revoked provider credentials before socket egress
seonghobae Aug 7, 2026
4714354
docs(security): define provider credential revocation boundary
seonghobae Aug 7, 2026
6848d99
docs(changelog): record revoked credential pre-socket guard
seonghobae Aug 7, 2026
d3d02f3
test(security): reject unsupported provider transfer codings
seonghobae Aug 7, 2026
7dc4ae6
fix(security): fail closed on unsupported transfer codings
seonghobae Aug 7, 2026
fe2e878
docs(security): record provider transfer-coding boundary
seonghobae Aug 7, 2026
cc8f7b5
docs(changelog): record transfer-coding fail-closed gate
seonghobae Aug 7, 2026
76fc98b
test(security): reject malformed provider stream utf8
seonghobae Aug 7, 2026
e46a9d8
fix(security): redact malformed provider stream utf8
seonghobae Aug 7, 2026
ff947dd
docs(security): record provider stream utf8 boundary
seonghobae Aug 7, 2026
e81bef5
docs(changelog): record provider stream utf8 hardening
seonghobae Aug 7, 2026
e8f875b
test(security): define strict provider JSON boundary
seonghobae Aug 7, 2026
81c2c70
test(security): bind strict JSON to provider request path
seonghobae Aug 7, 2026
f0e9a66
fix(security): enforce strict provider JSON boundary
seonghobae Aug 7, 2026
e035eee
docs(security): doctor strict provider JSON boundary
seonghobae Aug 7, 2026
fe728b7
docs(changelog): record strict provider JSON boundary
seonghobae Aug 7, 2026
95a67ee
test(security): close provider JSON branch gaps
seonghobae Aug 7, 2026
243387c
test(security): reject provider JSON float overflow
seonghobae Aug 8, 2026
da4f818
fix(security): reject provider JSON float overflow
seonghobae Aug 8, 2026
5036cce
docs(security): record finite JSON number boundary
seonghobae Aug 8, 2026
1142437
docs(changelog): record provider JSON exponent hardening
seonghobae Aug 8, 2026
9800fb3
test(coverage): require fail-closed production evidence
seonghobae Aug 8, 2026
85e9233
fix(coverage): include every production module
seonghobae Aug 8, 2026
0c4448a
ci(coverage): fail closed at exact head
seonghobae Aug 8, 2026
e9781f8
test(coverage): port kv config branch regressions
seonghobae Aug 8, 2026
393cae3
test(coverage): port token counting branch regressions
seonghobae Aug 8, 2026
fdb6f63
test(coverage): close credential bootstrap branches
seonghobae Aug 8, 2026
384b5fd
test(coverage): port batch embedding branch regressions
seonghobae Aug 8, 2026
b4215cb
test(ledger): prove injected empty stores are preserved
seonghobae Aug 8, 2026
0851276
fix(ledger): preserve injected empty stores
seonghobae Aug 8, 2026
6df9e64
test(coverage): restore ledger and router behavioral coverage
seonghobae Aug 8, 2026
6d26996
test(coverage): restore orchestration readiness behavior
seonghobae Aug 8, 2026
b44e6e7
test(coverage): exercise CLI bootstrap and runtime modes
seonghobae Aug 8, 2026
c678abb
test(coverage): exercise server admin and operator branches
seonghobae Aug 8, 2026
8362028
fix: repair readiness and agent pool contracts
seonghobae Aug 8, 2026
3703d0d
fix: close exact-head coverage gaps
seonghobae Aug 8, 2026
06f51c3
fix: fail closed when durable KV is unavailable
seonghobae Aug 12, 2026
4a925d1
fix: bind coordinator to durable KV authority
seonghobae Aug 12, 2026
c7d7282
build: bind package metadata to MIT license authority (#108)
seonghobae Aug 12, 2026
90fa04d
ci: re-trigger OpenCode after green coverage-evidence
seonghobae Aug 12, 2026
c24614f
ci: re-trigger OpenCode after green coverage-evidence (stale REQUEST_…
seonghobae Aug 12, 2026
fcdfa93
feat: durable automatic multi-provider catalog (#574)
seonghobae Aug 16, 2026
55af610
test(provider-catalog): close coverage gaps
seonghobae Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly deeper run (longer per-target budget via FUZZ_SECONDS).
- cron: "41 4 * * 2"
Expand All @@ -26,6 +25,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python
Expand All @@ -50,6 +50,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python
Expand Down
146 changes: 146 additions & 0 deletions .github/workflows/provider-catalog-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Provider Catalog Sync

on:
pull_request:
workflow_dispatch:
schedule:
- cron: "17 */6 * * *"

permissions:
contents: read

concurrency:
group: provider-catalog-${{ github.ref }}
cancel-in-progress: false

jobs:
contract:
name: Offline provider-catalog contracts
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout exact revision
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # actions/setup-python@v6
with:
python-version: "3.12"

- name: Install hash-locked test dependencies
run: |
python -m pip install --require-hashes -r requirements-opencode-review-ci.txt
python -m pip install --require-hashes -r fuzz/requirements-property.txt

- name: Run provider-catalog contracts
run: |
python -m pytest tests/test_provider_catalog.py tests/test_provider_catalog_coverage.py -q
python -m compileall -q contextual_orchestrator

synchronize:
name: Seed credentials and refresh durable catalog
if: >-
github.event_name != 'pull_request' &&
github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 20
environment: production
env:
CONTEXTUAL_ORCHESTRATOR_KV_BACKEND: postgres
CONTEXTUAL_ORCHESTRATOR_KV_DSN: ${{ secrets.CONTEXTUAL_ORCHESTRATOR_KV_DSN }}
CONTEXTUAL_ORCHESTRATOR_CATALOG_DSN: ${{ secrets.CONTEXTUAL_ORCHESTRATOR_KV_DSN }}
CONTEXTUAL_ORCHESTRATOR_KV_PASSPHRASE: ${{ secrets.CONTEXTUAL_ORCHESTRATOR_KV_PASSPHRASE }}
NVIDIA_NIM_API_KEY: ${{ secrets.NVIDIA_NIM_API_KEY }}
NVIDIA_NIM_API_KEY_SUB: ${{ secrets.NVIDIA_NIM_API_KEY_SUB }}
BYTEZ_API_KEY: ${{ secrets.BYTEZ_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- name: Checkout protected default-branch revision
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # actions/setup-python@v6
with:
python-version: "3.12"

- name: Install hash-locked runtime and database dependencies
run: python -m pip install --require-hashes -r requirements.lock

- name: Validate trusted bootstrap inventory
shell: bash
run: |
set +x
required=(
CONTEXTUAL_ORCHESTRATOR_KV_DSN
CONTEXTUAL_ORCHESTRATOR_KV_PASSPHRASE
NVIDIA_NIM_API_KEY
NVIDIA_NIM_API_KEY_SUB
BYTEZ_API_KEY
OPENROUTER_API_KEY
OPENAI_API_KEY
)
for name in "${required[@]}"; do
value="${!name:-}"
if [[ -z "$value" ]]; then
echo "::error title=Provider catalog bootstrap blocked::Required secret $name is not configured"
exit 2
fi
echo "::add-mask::$value"
done

- name: Seed encrypted credential registry and refresh model catalog
shell: bash
run: |
set +x
python -m contextual_orchestrator.provider_catalog \
bootstrap-and-sync \
--require-all \
--agents-output "$RUNNER_TEMP/provider-agents.json" \
> "$RUNNER_TEMP/provider-catalog-summary.json"

- name: Verify secret-free generated agent pool
shell: bash
run: |
python - <<'PY'
import json
import os
from pathlib import Path

agents_path = Path(os.environ["RUNNER_TEMP"]) / "provider-agents.json"
summary_path = Path(os.environ["RUNNER_TEMP"]) / "provider-catalog-summary.json"
agents = json.loads(agents_path.read_text(encoding="utf-8"))["agents"]
summary = json.loads(summary_path.read_text(encoding="utf-8"))
if not agents:
raise SystemExit("provider catalog produced no candidate agents")
forbidden = {
os.environ[name]
for name in (
"NVIDIA_NIM_API_KEY",
"NVIDIA_NIM_API_KEY_SUB",
"BYTEZ_API_KEY",
"OPENROUTER_API_KEY",
"OPENAI_API_KEY",
)
}
serialized = json.dumps({"agents": agents, "summary": summary})
if any(secret and secret in serialized for secret in forbidden):
raise SystemExit("generated provider evidence contains a secret value")
print(json.dumps({
"candidate_agent_count": len(agents),
"candidate_model_count": summary["candidate_model_count"],
"measurement_status": summary["measurement_status"],
}, sort_keys=True))
PY

- name: Confirm runtime secret-source boundary
shell: bash
run: |
unset NVIDIA_NIM_API_KEY NVIDIA_NIM_API_KEY_SUB BYTEZ_API_KEY OPENROUTER_API_KEY OPENAI_API_KEY
echo "Provider credentials are persisted in the encrypted KV registry; runtime resolves names only."
3 changes: 2 additions & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "17 3 * * 1"
workflow_dispatch:
Expand All @@ -34,6 +33,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Initialize CodeQL
Expand All @@ -54,6 +54,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read
Expand All @@ -15,24 +14,35 @@ concurrency:

jobs:
pytest:
name: Full unit and contract suite
name: Full unit and contract suite (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # actions/setup-python@v6
with:
python-version: "3.12"
python-version: ${{ matrix.python-version }}

- name: Install test dependencies
# Hash-pinned per OpenSSF Scorecard Pinned-Dependencies. Reuses the
# property-test lockfile (pytest + hypothesis), which covers the full
# suite's requirements: the package itself is stdlib-only.
run: python -m pip install --require-hashes -r fuzz/requirements-property.txt
# Both inputs are hash-locked. The review-tool lock provides coverage
# and interrogate; the property-test lock is installed last so the
# repository keeps its existing pytest + Hypothesis test environment.
run: |
python -m pip install --require-hashes -r requirements-opencode-review-ci.txt
python -m pip install --require-hashes -r fuzz/requirements-property.txt

- name: Run full test suite
run: python -m pytest -q
run: |
python -m coverage erase
python -m coverage run --branch -m pytest -q
python -m coverage report --fail-under=100
interrogate --fail-under 100 contextual_orchestrator
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Changelog

All notable changes to Contextual Orchestrator are documented in this file.

The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Add a durable, normalized provider catalog for the organization `NVIDIA_NIM_API_KEY`, `NVIDIA_NIM_API_KEY_SUB`, `BYTEZ_API_KEY`, `OPENROUTER_API_KEY`, and `OPENAI_API_KEY` accounts; trusted bootstrap writes values only to the encrypted credential registry, discovers provider models account by account, preserves last-known-good catalogs on isolated failures, generates role-tagged agents, and starts the gateway from enabled database candidates with `--provider-catalog-dsn`.
- Add a provider-aware runtime client that preserves the hardened OpenAI-compatible transport for OpenAI, OpenRouter, and NVIDIA NIM while using a narrow native Bytez Key/input adapter and failing closed for unsupported Bytez passthrough response shapes.
- Add a trust-separated Provider Catalog Sync workflow: pull requests run secret-free offline contracts, while protected-main scheduled/manual runs require the complete five-key inventory plus durable KV DSN/passphrase, verify generated evidence contains no secret value, and never downgrade a configured database to process memory.

### Security

- Fail closed with a stable redacted error when an explicitly configured Postgres KV backend cannot be imported, initialized, or seeded, and route `CostRoutingCoordinator(postgres_dsn=...)` through that authoritative factory, preventing a silent downgrade of configuration, routing, price, and credential authority to process-local memory.
- Restrict the private plain-HTTP provider seam to `localhost` or literal loopback IP addresses, reject URL userinfo before connection, dial directly without ambient proxy lookup, reject all redirect responses, and close failed resources deterministically.
- Pin each HTTPS provider connection to the exact public addresses approved during validation, preserve the original hostname for TLS verification, bypass environment proxy resolution, and reject redirects to close DNS-rebinding and credential-forwarding SSRF paths.
- Fail closed at the final pre-socket HTTPS boundary when a provider Bearer credential is missing or empty at dispatch time, so credential revocation after DNS validation cannot degrade into unauthenticated provider network egress.
- Bound every provider response to 8 MiB of cumulative consumed bytes, including SSE iteration, reject oversized declared lengths before body consumption, fail closed on malformed or conflicting `Content-Length` and ambiguous `Content-Length` plus `Transfer-Encoding`, redact header-inspection failures, and never silently truncate an untrusted response.
- Accept only the single HTTP/1.1 `chunked` provider `Transfer-Encoding` that the reviewed standard-library transport decodes, and fail closed on unsupported transfer codings or coding chains before application model-output parsing.
- Require a real provider streaming response to advertise the `text/event-stream` media type before any streamed body line is consumed, accepting media-type parameters but rejecting missing or incompatible types and redacting header-access failures.
- Reject malformed UTF-8 in accepted provider SSE streams with one stable redacted error, preventing provider-controlled decoder detail from crossing the transport trust boundary while preserving deterministic cleanup.
- Fail closed when an accepted OpenAI-compatible SSE provider stream contains malformed `data:` JSON or reaches EOF before its terminal `data: [DONE]` marker, preventing truncated model output from being accepted as successful orchestration evidence.
- Reject malformed UTF-8/JSON, duplicate object names, Python non-finite-number extensions, finite-syntax exponents that overflow Python floats to non-finite values, and non-object top-level values in validated structured provider responses before application parsing; canonicalize valid JSON and strict Batch JSON Lines so later decoder failures cannot retain the original provider document.
- Integrate DNS-pinned provider dispatch directly into `ModelClient` so package import performs no optional-adapter monkey-patching or order-dependent class mutation.
- Reject provider hosts that resolve to any non-globally-routable address, including RFC 6598 shared address space, while retaining explicit multicast, private, loopback, link-local, and reserved-address protections.
- Document narrowly scoped Semgrep suppressions for parameter-bound database queries, the explicit development-only TLS verification opt-out, and provider URLs that pass the egress guard.

### Changed

- Build and inspect normal wheel and sdist artifacts to enforce emitted PEP 639 license fields, project URLs, and packaged license paths.
- Declare the MIT SPDX license, packaged license file, authoritative project URLs, and current provider-neutral orchestration-control-plane description in distribution metadata, and pin the PEP 639-capable setuptools build backend.
- Pin Atheris by Python interpreter so the Python 3.11 fuzz job and the newer central coverage-evidence image both install a published, hash-locked wheel.
- Run repository Tests, Fuzz, and Security workflows for stacked pull requests targeting any branch, bind every checkout to the literal contributor-head SHA, and keep checkout credentials non-persistent so local evidence cannot silently become absent or synthetic-merge-only evidence.

### Documentation

- Add durable provider-catalog design, implementation plan, operator guide, and APA 7 doctoring covering credential/catalog separation, normalized data, account-isolated refresh, route/conduct pool construction, native Bytez handling, trusted Actions bootstrap, rotation, incident response, evidence interpretation, and rollback.
- Add APA 7 doctoring for Python environment-marker semantics, Atheris artifact availability and hashes, and the supported-platform uncertainty boundary.
- Add provider-response resource-bound doctoring covering the 8 MiB fail-closed limit, HTTP framing preflight, `text/event-stream` media-type enforcement, bounded SSE reads, OpenAI-compatible `[DONE]` completion evidence, malformed-event and premature-EOF handling, batch-output partitioning, incident handling, and operational rollback.
- Add provider-stream UTF-8 doctoring grounding strict SSE/JSON decoding and redacted malformed-input handling in the WHATWG HTML Standard and RFC 8259, with verification, failure, rollback, and authority boundaries.
- Add provider-JSON trust-boundary doctoring grounding strict UTF-8 object decoding, duplicate-name and non-finite-number rejection, finite-runtime numeric enforcement for extreme exponents, Batch JSONL validation, redacted parser failures, request-path authority, operator recovery, and rollback in RFC 8259, current Python documentation, and the OpenAI Batch API contract.
- Add provider transfer-coding doctoring that distinguishes full RFC 9112 protocol validity from the product's intentionally narrower decoded `chunked` subset, with fail-closed compatibility and rollback guidance.
- Add provider-credential revocation doctoring covering the dispatch-time race, final pre-socket Bearer guard, operator recovery, compatibility boundary, rollback invariant, and current IETF HTTP/OAuth references.
- Add pull-request exact-head workflow doctoring covering stacked-base support, contributor-head identity, untrusted-code execution, merge-tree separation, cancellation handling, and rollback.
- Record the CI trust boundary between generic coverage and native fuzz execution, including the evidence-preserving retry rule for branch-referenced reusable workflows.
44 changes: 42 additions & 2 deletions contextual_orchestrator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
"""Public package exports for the contextual orchestration runtime."""
"""Public package exports for the contextual orchestration runtime.

Importing this module is intentionally side-effect free: provider transports and
optional adapters are configured explicitly by their owning runtime components.
"""

from .batch_routing import (
BatchJob,
Expand Down Expand Up @@ -36,8 +40,28 @@
)
from .cost_router import CostRoutingCoordinator
from .credentials import NotConfigured, get_credential, register_credential
from .kv_config import InMemoryConfigStore, get_config_store
from .kv_config import (
ConfigBackendUnavailableError,
InMemoryConfigStore,
get_config_store,
)
from .orchestrator import ModelAgent, TaskOrchestrator, WorkflowStep, load_agents
from .provider_catalog import (
DEFAULT_PROVIDER_ACCOUNTS,
CatalogHttpError,
CatalogModelRecord,
DiscoveredModel,
InMemoryProviderCatalogStore,
PostgresProviderCatalogStore,
ProviderAccount,
ProviderAwareModelClient,
ProviderCatalogHttpClient,
ProviderCatalogService,
ProviderCatalogUnavailable,
bootstrap_provider_credentials,
build_catalog_orchestrator,
normalize_models_document,
)
from .token_counting import HeuristicTokenCounter, build_token_counter

__all__ = [
Expand All @@ -48,6 +72,21 @@
"get_credential",
"register_credential",
"NotConfigured",
# durable provider catalog
"DEFAULT_PROVIDER_ACCOUNTS",
"ProviderAccount",
"DiscoveredModel",
"CatalogModelRecord",
"CatalogHttpError",
"ProviderCatalogUnavailable",
"InMemoryProviderCatalogStore",
"PostgresProviderCatalogStore",
"ProviderCatalogHttpClient",
"ProviderAwareModelClient",
"ProviderCatalogService",
"bootstrap_provider_credentials",
"normalize_models_document",
"build_catalog_orchestrator",
# cost review
"ATTRIBUTION_DIMENSIONS",
"AttributionDimensions",
Expand All @@ -66,6 +105,7 @@
"dimension_catalog",
# config / tokens
"InMemoryConfigStore",
"ConfigBackendUnavailableError",
"get_config_store",
"HeuristicTokenCounter",
"build_token_counter",
Expand Down
Loading
Loading