Compact
Renders a gh PR command and the file diff for a Compact mode lookup change against the customer's GitOps repo. Two modes: csv (default — edits compact-lookup.csv, hot-reloaded by the Reducer without restart) or js (replaces compact-object-global.js, triggers a pipeline restart). The tool renders; the agent decides which patterns to compact and passes the lists in.
Example
"PR to compact
payment_retry_gateway_timeout, hot-reload"gh pr create --repo acme/log10x-config --base main \ --title "compact: add payment_retry_gateway_timeout" \ --body "OPS-5123: spike on payment_retry; compact through end of incident."Diff to
pipelines/run/regulate/compact/compact-lookup.csv:Reducer hot-reloads the CSV on next gitops poll — no restart, no drops.
More to ask
- "PR adding 5 hot patterns to compact-lookup"
- "swap the compact predicate to gate on
tenx_user_service" - "remove
cart_validation_failedfrom the compact lookup"
Prerequisites
The Reporter deployed (so pattern keys exist) and the Reducer configured with GH_ENABLED=true, GH_REPO=<owner/name>, GH_TOKEN, and compactReducerLookupFile pointing at the same path. The Reducer plan emits the full env-var set under "GitOps — MCP-managed runtime config".
Tool schema (advanced)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
gitops_repo |
string | one of gitops_repo / snapshot_id |
— | Owner/name of the GitOps repo the reducer pod pulls config from (e.g., acme/log10x-config). Must match GH_REPO on the reducer pod. |
snapshot_id |
string | one of gitops_repo / snapshot_id |
— | ID returned by Discover env. When given, resolves gitops_repo and lookup_path from the running reducer pod's env vars. |
gitops_branch |
string | no | main |
Base branch for the PR. |
mode |
string | no | csv |
csv (per-pattern lookup, hot-reload) or js (predicate JS, pipeline restart). |
lookup_path |
string | no | pipelines/run/regulate/compact/compact-lookup.csv |
Repo-relative path to the lookup CSV (mode=csv). |
js_path |
string | no | pipelines/run/regulate/compact/compact-object-global.js |
Repo-relative path to the predicate JS file (mode=js). |
field_names |
string[] | no | [symbolMessage] |
TenXObject fields joined with _ to form each event's lookup key (must match the reducer's compactReducerFieldNames). |
compact |
string[] | no | — | (mode=csv) Field-set keys to ADD with true (compact via encode()). |
preserve |
string[] | no | — | (mode=csv) Field-set keys to ADD with false (preserve fullText). Use when compactReducerDefault: true. |
remove |
string[] | no | — | (mode=csv) Field-set keys to REMOVE from the lookup. |
current_csv |
string | no | — | (mode=csv) Existing CSV content. If omitted, the tool emits commands to fetch it before computing the diff. |
new_js |
string | yes when mode=js | — | Full replacement contents for compact-object-global.js. Must include the // @loader: tenx header, the @tenx/tenx import, and an export class CompactObject extends TenXObject declaration with a shouldEncode getter. |
current_js |
string | no | — | (mode=js) Existing JS contents — used for diff line counts in the output. |
reason |
string | no | — | Short rationale (1–2 lines) for the PR description. |
default_decision |
string | no | false |
(mode=csv) Current value of compactReducerDefault on the reducer pod. Informational; included in the PR description. |