Context
Surfaced while implementing the Jira adapter (#379).
Problem
The work-item-tracker core dispatcher (work-item-tracker.sh) resolves and reads the binding (.work-item-tracker.json), then runs each adapter verb as a fresh bash <verb>.sh subprocess. Only a fixed set of vars crosses that boundary (exported by lib/binding.sh: WIT_PROVIDER, WIT_LEASE_TTL_HOURS, WIT_STORAGE_DIR, WIT_HUMAN_GATED_LABEL). Provider-specific config beyond those is NOT exposed.
Two consequences of this shape:
-
lib/binding.sh carries a provider-specific leak. config.storage_dir is parsed and validated in the shared binding lib solely for local-markdown. Adding a second such key per provider (the Jira adapter needs config.jira.{site,project_keys,auth_email,auth_env,...}) would grow that leak — the shared seam lib accreting knowledge of each provider's private config schema.
-
Adapters must re-resolve the binding to read their own config. The Jira adapter deliberately does NOT grow binding.sh; instead its common.sh sources lib/binding.sh and calls wit_find_binding a second time to jq its config.jira subtree. This works (the climb is deterministic and WORK_ITEM_TRACKER_BINDING is honored), but it re-does the discovery the dispatcher already performed.
Proposed fix
Have the dispatcher export the resolved binding path (e.g. WIT_BINDING_PATH) so an adapter reads its own provider-specific config.<provider> subtree directly, without re-running discovery — and without the shared binding.sh needing to know any provider's private config keys. binding.sh keeps only the truly cross-provider contract (schema_version, provider, lease_ttl_hours); storage_dir validation migrates into the local-markdown adapter, paralleling how jira validates config.jira in its own adapter.
Evidence
tools/work-item-tracker/lib/binding.sh — wit_read_binding special-cases local-markdown's config.storage_dir.
tools/work-item-tracker/work-item-tracker.sh — dispatches adapter verbs as bash <verb>.sh subprocesses; exports the binding-derived vars but not the binding path.
tools/work-item-tracker/adapters/jira/common.sh — wit_need_jira_config re-locates the binding via wit_find_binding to read config.jira.
Not blocking the Jira adapter (the re-resolve is clean); filing as the scoped structural follow-up.
Context
Surfaced while implementing the Jira adapter (#379).
Problem
The work-item-tracker core dispatcher (
work-item-tracker.sh) resolves and reads the binding (.work-item-tracker.json), then runs each adapter verb as a freshbash <verb>.shsubprocess. Only a fixed set of vars crosses that boundary (exported bylib/binding.sh:WIT_PROVIDER,WIT_LEASE_TTL_HOURS,WIT_STORAGE_DIR,WIT_HUMAN_GATED_LABEL). Provider-specificconfigbeyond those is NOT exposed.Two consequences of this shape:
lib/binding.shcarries a provider-specific leak.config.storage_diris parsed and validated in the shared binding lib solely forlocal-markdown. Adding a second such key per provider (the Jira adapter needsconfig.jira.{site,project_keys,auth_email,auth_env,...}) would grow that leak — the shared seam lib accreting knowledge of each provider's private config schema.Adapters must re-resolve the binding to read their own config. The Jira adapter deliberately does NOT grow
binding.sh; instead itscommon.shsourceslib/binding.shand callswit_find_bindinga second time tojqitsconfig.jirasubtree. This works (the climb is deterministic andWORK_ITEM_TRACKER_BINDINGis honored), but it re-does the discovery the dispatcher already performed.Proposed fix
Have the dispatcher export the resolved binding path (e.g.
WIT_BINDING_PATH) so an adapter reads its own provider-specificconfig.<provider>subtree directly, without re-running discovery — and without the sharedbinding.shneeding to know any provider's private config keys.binding.shkeeps only the truly cross-provider contract (schema_version,provider,lease_ttl_hours);storage_dirvalidation migrates into thelocal-markdownadapter, paralleling howjiravalidatesconfig.jirain its own adapter.Evidence
tools/work-item-tracker/lib/binding.sh—wit_read_bindingspecial-caseslocal-markdown'sconfig.storage_dir.tools/work-item-tracker/work-item-tracker.sh— dispatches adapter verbs asbash <verb>.shsubprocesses; exports the binding-derived vars but not the binding path.tools/work-item-tracker/adapters/jira/common.sh—wit_need_jira_configre-locates the binding viawit_find_bindingto readconfig.jira.Not blocking the Jira adapter (the re-resolve is clean); filing as the scoped structural follow-up.