Skip to content

feat: add fact-first runtime observation and local smart routing - #56

Draft
tttboy123 wants to merge 71 commits into
mainfrom
feature/runtime-producer-adapters
Draft

feat: add fact-first runtime observation and local smart routing#56
tttboy123 wants to merge 71 commits into
mainfrom
feature/runtime-producer-adapters

Conversation

@tttboy123

Copy link
Copy Markdown
Owner

Summary

This draft integrates the fact-first infrastructure work required after v0.6.0 and prepares the local 0.8 smart-routing candidate for independent review.

It includes:

  • fact-specific Provider collection and openusage-export/v1 consumer compatibility;
  • a separate bounded Runtime Observation ledger and read-only summary API;
  • content-free LiteLLM, OpenTelemetry GenAI and CLIProxyAPI producer adapters;
  • a deterministic, explainable Decision API/CLI with private bounded evidence;
  • native Provider Center routing connections, targets, policies, Dry Run, Shadow and Replay;
  • an optional, explicitly enabled IPv4-loopback Chat Completions proxy;
  • managed MiniMax, Moonshot/Kimi and Step Plan inference-credential reuse without exposing secrets to SwiftUI;
  • transactional install, rollback and uninstall hardening;
  • DNS-pinned execution transport that connects to an already validated numeric address while authenticating the original Provider hostname with TLS.

Why

OpenUsage Bar needs to remain a standalone, local-first macOS resource console while exposing stable, trustworthy facts to Loom and other schedulers. UI text is not an automation interface, missing facts never become zero, and routing must stay optional and isolated from the read-only resource ledger.

Security and privacy boundary

  • Credentials remain in Keychain and are never returned by the resource or routing APIs.
  • Prompt, response, tool arguments, headers, raw payloads and direct account identity are excluded from Runtime and routing evidence.
  • Runtime observations use separate bounded storage; dataRevision and runtimeRevision remain independent.
  • The execution proxy binds only to 127.0.0.1, is disabled by default and uses a one-time Bearer with an irreversible verifier persisted.
  • Provider redirects are disabled for execution. DNS is resolved once, every address must be public, and the TCP connection is pinned to one validated address while TLS verifies the original hostname.

The implementation-path security packet is in docs/security/0.8-routing-review.md. Independent approval is still required before any public 0.8 candidate or Canary qualification.

Validation

  • Full local scripts/build_app.sh: passed.
  • Python: 1,168 tests discovered; product coverage gate is at least 80%.
  • Swift: 293 tests in 23 suites; product line coverage 87.53%.
  • Go CLIProxyAPI adapter: test and pinned toolchain gates passed.
  • Dependency audit: no known vulnerabilities.
  • Tree/history secret scan and build privacy scans: zero matches.
  • Runtime Observation, LiteLLM and OpenTelemetry packaged smokes: passed.
  • Release smoke: clean install, upgrade, rollback, four injected failures, preserve-data uninstall and explicit purge passed.
  • Routing performance with 128 targets / 500 samples: engine p95 1.024 ms, API p95 1.992 ms, proxy p95 0.020 ms.
  • Local installed candidate: 0.8.3 (20), ad-hoc signed and deep-signature verified.

Release and Canary status

This is intentionally a Draft PR. Public release metadata remains v0.6.0 (9), the external cohort remains 0/5, and the 30-day clock remains not_started.

Before making this PR ready or publishing a 0.8 pre-release:

  • Independent security reviewer confirms no unresolved High/Critical finding and classifies the documented residual risks.
  • Required GitHub CI passes at the pushed commit.
  • Maintainer reviews the 67-commit integration scope and release notes.
  • A separate, immutable 0.8 pre-release candidate is generated by the release workflow with checksums, manifest, SPDX SBOM and attestations.
  • External machines submit opt-in, privacy-reviewed Canary reports; no machine count or clock state is changed without accepted evidence.

@tttboy123

Copy link
Copy Markdown
Owner Author

Independent security review is now tracked in #57. This Draft PR must remain draft until that review records no unresolved High/Critical finding and the required CI passes. The public v0.6.0 Canary state remains 0/5 with the clock not_started.

@tttboy123

Copy link
Copy Markdown
Owner Author

Required CI is green at 7f7470ab968ce4efc7f857d43145325fd7b3bd37: run 30772043063 completed in 10m03s. It passed action-pin verification, dependency audit, complete-history secret scan, release build, development-signed artifact packaging/audit, and isolated install/upgrade/rollback/uninstall. Independent security review #57 remains the gate before this Draft can become a public 0.8 candidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant