senkani_bundle
Budget-bounded repo snapshot — symbol outlines + dep graph + KB entities + README in a canonical, truncation-robust order. Local or remote.
Signature
Behavior
`BundleComposer` composes outputs within a fixed token budget. Sections order is canonical so partial truncation still produces a parseable brief. Local mode snapshots the current workspace; remote mode (`remote: "owner/name"`) uses `senkani_repo` to snapshot any public GitHub repo. Two output formats: `format: "markdown"` (default) or `format: "json"` (stable-schema `BundleDocument`).
Inputs
ContextManifest review surface (JSON) instead of the body. Items enumerate per-lane / per-mode plans + token estimates before any body is composed.slice / diff-only / summary as live modes — see the slice / diff params and the knowledge lane's summary_* inclusion reasons."<path>:<start>:<end>" (1-indexed inclusive lines). When combined with modes including slice, adds one file-lane manifest item carrying the resolved slice content. Path must resolve under projectRoot; traversal is rejected.git diff: unstaged, staged, branch:<ref>, or range:<a>..<b>. When combined with modes including diff-only, shells git diff and emits one diff-lane item per affected file; inclusion_reason carries the selector (e.g. diff_branch:main).SecretDetector hit (sensitivity: "flagged"), preview emission is refused unless this flag is true. Every override writes one chained bundle.secret.allow audit row in token_events; every preview call also writes one chained bundle.dispatch audit row. Refusal does not fire either row.Output
Markdown document or a `BundleDocument` JSON.
Example
{"tool":"senkani_bundle","args":{"budget_tokens":6000}}
Details
The composer fills sections in canonical order — readme → outlines → deps → kb — and stops once the budget is consumed, so a truncated bundle is still parseable from the top. Remote mode reuses senkani_repo's TTL+LRU cache, so repeated bundles of the same owner/name@ref are warm. format: "json" emits a stable-schema BundleDocument; the schema version travels in tool_schemas_version from senkani_version, so callers can pin compatibility.
preview: true refuses to emit when any item carries a SecretDetector hit unless allow_secrets: true is passed; every override writes a chained bundle.secret.allow audit row, every preview call writes a chained bundle.dispatch audit row — both rows participate in the T.5 chain and are verified by senkani doctor --verify-chain.See also
senkani_repo— Remote bundle's underlying GitHub access.senkani_search_webKnowledge base concept— What KB entities end up in the bundle.
Sources/Bundle/BundleComposer.swift