Skip to content

work-items: define how consumer-local / shadowed adapters resolve the shared seam lib/ #369

Description

@kyle-sexton

Follow-up from #224 (bundle work-item-tracker seam, shape A). This is the DESIGN half of the P1 surfaced in #224 re-review; the silent-corruption half was already fixed in-PR (commit 9b8ed32 — adapters now hard-fail with exit 3 on a missing required seam lib instead of emitting an empty-id record). This issue tracks the remaining resolver-contract design decision.

Problem

The two-rule resolver #224 introduces supports a consumer shadowing a bundled adapter with a local copy at ${CLAUDE_PROJECT_DIR}/tools/work-item-tracker/adapters/<provider>/ (CONTRACT.md "Adapter resolution"). But each adapter's common.sh sources the shared seam libs relative to the adapter's own directory:

source "$WIT_<X>_ADAPTER_DIR/../../lib/id.sh"   # id / json / lease

When the adapter is the bundled copy, ../../lib is the seam's own lib/ (present). When the adapter is a consumer-local shadow, ../../lib points at a consumer path that has no lib/ — so a shadowed adapter cannot resolve the shared seam libs. This applies to the github and local-markdown adapters identically.

As of 9b8ed32 this now hard-fails cleanly (exit 3 + diagnostic) rather than corrupting the store, but a shadowed adapter still cannot actually run.

Decision needed

How should a shadowed consumer-local adapter resolve the shared seam lib/? Candidates:

  1. Seam-root resolution — the dispatcher exports its own seam root (it already knows $SCRIPT_DIR), and adapters source lib/ from that root rather than relative to their own dir. Lets a shadow reuse the bundled lib/ without copying it.
  2. Self-contained adapters — an adapter carries (or vendors) the lib helpers it needs, so a shadow is fully portable.
  3. Documented copy requirement — the contract states that shadowing an adapter also requires providing the seam lib/, and the hard-fail diagnostic points at that requirement.

Whichever is chosen, update CONTRACT.md "Adapter resolution", apply it to both bundled adapters, and add conformance/dispatcher coverage for the consumer-shadow path (the existing throwaway-fixture demo covers shadowing but not the lib-resolution edge).

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: mediumReal value, no hard deadline; normal backlog flow.wayfind: designWayfind decision item: design-space or domain-model decision; human in the loop.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions