Skip to content

refactor(work-items): dispatcher should export the resolved binding path to adapters #852

Closed as not planned

Description

@kyle-sexton

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:

  1. 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.

  2. 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.

Activity

  1. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Jul 23, 2026
  2. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane, gate-audit pass — cycle 2 retry, instance melo-lap-001-triage-20260727T125559Z).

    Gate-audit verdict: STAYS GATED. A fresh independent second lens flagged this as cross-cutting: the fix reshapes the dispatcher→adapter subprocess contract and strips binding.sh down to "only the truly cross-provider contract," migrating validation into each adapter — a shared-seam shape change across every current and future adapter. Per this lane's floor-override convention, a dissenting cross-cutting concern keeps the gate shut even though fable and this lane's own read leaned LIFT.

    Decision needed — RECOMMENDED: maintainer confirms the WIT_BINDING_PATH export + binding.sh slim-down shape before an agent touches the shared seam and every adapter. Alternative: defer until a third adapter provider makes the current leak costlier to ignore.

    Consensus: fable-lens panel (LIFT) + this lane's own read (LIFT) + independent fresh-context second lens (GATE, cross-cutting). Floor-override applied — labels unchanged (needs-human stays). This lane triages/gate-audits only.

  3. kyle-sexton commented on Aug 13, 2026

    @kyle-sexton
    MemberAuthor

    Frontier disposition (drain session)

    Ruling: promoted to agent-ready. Exporting the resolved binding path from the dispatcher to adapter subprocesses is a one-variable seam extension alongside the existing WIT_* exports, unblocking provider-specific config reads without changing any adapter contract.

  4. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Aug 13, 2026
  5. kyle-sexton commented on Aug 13, 2026

    @kyle-sexton
    MemberAuthor

    Frontier disposition (drain session)

    Ruling: Close as not planned for this drain wave.

    Issue remains historically valuable but is either advisory, blocked on a larger carrier, or superseded by later conventions. Re-open with a concrete acceptance brief if a consumer needs the work this session.

    Title: refactor(work-items): dispatcher should export the resolved binding path to adapters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions