Files
yvgude--lean-ctx/docs/contracts/handoff-transfer-bundle-v1.md
T
wehub-resource-sync 26382a7ac6
CI / Clippy (push) Failing after 15m13s
CI / Test (ubuntu-latest) (push) Failing after 16m1s
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Build (no embeddings / no ORT) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Cookbook (Node) (push) Has been cancelled
CI / Pi Extension (Node) (push) Has been cancelled
CI / Rust SDK (lean-ctx-client) (push) Has been cancelled
CI / Embed SDK (lean-ctx-sdk) (push) Has been cancelled
CI / Python SDK (leanctx) (push) Has been cancelled
CI / Hermes Plugin (Python) (push) Has been cancelled
CI / SDK Conformance Matrix (push) Has been cancelled
CI / Coverage (push) Has been cancelled
CI / cargo-deny (push) Has been cancelled
CI / Adversarial Safety (push) Has been cancelled
CI / Benchmarks (push) Has been cancelled
CI / Output-Quality Gate (eval A/B) (push) Has been cancelled
CI / Documentation (push) Has been cancelled
CI / CI Green (push) Has been cancelled
JetBrains Plugin / Actionlint (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (rust) (push) Has been cancelled
JetBrains Plugin / Validation (push) Has been cancelled
JetBrains Plugin / Build (push) Has been cancelled
JetBrains Plugin / Test (push) Has been cancelled
Security Check / Security Scan (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:35:30 +08:00

2.7 KiB
Raw Blame History

Handoff Transfer Bundle v1 (HandoffTransferBundleV1)

GitLab: #2320 (Subtickets: #2347#2351)

Das Handoff Transfer Bundle ist ein portables, versioniertes Export/ImportFormat für Handoffs über Tools/Teams/Transportflächen hinweg. Es ergänzt HandoffLedgerV1 um projektgebundene Identität, boundedness und privacyaware Export (redactedbydefault), plus eine Artefakt‑Übersicht für Replayability.

Ziele

  • Deterministisch: gleicher Zustand ⇒ gleiches Bundle (bis auf exported_at).
  • Bounded: klare Caps (Bytes/Counts) verhindern „unendlich große“ Handoffs.
  • Redacted-by-default: Export ist standardmäßig privacy-safe; full nur für admin.
  • Portable: Bundle ist eine einzelne JSON Datei; Import ist additiv (kein Overwrite von lokalen Indizes/Caches).
  • Replayability: enthält project identity hashes + Artefakt‑Übersicht (Proofs).

Format (JSON)

Top-level Felder:

  • schema_version: 1
  • exported_at: RFC3339 timestamp
  • privacy: "redacted" | "full"
  • project:
    • project_root_hash: best-effort hash des Project Roots
    • project_identity_hash: best-effort hash der Project Identity
  • ledger: HandoffLedgerV1 (ggf. redacted)
  • artifacts:
    • resolved: Liste konfigurierte ContextArtifacts (.lean-ctx-artifacts.json etc.)
    • proof_files: Liste .lean-ctx/proofs/* (basename + md5 + bytes), bounded
    • warnings: warnings beim artifact resolve/listing

Privacy Levels

  • privacy="redacted" (default):
    • ledger.project_root wird entfernt
    • ledger.session_snapshot wird entfernt
    • freie Textfelder (Task/Findings/Decisions/Next steps, Knowledge values, curated ref contents) werden über redaction::redact_text gejailt
  • privacy="full":
    • nur erlaubt für Role admin
    • wenn Redaction für admin aktiv ist, bleibt Redaction konsistent aktiv

Import Semantik

  • Import validiert schema_version (hart).
  • Project identity mismatch wird als WARN reportet (Import bleibt möglich).
  • Import ist additiv:
    • optional: workflow anwenden
    • optional: session excerpt anwenden
    • optional: knowledge facts importieren (policyaware)
  • Non-goal: kein Overwrite bestehender lokaler Indizes/Caches.

Surface

Tool:

  • ctx_handoff action=export format=json|summary write=true|false path=<optional> privacy=redacted|full
  • ctx_handoff action=import path=<bundle.json> apply_workflow=true|false apply_session=true|false apply_knowledge=true|false

Relevanter Code

  • Bundle contract/runtime: rust/src/core/handoff_transfer_bundle.rs
  • Ledger: rust/src/core/handoff_ledger.rs
  • Tool surface: rust/src/server/dispatch/session_tools.rs + rust/src/tool_defs/granular.rs + rust/src/tools/ctx_handoff.rs