Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ecd5dc1
fix: redact IPs from public logs and stop exposing database hosts
adibarra Nov 11, 2026
d9c8eb2
chore: tidy log sanitization docs and fixtures
adibarra Nov 11, 2026
106538d
Merge remote-tracking branch 'origin/main' into fix/redact-public-logs
adibarra Nov 12, 2026
285e855
refactor: simplify log sanitization
adibarra Nov 12, 2026
9963b29
Merge remote-tracking branch 'origin/main' into fix/redact-public-logs
adibarra Nov 12, 2026
abb9267
feat: extend log sanitization to promoted runs
adibarra Nov 12, 2026
bc8a204
fix: harden log sanitization
adibarra Nov 12, 2026
37c1e35
Merge remote-tracking branch 'origin/main' into fix/redact-public-logs
adibarra Nov 17, 2026
a52fa59
Merge origin/main into fix/redact-public-logs
adibarra Nov 24, 2026
27d7929
Catch JWTs, keep pip versions, test the log backfill on the real driver
adibarra Nov 24, 2026
cd228ea
Redact email addresses in stored logs
adibarra Nov 24, 2026
4a17f01
Catch tokens after colour codes and escapes, and more secret formats
adibarra Nov 24, 2026
dc11390
Strip private repo names in every form, and authenticate visibility r…
adibarra Nov 24, 2026
42068f2
Sanitize trace server-metric endpoint URLs, ids and engine labels
adibarra Nov 24, 2026
acbd0c0
Restore the agentic backfill manifest database check with a host hash
adibarra Nov 24, 2026
8cdf4af
Make the log backfill race-safe, recoverable and downstream-aware
adibarra Nov 24, 2026
b6834c9
Document log sanitization coverage, caches and copies
adibarra Nov 24, 2026
2cbc2b0
Widen escape boundaries and secret keys, and keep only real package rows
adibarra Nov 24, 2026
757c9b4
Fingerprint the manifest database by host and database name
adibarra Nov 24, 2026
ed7e994
Fail backfills loudly, verify redacted blocks, and recover cleared repos
adibarra Nov 24, 2026
4bae660
Document the widened rules, exit codes and URL-map lookups
adibarra Nov 24, 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
2 changes: 1 addition & 1 deletion .github/workflows/ingest-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:
echo "::error::Resolved database host does not belong to the requested child branch"
exit 1
fi
echo "Verified child database: $NEON_BRANCH_NAME ($branch_id), host $database_host"
echo "Verified child database: $NEON_BRANCH_NAME ($branch_id)"
cache_invalidate_url="${PREVIEW_SITE_URL%/}/api/v1/invalidate"
cache_invalidate_secret="$INVALIDATE_SECRET_DEFAULT"
protection_bypass_secret="$PROTECTION_BYPASS_SECRET_STAGING"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/recompute-agentic-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ jobs:
'.endpoints[] | select(.branch_id == $branch and .host == $host)' <<<"$endpoints" >/dev/null
{
echo "Child database: $NEON_BRANCH_NAME ($branch_id)"
echo "Host: $database_host"
echo "Expires: $(jq -r '.expires_at' <<<"$branch")"
} | tee -a "$GITHUB_STEP_SUMMARY"
elif [ "$GITHUB_REF" != "refs/heads/$DEFAULT_BRANCH" ]; then
Expand Down
3 changes: 2 additions & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"packages/app/cypress/fixtures/api/collectivex-run-*.json",
"packages/app/cypress/fixtures/api/collectivex-runs.json",
"packages/app/src/lib/power/power-model.parity.json",
"packages/app/src/components/video-benchmark/fixtures/native-serving-bundle/"
"packages/app/src/components/video-benchmark/fixtures/native-serving-bundle/",
"packages/db/src/etl/log-redaction.vectors.json"
]
}
71 changes: 71 additions & 0 deletions docs/data-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,77 @@ once on N connections; each file is its own transaction, so an interrupted run r
Point `DATABASE_WRITE_URL` at the direct endpoint (no `-pooler` in the host): the pooler closed
connections at 16 and above. Each connection holds up to about 1 GB while it compacts a large file.

#### Log sanitization

Ingest and `sync-public-db` sanitize server-log text with `etl/log-redaction.ts`, and
`sync-public-db` also sanitizes runs from repositories that are not public. The rules replace
these with `***REDACTED***`:

- access tokens: `hf_`, GitHub, AWS `AKIA`/`ASIA` key IDs, Slack, `sk-` and `nvapi-` API keys, and
JWTs;
- `Authorization: Bearer|Basic|Token` values, and a bare `Bearer` with a long token unless it is a
slash path without digits (`bearer src/auth/…`);
- values of upper-case `*_TOKEN`, `*_API_KEY`, `*_SECRET`, `*_ACCESS_KEY` and `*_PASSWORD`
assignments, also with JSON-escaped quotes (`\"MY_SECRET_TOKEN\":\"…\"`), unless the value is a
placeholder (`$VAR`, `<…>`, `***`, a number, `none`…);
- values of lower-case `*_token`, `*api_key`, `*_secret` and `*_password` assignments and of
`--*-token`, `--api-key`, `--*-secret` and `--*-password` flags, when the value mixes letters
and digits (so `initial-cluster-token: etcd-cluster` and `bytes_per_full_token=13125.54` stay);
- URL passwords, with any scheme case and JSON-escaped `:\/\/`;
- email addresses with a public TLD;
- public IPv4 and IPv6 addresses and `*.oraclevcn.com` host suffixes.

Tokens are found after ANSI CSI sequences (colour `\x1b[0m`, erase `\x1b[2K`, cursor `\x1b[1A`),
their escaped spellings (`\x1b[`, `\u001b[`, `\033[`) and escaped `\n`, `\r` or `\t` too. Private,
loopback, link-local and CGNAT addresses, internal node names, short usernames such as `/home/cam`,
`user@host` without a TLD or with an internal one (`.internal`, `.local`, `.lan`), scp-style
remotes (`git@github.com:org/repo`), URL userinfo without a password, `q@k.transpose(…)`,
`pkg@1.2.3`, image digests, and package versions (`==9.19.0.56`, pip's `(9.19.0.56)`, and the
version column of `pip list`, `conda list` and torch's `[conda]` dump, when the package name has a
lower-case letter and no address-like word such as `addr`, `ip` or `node`) stay. For runs from a
repository that is not public, `owner/repo`, `owner%2Frepo` and the name with `-` or `_` in either
place are removed wherever no letter or digit continues them. The InferenceX uploader applies the
same rules, and both sides test against `etl/log-redaction.vectors.json`, so change the two
together. The patterns are ASCII-only; the Python port compiles with `re.ASCII` and needs the
`regex` module for the variable-length lookbehinds.

Trace-replay server metrics (`/api/v1/trace-server-metrics` and
`/api/v1/trace-server-metric-source`) apply the same rules to source endpoint URLs, source ids and
engine labels when `computeChartSeries` builds them. Every endpoint URL stored before this change
is private, so `CHART_SERIES_VERSION` stayed the same.

The log routes serve stored text as is and do not sanitize at read time. Rows stored before
this change stay exposed until the backfill runs.
`bun run admin:db:backfill-log-redaction` applies it to rows stored earlier in the public database
(point `DATABASE_WRITE_URL` at it). It is a dry run by default. `--write` applies it, `--run-id`
scopes it to one run, and `--concurrency N` sanitizes N files at once. Each file is its own
transaction under the file's advisory lock, which `compact-server-logs` also takes, and its
blocks are rebuilt from the sanitized text. So are blocks that no longer describe already-sanitized
text: a different character count gives them away, and for text holding `***REDACTED***` the
blocks are decoded and compared. Rerunning is safe because sanitized text is a fixed point. The
backfill exits 1 whenever a file failed, `--downstream` included.

Besides log text, it clears `workflow_runs.html_url` for runs from repositories that are not
public, once every file succeeded. Each cleared URL is first appended to an operator-only JSONL
file (`--url-map <path>`, default `~/.inferencex/redacted-run-urls/`, mode 600 even for an existing
file) whose path is printed; `sync-public-db` records the URLs it does not copy the same way. Keep
that file out of git and CI logs: it is the only record of those runs' repositories. Admin
backfills that read artifacts (`backfill-server-log-files`, `backfill-gpu-metrics`,
`backfill-runtime-metadata`) read every map in `~/.inferencex/redacted-run-urls/` and use a cleared
run's recorded repository; any other run without a URL falls back to `INGEST_REPO`, as before.
GitHub run IDs are unique across repositories, so a cleared run missing from the maps reads as not
found there rather than as another run. On a downstream deployment's own database, pass
`--downstream`: it applies the shared rules but keeps that deployment's private repository names
and run URLs, and never asks GitHub. Visibility checks use `GITHUB_TOKEN` when it is set.

After a write, purge the log cache with `bun run admin:cache:invalidate -- <app-url> --immediate`.
Log responses carry `s-maxage=31536000`, so the CDN keeps the old text until that purge; browsers
may keep it for up to an hour (`max-age=3600`). A downstream deployment that reads the public
database through `PUBLIC_DATABASE_READONLY_URL` caches log responses in its own CDN and blob
store and needs its own purge, and one that synced runs holds its own copies and needs its own
backfill. Neon child and preview branches created before the backfill, and point-in-time history,
keep the raw text.

### Agentic Dataset Provenance

AIPerf exports public-dataset provenance in `metadata.dataset`, including the Hugging Face dataset ID. InferenceX preserves that object as `dataset` on each agentic aggregate benchmark row. During benchmark ingest, `ingest-ci-run.ts` derives the dashboard slug from `hf_dataset_name` (for example, `semianalysisai/cc-traces-weka-062126` becomes `cc-traces-weka-062126`) and upserts `run_datasets` for the workflow run.
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scripts.
| `INFERENCEX_SOURCE_REPOS` | optional | Comma-separated `owner/repo` list searched after `SemiAnalysisAI/InferenceX` for unofficial-run overlays, live GPU metrics, live eval samples, and ETL workflow-run lookups. Entries are trimmed and deduplicated; a malformed entry is an error. |
| `VERCEL_PROTECTION_BYPASS_SECRET` | optional | Sent as `x-vercel-protection-bypass` by the cache invalidate and warmup scripts, the H3 media warmer, the PowerX publication verifier, and the CollectiveX ingest CLI's cache purge. |
| `INFERENCEX_APP_URL` | `warm-video-results.ts`, and `verify-power-publication.ts` without an origin argument | Origin for those two scripts. The verifier's origin argument wins when given. The cache scripts keep their localhost default. |
| `INGEST_REPO` | ingest, backfill, and artifact-preparation scripts when no argument or run URL names the repository | Repository for those scripts. `ingest-ci-run`, `ingest-operatorx`, and the backfills take a `[repo]` argument or a full run URL first. CI-mode `ingest-ci-run` and `prepare-ci-artifacts` always require it. |
| `INGEST_REPO` | ingest, backfill, and artifact-preparation scripts when no argument or run URL names the repository | Repository for those scripts. `ingest-ci-run`, `ingest-operatorx`, and the backfills take a `[repo]` argument or a full run URL first. CI-mode `ingest-ci-run` and `prepare-ci-artifacts` always require it. `backfill-server-log-files`, `backfill-gpu-metrics` and `backfill-runtime-metadata` first look up a run without `html_url` in the log-redaction URL maps (`~/.inferencex/redacted-run-urls/*.jsonl`). |
| `DATABASE_READONLY_URL` | yes, for the app | Read-only connection for the dashboard API routes. Read-only admin scripts and the MCP server use it too. |
| `PUBLIC_DATABASE_READONLY_URL` | optional, for a downstream deployment | Read-only connection to the public database. When set, the app shows public results next to its own: list reads combine both databases, and a log, trace, eval sample, or GPU telemetry with an id below 10^12 is read from the public one. See [Showing public results on a downstream deployment](#showing-public-results-on-a-downstream-deployment). |
| `DATABASE_DRIVER` | optional | `neon` (serverless HTTP) or `postgres` (TCP) for the app's database clients. When unset, hosts ending in `.neon.tech` use `neon` and all others use `postgres`. Admin scripts always use `postgres`. |
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"admin:db:backfill-full-response-interactivity": "bun run --cwd packages/db db:backfill-full-response-interactivity",
"admin:db:backfill-gpu-metrics": "bun run --cwd packages/db db:backfill-gpu-metrics",
"admin:db:backfill-gpu-sample-blobs": "bun run --cwd packages/db db:backfill-gpu-sample-blobs",
"admin:db:backfill-log-redaction": "bun run --cwd packages/db db:backfill-log-redaction",
"admin:db:backfill-power-series": "bun run --cwd packages/db db:backfill-power-series",
"admin:db:backfill-request-chart-data": "bun run --cwd packages/db db:backfill-request-chart-data",
"admin:db:backfill-sequence-length-sketches": "bun run --cwd packages/db db:backfill-sequence-length-sketches",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/lib/api/api-documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3366,8 +3366,8 @@ export const apiOperations: readonly ApiOperation[] = [
path: '/api/v1/trace-server-metrics',
summary: text('Read trace server metrics', '读取跟踪服务器指标'),
description: text(
'Returns point metadata, including prefill/decode TP, EP, DP attention, worker counts, physical GPU counts and recipe_fingerprint for cache-reuse links, and chart-ready aggregate time series for cache usage, queue depth, prefill and decode throughput, and prompt-token sources. metricSources contains source descriptors; source-specific arrays are loaded by the point-detail UI only when selected. TokenSpeed exports device KV utilization and running/waiting request gauges; unavailable cache-hit and token-throughput measurements remain empty. Disaggregated TRT-LLM aggregate prompt and cache-hit series exclude identified decode endpoints; per-source drilldowns retain their own measurements.',
'返回数据点元数据(含 prefill/decode TP、EP、DP attention、worker 数、物理 GPU 数及 recipe_fingerprint,用于缓存复用链接),以及可直接用于图表的聚合时间序列,涵盖缓存使用率、队列深度、prefill/decode 吞吐量和 prompt token 来源。metricSources 包含各来源的描述信息;仅当用户在数据点详情界面选择某个来源时,才会加载该来源对应的数组。TokenSpeed 提供设备 KV 使用率以及运行中和排队请求数;未提供的缓存命中率和 token 吞吐量指标保留为空。分离式 TRT-LLM 的聚合 prompt 和缓存命中率序列不计入已识别的 decode 端点;按来源查看时,仍保留各端点自身的测量值。',
'Returns point metadata, including prefill/decode TP, EP, DP attention, worker counts, physical GPU counts and recipe_fingerprint for cache-reuse links, and chart-ready aggregate time series for cache usage, queue depth, prefill and decode throughput, and prompt-token sources. metricSources contains source descriptors; source-specific arrays are loaded by the point-detail UI only when selected. TokenSpeed exports device KV utilization and running/waiting request gauges; unavailable cache-hit and token-throughput measurements remain empty. Disaggregated TRT-LLM aggregate prompt and cache-hit series exclude identified decode endpoints; per-source drilldowns retain their own measurements. Source endpoint URLs, source ids and engine labels are sanitized like server logs: public addresses read ***REDACTED***, and ids that would then collide gain a #2, #3 suffix.',
'返回数据点元数据(含 prefill/decode TP、EP、DP attention、worker 数、物理 GPU 数及 recipe_fingerprint,用于缓存复用链接),以及可直接用于图表的聚合时间序列,涵盖缓存使用率、队列深度、prefill/decode 吞吐量和 prompt token 来源。metricSources 包含各来源的描述信息;仅当用户在数据点详情界面选择某个来源时,才会加载该来源对应的数组。TokenSpeed 提供设备 KV 使用率以及运行中和排队请求数;未提供的缓存命中率和 token 吞吐量指标保留为空。分离式 TRT-LLM 的聚合 prompt 和缓存命中率序列不计入已识别的 decode 端点;按来源查看时,仍保留各端点自身的测量值。来源端点 URL、来源 ID 和引擎标签按服务器日志的规则脱敏:公网地址显示为 ***REDACTED***,脱敏后重复的 ID 会加上 #2、#3 后缀。',
),
audience: 'public',
stability: 'beta',
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/lib/api/api-route-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,10 @@ export const apiContractSourceDigests = [
},
{
source: '../db/src/etl/compute-chart-series.ts',
sourceSha256: 'ce00cbd168df883f1759cd7268726575d5effc3fe038a7f74d805df79072ab3a',
// Reviewed for log-style sanitization of served source ids, endpoint URLs and engine labels
// (documented on /api/v1/trace-server-metrics). Same CHART_SERIES_VERSION: every stored
// endpoint is private, so stored rows would not change.
sourceSha256: '17dd1c8cbfb966240fcc53aef43e34fc1df489dc634007fb9f898a87ebb52c58',
reviewArea: {
en: 'Server metric chart version, supported engine metrics, source identity, and missing-data semantics.',
zh: '服务器指标图表版本、支持的引擎指标、来源标识以及缺失数据语义。',
Expand Down
1 change: 1 addition & 0 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"db:backfill-dataset-stats": "bun --env-file=../../.env src/backfill-dataset-stats.ts",
"db:backfill-gpu-metrics": "bun --env-file=../../.env src/backfill-gpu-metrics.ts",
"db:backfill-gpu-sample-blobs": "bun --env-file=../../.env src/backfill-gpu-sample-blobs.ts",
"db:backfill-log-redaction": "bun --env-file=../../.env src/backfill-log-redaction.ts",
"db:backfill-power-series": "bun --env-file=../../.env src/backfill-power-series.ts",
"db:backfill-full-response-interactivity": "bun --env-file=../../.env src/backfill-full-response-interactivity.ts",
"db:backfill-request-chart-data": "bun --env-file=../../.env src/backfill-request-chart-data.ts",
Expand Down
8 changes: 5 additions & 3 deletions packages/db/src/backfill-gpu-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import {
collectMissingTelemetryExpectations,
type GpuMetricsArtifactPair,
} from './lib/gpu-metrics-backfill.js';
import { repositoryFromRunUrl } from './lib/runtime-metadata-artifacts.js';
import { loadRedactedRunUrls } from './lib/redacted-run-urls.js';
import { storedRunRepository } from './lib/runtime-metadata-artifacts.js';
import {
gpuMetricsRunCoverage,
type GpuMetricSeriesCoverageRow,
Expand Down Expand Up @@ -329,6 +330,7 @@ async function processPair(
}

async function main(): Promise<void> {
const redactedUrls = loadRedactedRunUrls();
const flags = parseFlags(process.argv.slice(2));
if (!flags.all && flags.run === null) {
throw new Error('Pass --run <github run id> or --all');
Expand All @@ -355,7 +357,7 @@ async function main(): Promise<void> {
let failedRuns = 0;
for (const run of runs) {
try {
const repository = repositoryFromRunUrl(run.html_url) ?? requireIngestRepo();
const repository = storedRunRepository(run, redactedUrls) ?? requireIngestRepo();
const artifacts = await listBackfillRunArtifacts(repository, run.github_run_id);
if (artifacts === null) {
goneRuns++;
Expand Down Expand Up @@ -407,7 +409,7 @@ async function main(): Promise<void> {

for (const [runIndex, run] of runs.entries()) {
const runId = run.github_run_id;
const repository = repositoryFromRunUrl(run.html_url) ?? requireIngestRepo();
const repository = storedRunRepository(run, redactedUrls) ?? requireIngestRepo();
const runStart = Date.now();
const manifest = flags.receipt === null ? null : readReceipt(flags.receipt, run);
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), `gpu-metrics-backfill-${runId}-`));
Expand Down
Loading
Loading