Skip to content

0178: A tracker issue is created with its fields in one call

  • Implementation built

Context and Problem Statement

Tracker.create (0141) takes a project, title, body, reporter and labels. A tracker that holds more fields (for Beads: type, priority, acceptance criteria and metadata) can only get them through a second write after the create, so the issue exists for a while without them, and stays that way if the second write fails. A tracker plugin that files issues under a schema needs them written together. How does the contract carry them without breaking the adapters that were written before?

Decision Drivers

  • An issue never exists without the fields its caller gave.
  • Adapters already shipped keep conforming and keep working (0026).
  • Nothing a caller gave is dropped silently.
  • Core stays generic: it knows no tracker's field names.

Considered Options

  • An optional keyword-only fields on create, declared as grown (chosen)
  • A new optional method create_with_fields (0160 style): a second name for the same write, and callers must choose between two.
  • A second write after the create: the gap this record closes.

Decision Outcome

Chosen option: create(..., *, fields: Mapping[str, str] | None = None), because it is one call and an adapter that predates it needs no change.

  • fields maps the tracker's own field names to text. An adapter writes them in the same create and refuses one it can't write.
  • Capability.grown lists, per method, the keyword-only parameters with a default that it gained after adapters shipped; the tracker declares {"create": {"fields"}}. Only a declared keyword counts, so existing keyword-only parameters, such as those of Chat.ask_self, stay required in an adapter.
  • An adapter whose method leaves a grown keyword out still conforms (hz_conformance, assert_adapter). A call through a handle that passes the default (None) reaches it without the keyword. A call that passes a value is refused with NotSupportedError ("it takes no fields"), never dropped.
  • A caller that must work with an older Core checks the parameter in inspect.signature(Tracker.create).
  • A process that still holds an older Tracker after a wheel swap registers the capability without the growth its protocol lacks.

Consequences

  • Good: a schema-aware tracker plugin writes a complete issue at once; the Beads adapter of the Issues plugin is the first one.
  • Good: the GitHub, Atlassian and Issues adapters keep conforming unchanged.
  • Bad: field names are the tracker's own, so a caller that sets fields knows which tracker it talks to.

Confirmation

The tracker integration tests fail when fields don't reach the adapter in the create, when an older adapter gets None passed through, or when it isn't refused a value. The conformance and testing tests fail when an adapter that leaves out a grown keyword fails, or one that changes its default passes. The capability tests fail when a grown keyword isn't keyword-only with a default, or when any method but tracker.create grows.