Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
222 changes: 222 additions & 0 deletions docs/en/docs/operate/gateway-evidence.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/en/docs/operate/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"context-protection",
"atomic-memory-migration",
"observability",
"gateway-evidence",
"reference-observability-stack",
"trace-with-phoenix",
"trace-with-langfuse",
Expand Down
7 changes: 7 additions & 0 deletions docs/en/docs/operate/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ These signals describe service behavior; they do not replace inspection of store

For a provisioned local metrics/trace/log backend, see the [reference observability stack](reference-observability-stack.md).

Rust Gateway call evidence uses its own `gateway.model_call` operation with `call`, `attempt`, and `delivery` units.
Its common outcome projection and exporter limits are defined in the [Gateway evidence contract](gateway-evidence.md).
The managed Server OTLP pipeline does not ingest that JSONL stream by default.

## Logs

The foreground Server writes operational logs to its process output. Configure
Expand Down Expand Up @@ -580,3 +584,6 @@ Topic processing may report `invalid_topic_placeholder` for recognizable numbere
identify recoverable generation rejection, not successful NOOP. Retries use the existing durable Window budget;
exhaustion retains the pending frontier. Existing worker events and correlation fields carry the diagnostic code.
Source text, generated bodies and provider responses must not be added to operational logs.

Rust Gateway call/attempt/usage and HTTP-framework observations use a separate
[bounded evidence output](gateway-evidence.md); they do not add Python log fields or establish client receipt.
208 changes: 208 additions & 0 deletions docs/zh/docs/operate/gateway-evidence.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/zh/docs/operate/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"context-protection",
"atomic-memory-migration",
"observability",
"gateway-evidence",
"reference-observability-stack",
"trace-with-phoenix",
"trace-with-langfuse",
Expand Down
7 changes: 7 additions & 0 deletions docs/zh/docs/operate/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ description: 通过日志定位请求,并查看 Server 指标与 Trace。

需要自动配置的本地 metrics、traces 和 logs 后端时,参见[参考监控环境](reference-observability-stack.md)。

Rust Gateway 调用证据使用独立的 `gateway.model_call` 操作及 `call`、`attempt`、`delivery` 单位。
通用 outcome 投影与 exporter 边界见 [Gateway 证据契约](gateway-evidence.md)。
托管 Server OTLP pipeline 默认不采集该 JSONL 流。

## 日志

前台 Server 将运行日志写入进程输出。可配置 `POWERCONTEXT_SERVER_LOGGING_LEVEL`(默认 `INFO`)、
Expand Down Expand Up @@ -510,3 +514,6 @@ Topic 处理可通过 `invalid_topic_placeholder` 标识可识别的编号占位
这些不含内容的诊断码表示可恢复的生成拒绝,不表示成功 NOOP。
重试消耗现有 Window 持久化预算;耗尽后保留待处理前沿。诊断码由现有 Worker 事件及关联字段承载。
不得将 Source 文本、生成正文或服务商响应写入运维日志。

Rust Gateway 的调用/尝试/usage 与 HTTP 框架观测使用独立的[有界证据输出](gateway-evidence.md),
不新增 Python 日志字段,也不证明客户端已收到内容。
29 changes: 17 additions & 12 deletions gateway/CAPACITY_VALIDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
Scope: G5-A of [#2464](https://github.com/oceanbase/powercontext/issues/2464), the independent capacity stop-loss stage.
The implemented boundary is startup-confirmed model input, final rendered-body admission, bounded provider-response
buffering, and separate model/fallback concurrency permits. The HTTP capability schema is unchanged.
G5-A acceptance is partial: possible billing is retained only in process-local lifecycle state, and readable
call-evidence integration with #2506 is still required.
Readable call-evidence integration with #2506 is validated on the combined implementation; response overflow
retains possible billing in both lifecycle state and the production JSONL stream.
See [Gateway evidence validation](EVIDENCE_VALIDATION.md) for the combined commit, platform, commands and limits.

## Source and environment
## Capacity-only source and environment

- Base: upstream master `24e0017e` (includes the shared managed-call lifecycle from #2499).
- Implementation: local branch `codex/issue-2464-capacity-budgets`, working tree based on that commit.
- Validation date: 2026-11-06, macOS / Darwin arm64, Rust/Cargo 1.95.0, Python 3.13.15.
- Related open work inspected: #2457 (protection modes), #2470 (native protocol behavior), #2429 (output defaults),
and #2506 (bounded call evidence). Their unmerged implementation is not included in this branch.

## Executed checks
## Capacity-only checks

Run from the repository root with Cargo 1.95.0 available on PATH:

Expand Down Expand Up @@ -58,9 +59,9 @@ or cryptographic bindings.

The executor regressions check prepared-context replay and the lifecycle observation on response overflow:
`PossiblySent` plus `Withheld`, with one provider attempt. This preserves possible billing in process-local
state without claiming complete response receipt. It does not produce a readable `record_call` export in this branch.
The production `BufferedEvidenceSink` has no operator-facing call stream, and these tests do not satisfy the
G5-A requirement that possible billing appear in readable call evidence.
state without claiming complete response receipt. The combined implementation also checks the same facts against
readable call/attempt records, including degraded passthrough and partial-response status/first-byte timing.
Production uses the bounded `JsonEvidenceSink`; `BufferedEvidenceSink` is retained for tests/demos.
The Python suites exercise the real Core runtime and ASGI authorization paths;
they are not evidence of spawned Core or real-provider acceptance through the new gateway.

Expand All @@ -70,11 +71,15 @@ isolate transport buffering; they do not establish that real Core accepts such r

## Remaining issue acceptance

G5-A still requires integration with the bounded call-evidence exporter in #2506. A real gateway-process
regression must read the exported record for a response-buffer overflow and assert one attempt,
`Withheld` terminal, `PossiblySent` sending facts and unknown usage, without content or credentials.
Until that integration is executed, G5-A must not be described as fully accepted. The capacity changes
can be reviewed independently, with the evidence dependency stated in the PR.
The combined implementation at `b1f03eb59cc9327e9c1e8ad3df60a2fbcf914713` includes master
`b8b189091e7a412300cf1292531208a8ead0e325`. On 2026-11-07, the Gateway workspace reported 185 passing
cases, including the capacity and evidence subprocess tests; four live-Core cases returned early, so 181
behavior tests exercised their assertions. Fmt, clippy, repository checks and the documentation build passed.
The real Gateway process regression reads exported JSONL for fixed-length and chunked response-buffer overflow:
one `buffer_limit_exceeded` attempt, `withheld` terminal, `possibly_sent`, unknown usage, retained observed
status/first-byte timing, no content or credentials, no delivery prefix and no resend. This satisfies the
G5-A readable-evidence integration requirement with local controlled Core/provider HTTP fixtures; it does not
establish real Core, paid provider or native host acceptance.

G5-B remains open: output-capacity discovery where required; global and local retained-byte accounting for request,
response, replay/SSE and applicable evidence owners; accounting through final owner drop; mixed-size load/RSS
Expand Down
1 change: 1 addition & 0 deletions gateway/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading