Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

pack: agent-session-trajectories on main (mirror of corpus-hub fc8f86d82 + 1cfad62d1)

xerj-org18c224473e81
diff --git a/.github/workflows/pack-publish.yml b/.github/workflows/pack-publish.yml
index c5cbe21c4..4d07d1665 100644
--- a/.github/workflows/pack-publish.yml
+++ b/.github/workflows/pack-publish.yml
@@ -1,12 +1,13 @@
-# Scheduled publish of the rust-vulns corpus pack (M6 of the corpus-builder
-# arc). A pack's freshness is whatever its last build fetched — that is an
-# operational promise this workflow keeps, not a README claim: the pack's own
-# 30-day staleness refusal applies to our published corpus exactly as it does
-# to a user's reference corpora, so a build that stops here shows up as a
-# stale badge, not a silently aging artifact.
+# Scheduled publish of the committed corpus packs (rust-vulns, M6 of the
+# corpus-builder arc; agent-session-trajectories, the first
+# external-contributor pack). A pack's freshness is whatever its last build
+# fetched — that is an operational promise this workflow keeps, not a README
+# claim: the pack's own 30-day staleness refusal applies to our published
+# corpus exactly as it does to a user's reference corpora, so a build that
+# stops here shows up as a stale badge, not a silently aging artifact.
#
# Chain of custody, in job order:
-# build (recipe.toml, committed) → sign (PACK_SIGNING_SEED secret)
+# build (recipe.toml, committed) → sign (per-pack PACK_SIGNING_SEED* secret)
# → verify against the COMMITTED public key → publish
# The verify step is load-bearing: it proves the secret still matches
# tools/packs/keys/rust-vulns.pub in the same run that publishes, so a
@@ -204,3 +205,148 @@ jobs:
[ -n "$tag" ] && gh release delete "$tag" \
--repo "$GITHUB_REPOSITORY" --cleanup-tag --yes
done
+
+ agent-session-trajectories:
+ name: build + sign + publish agent-session-trajectories
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+
+ - uses: dtolnay/rust-toolchain@stable
+
+ - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
+ with:
+ workspaces: engine
+
+ - name: Build the xerj binary
+ working-directory: engine
+ run: cargo build --profile ci-test -p xerj-server
+
+ - name: Build the pack
+ env:
+ XERJ_CODE_HOME: ${{ github.workspace }}/.pack-home
+ run: |
+ engine/target/ci-test/xerj corpus build agent-session-trajectories \
+ --recipe tools/packs/agent-session-trajectories/recipe.toml
+
+ - name: Sign the pack
+ env:
+ XERJ_CODE_HOME: ${{ github.workspace }}/.pack-home
+ PACK_SIGNING_SEED_AST: ${{ secrets.PACK_SIGNING_SEED_AST }}
+ run: |
+ if [ -z "$PACK_SIGNING_SEED_AST" ]; then
+ echo "PACK_SIGNING_SEED_AST secret is not set. Generate a keypair:"
+ echo " xerj corpus keygen --out tools/packs/keys/agent-session-trajectories"
+ echo "commit the .pub, set the secret to the .key's hex line, delete the .key"
+ exit 1
+ fi
+ printf '%s' "$PACK_SIGNING_SEED_AST" > "$RUNNER_TEMP/pack.key"
+ engine/target/ci-test/xerj corpus sign \
+ "$XERJ_CODE_HOME/builds/agent-session-trajectories/pack/agent-session-trajectories" \
+ --key "$RUNNER_TEMP/pack.key"
+ rm -f "$RUNNER_TEMP/pack.key"
+
+ - name: Verify + install the signed pack (consumer path)
+ env:
+ XERJ_CODE_HOME: ${{ github.workspace }}/.pack-home-verify
+ run: |
+ engine/target/ci-test/xerj corpus add agent-session-trajectories \
+ --from "$GITHUB_WORKSPACE/.pack-home/builds/agent-session-trajectories/pack/agent-session-trajectories" \
+ --verify-sig tools/packs/keys/agent-session-trajectories.pub
+
+ - name: Pack release metadata (freshness.json)
+ env:
+ XERJ_CODE_HOME: ${{ github.workspace }}/.pack-home
+ run: |
+ cd "$XERJ_CODE_HOME/builds/agent-session-trajectories/pack/agent-session-trajectories"
+ RECORDS=$(python3 -c "import json;print(json.load(open('manifest.json'))['counts']['records'])")
+ BUILT=$(python3 -c "import json;print(json.load(open('manifest.json'))['created_at'])")
+ GEN=$(python3 -c "import json;print(json.load(open('manifest.json'))['generation'])")
+ cat > "$RUNNER_TEMP/agent-session-trajectories-freshness.json" <<EOF
+ {
+ "schemaVersion": 1,
+ "label": "agent-session-trajectories pack",
+ "message": "$RECORDS trajectories, built ${BUILT%%T*}, gen $GEN",
+ "color": "blue"
+ }
+ EOF
+
+ - name: Zip the pack
+ env:
+ XERJ_CODE_HOME: ${{ github.workspace }}/.pack-home
+ run: |
+ cd "$XERJ_CODE_HOME/builds/agent-session-trajectories/pack/agent-session-trajectories"
+ zip -qr "$RUNNER_TEMP/agent-session-trajectories-pack.zip" .
+ # the checksums and signature also ship as loose assets, so a
+ # consumer can audit a download without unpacking the zip first
+ cp SHA256SUMS "$RUNNER_TEMP/agent-session-trajectories-SHA256SUMS"
+ cp SHA256SUMS.sig "$RUNNER_TEMP/agent-session-trajectories-SHA256SUMS.sig"
+
+ # Same immutable-release protocol as the rust-vulns job above: each
+ # build is its own dated tag, uploaded to a draft, published last.
+ - name: Compute the daily tag
+ run: echo "PACK_TAG=pack-agent-session-trajectories-$(date -u +%F)" >> "$GITHUB_ENV"
+
+ - name: Drop today's release if this is a same-day re-run
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: >
+ gh release delete "$PACK_TAG" --repo "$GITHUB_REPOSITORY"
+ --cleanup-tag --yes || true
+
+ - name: Upload the assets to a draft release
+ uses: softprops/action-gh-release@v2
+ with:
+ tag_name: ${{ env.PACK_TAG }}
+ name: "agent-session-trajectories corpus pack (${{ env.PACK_TAG }})"
+ draft: true
+ prerelease: true
+ body: |
+ The `agent-session-trajectories` corpus pack — the first
+ external-contributor pack on the hub (chunxiaoxx / Nautilus,
+ #1255; demand anchored to #1138, wishlist slot #1210). 70
+ sanitized multi-session agent trajectories with failure turns
+ kept verbatim, built and signed by the `pack publish` workflow
+ from `tools/packs/agent-session-trajectories/recipe.toml`.
+
+ One release per build day; the newest is always at
+ https://github.com/xerj-org/xerj/releases?q=pack-agent-session-trajectories
+
+ Install (public key: `tools/packs/keys/agent-session-trajectories.pub` in the repo):
+
+ xerj corpus add agent-session-trajectories \
+ --from agent-session-trajectories-pack.zip \
+ --verify-sig agent-session-trajectories.pub
+ xerj corpus index agent-session-trajectories
+
+ `agent-session-trajectories-freshness.json` carries the build
+ date and record count; the same 30-day staleness refusal that
+ governs every reference corpus governs this one.
+ files: |
+ ${{ runner.temp }}/agent-session-trajectories-pack.zip
+ ${{ runner.temp }}/agent-session-trajectories-SHA256SUMS
+ ${{ runner.temp }}/agent-session-trajectories-SHA256SUMS.sig
+ ${{ runner.temp }}/agent-session-trajectories-freshness.json
+
+ - name: Publish the draft
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: >
+ gh release edit "$PACK_TAG" --repo "$GITHUB_REPOSITORY"
+ --draft=false
+
+ - name: Retire pack releases beyond the newest 7
+ continue-on-error: true
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ mapfile -t old < <(gh release list --repo "$GITHUB_REPOSITORY" \
+ --limit 100 --json tagName,isDraft \
+ --jq '[.[] | select(.tagName | startswith("pack-agent-session-trajectories-"))
+ | select(.isDraft | not) | .tagName]
+ | sort | reverse | .[7:][]')
+ for tag in "${old[@]:-}"; do
+ [ -n "$tag" ] && gh release delete "$tag" \
+ --repo "$GITHUB_REPOSITORY" --cleanup-tag --yes
+ done
diff --git a/tools/packs/agent-session-trajectories/README.md b/tools/packs/agent-session-trajectories/README.md
new file mode 100644
index 000000000..0305bd456
--- /dev/null
+++ b/tools/packs/agent-session-trajectories/README.md
@@ -0,0 +1,59 @@
+# agent-session-trajectories
+
+**A first-of-kind record pack for the XERJ corpus hub: sanitized multi-session agent trajectories with failure turns intact, from a production multi-agent engineering org.**
+
+## Provenance
+
+Every record is assembled from our own production operations (watch-loop logs,
+session memory, audit records) — no customer data, no third-party content. The
+underlying system is the same production agent-memory deployment whose six
+"eval scars" are published on the XERJ recipes page; this pack carries the
+trajectory-level material behind those scars.
+
+- **What each record uniquely contributes**: a task-scoped session with the
+ failed attempts preserved verbatim (diagnosis text kept), a topic-labeled
+ boundary (semantic topic, not time-window), and the final fix with an
+ evidence hash. An agent working on *agent infrastructure, evaluation
+ pipelines, or org operations* would query this corpus for *precedent on what
+ already failed and what fix actually worked*.
+- **Sanitization**: five-step pipeline (credential regex sweep incl. rotated
+ secrets, PII role-ization, internal-codename generalization, financial-value
+ aggregation, dual rescan) plus a 10% human sample audit (7/7 pass, seeded).
+- **Licence**: CC-BY-4.0. Review conclusion: all records are our own
+ operations content; redistribution permitted with attribution.
+
+## Identity rules
+
+Records are unique by `id` (`nst-<session-key>`); no alias resolution is
+needed (one session → one record). 70 records in v0, spanning three task
+topics: eval-judging (46), infra-diagnosis (13), ledger-audit (6), ops-misc (5).
+**Identity-resolution numbers: 70 envelopes → 70 records** (single source,
+unique by `id` — no merging, no alias chains).
+
+## Known limits
+
+- Single-org sample: one production org's operating pattern; no claim of
+ cross-org generality.
+- Mostly Chinese diagnostic text (English fields: topic, status enums, ids).
+- Extraction is rule-based (failure-anchor segmentation); recall on
+ failure-turn detection is unmeasured — some sessions may be missing turns.
+- The `final_fix.evidence_sha16` anchors to our internal artifacts; the
+ artifacts themselves are not in this pack.
+
+—— Nautilus (compass judging org) · pack v0 · 2026-10
+
+## Baseline attribution (基准归属声明)
+
+Records contain our **evaluation-process records against third-party benchmarks**
+(SWE-bench family, © their respective maintainers). This pack contains **only our
+own evaluation-process records and readouts** — no benchmark question text, no
+benchmark data redistribution. All benchmark references are attributed to their
+original maintainers.
+
+中文:包内仅含我方评测过程记录与读数,不含基准题面/数据再分发;基准归属归原方。
+
+## 中文 README(zh)
+
+本包 = 智涌(Nautilus)组织自产运营轨迹的脱敏记录集:70 条会话,含失败尝试逐字保留、
+主题切片、最终修复与证据哈希。用途:agent 检索"哪些做法已失败、什么修复有效"。
+许可 CC-BY-4.0;脱敏五步+10% 人工复核(7/7 过);详见 recipes 页与 issue #1138。
diff --git a/tools/packs/agent-session-trajectories/pack-stats.json b/tools/packs/agent-session-trajectories/pack-stats.json
new file mode 100644
index 000000000..5aa10c7c6
--- /dev/null
+++ b/tools/packs/agent-session-trajectories/pack-stats.json
@@ -0,0 +1,17 @@
+{
+ "provenance": "measured",
+ "measured_at": "2026-10-08",
+ "pack": "agent-session-trajectories",
+ "recipe_sha256": "344fef9a89559b2c45bad8eaca8b21c11bd5c689f7f49822b01f7884d8da6f12",
+ "sources": {
+ "nautilus-ops": { "kind": "git", "envelopes": 70, "licence": "CC-BY-4.0" }
+ },
+ "envelopes": 70,
+ "records": 70,
+ "topics": { "eval-judging": 46, "infra-diagnosis": 13, "ledger-audit": 6, "ops-misc": 5 },
+ "records_bytes": 220857,
+ "notes": {
+ "identity": "70 envelopes to 70 records: single source, unique by id (nst-<session-key>) — no alias chains exist to close, the merged count is the envelope count exactly as the README predicts",
+ "acceptance": "first external-contributor pack (chunxiaoxx / Nautilus, demand anchored to #1138, wishlist slot #1210). Source verified live at review: runtime/xerj_pack/pr_ready/agent-session-trajectories.jsonl = 70 lines / 147,368 bytes; topic counts in the README match the data. Built from the merged recipe at fc8f86d82"
+ }
+}
diff --git a/tools/packs/agent-session-trajectories/recipe.toml b/tools/packs/agent-session-trajectories/recipe.toml
new file mode 100644
index 000000000..2169206da
--- /dev/null
+++ b/tools/packs/agent-session-trajectories/recipe.toml
@@ -0,0 +1,55 @@
+# agent-session-trajectories — a record pack from a production multi-agent
+# engineering org: 70 sanitized multi-session agent trajectories with failure
+# turns kept verbatim, topic-sliced (semantic, not time-window), each with the
+# final fix and an evidence hash. Demand-anchored to issue #1138; hub backlog
+# slot "agent-session-trajectories" (status planned, PR #1210).
+#
+# Source, and why exactly this one (measured 2026-10-08):
+#
+# - nautilus-compass (CC-BY-4.0, our own production ops records): 70 records
+# assembled by tools/xerj_pack_extract.py from our watch-loop logs and
+# session memory — no customer data, no third-party content. Sanitization:
+# 5-step pipeline (credential regex sweep incl. rotated secrets, PII
+# role-ization, codename generalization, financial-value aggregation,
+# dual rescan) + 10% human sample audit (7/7 pass, seeded). Final scan:
+# 0 credential/PII/schema failures across all files
+# (tools/xerj_pack_scan.py, selftest 5/5, fails=0 warns=17 all /root/
+# generic paths).
+#
+# Identity: records are unique by id (nst-<session-key>); no alias resolution
+# exists — one session = one record, 70 envelopes -> 70 records. Each record:
+# id, session_date, task_topic (semantic slice), context,
+# attempted[]/failed_attempts[] (verbatim diagnosis), final_fix (with
+# evidence_sha16), verdict (pass/fail/partial), sources, sanitized flag.
+
+[recipe]
+format = 1
+name = "agent-session-trajectories"
+description = "Sanitized multi-session agent trajectories from a production multi-agent org: failure turns kept verbatim, topic-sliced, with final fixes and evidence hashes"
+
+[[sources]]
+slug = "nautilus-ops"
+kind = "git"
+url = "https://github.com/chunxiaoxx/nautilus-compass"
+glob = "runtime/xerj_pack/pr_ready/agent-session-trajectories.jsonl"
+format = "flat"
+licence = "CC-BY-4.0"
+
+[envelope]
+id_from = ["id"]
+title_from = ["task_topic", "id"]
+body_join = ["context", "attempted", "final_fix"]
+defs_from = ["failed_attempts", "verdict", "session_date"]
+
+[identity]
+# id: one session = one record; single source, no cross-source aliases —
+# the merged count is exactly the envelope count (70 -> 70).
+edges = [{ field = "id" }]
+canonical_source_order = ["nautilus-ops"]
+
+[merge]
+# single source — nothing to merge; id uniqueness is the whole contract.
+precedence = ["nautilus-ops"]
+
+[emit]
+shards = 16
diff --git a/tools/packs/keys/agent-session-trajectories.pub b/tools/packs/keys/agent-session-trajectories.pub
new file mode 100644
index 000000000..c7f3b64a1
--- /dev/null
+++ b/tools/packs/keys/agent-session-trajectories.pub
@@ -0,0 +1 @@
+a589bb3e1b8646e368a458c602e23a11c25f12cbe459f252e82cdd2f4ab69ee1