Skip to content

chore: drop v0.2.0 deprecated APIs [skip-tag]#36

Merged
lIang70 merged 10 commits into
mainfrom
chore/drop-v0.2-deprecated
Apr 23, 2026
Merged

chore: drop v0.2.0 deprecated APIs [skip-tag]#36
lIang70 merged 10 commits into
mainfrom
chore/drop-v0.2-deprecated

Conversation

@lIang70

@lIang70 lIang70 commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the v0.1.x deprecation surface ahead of the v0.2.0 cut. All
items in this PR were either explicitly tagged // Deprecated: in
godoc, dead branches the audit surfaced, or zero-caller helpers whose
only consumers were their own unit tests.

Scope: 10 atomic commits, 29 files, +100 / −1,425 LoC.

87d2483 chore(event): drop v0.1.x legacy bus shims
5c0e3b4 chore(kanban): drop v0.1.x deprecated shims
c7c014a chore(graph): drop ValidateGraphDef wrapper
3a42fed chore(llm): drop GlobalDefaultProvider magic key + WithModelCaps alias
a2ccc92 chore(llm): drop NewFromConfig "caps" key + capsFromConfig helper
11c9482 chore(telemetry): drop deprecated log sink shortcuts
1954094 chore(sdkx/llm): clarify integration-test "caps" convention
900e879 chore(workflow): drop migrateVarsMessages dead branch
ecf4492 chore(kanban): drop unused TaskBoard context helpers
942b1ed chore(kanban): rename RestoreTaskBoard -> RestoreBoard

Per-commit summary

# Commit What it removes
1 event Whole sdk/event/deprecated.go + tests: LegacyMemoryBus, LegacyEventBus, LegacySubscription, LegacyWith* options
2 kanban shims Scheduler.SetKanban (auto-wired by WithScheduler), TaskBoard type alias, NewTaskBoard, WithEventBus (no-op)
3 graph compiler.ValidateGraphDef wrapper (callers use (*GraphDefinition).Validate() directly)
4 llm GlobalDefaultProvider magic-key constant + WithModelCaps alias; Resolver lookup order simplified
5 llm/factory capsFromConfig helper + NewFromConfig reading the config["caps"] sub-object
6 telemetry WithLogExporter, WithLogConsole, WithLogMinSeverity shortcuts; see breaking-change note below
7 sdkx/llm Clarifying godoc on the integration-test caps JSON convention (no behaviour change)
8 workflow migrateVarsMessages dead branch in Board.RestoreFrom (in-process callers never hit the migration path; persisted snapshots fail the type assertion since json.Unmarshal produces []any)
9 kanban ctx WithTaskBoard / TaskBoardFrom / ctxKeyTaskBoard — zero non-test callers, duplicated WithKanban / KanbanFrom
10 kanban rename RestoreTaskBoardRestoreBoard (aligns with NewBoard; no shim, zero external callers)

Breaking changes

  • telemetry.InitLog no longer implicitly enables console output.
    Callers that relied on the default sink must now pass
    WithLogProcessor(ConsoleProcessors(...)...) explicitly. With no
    processors supplied, InitLog installs a discardProcessor so
    otellog.Logger() is always non-nil but silent.
  • kanban.RestoreTaskBoard was renamed to kanban.RestoreBoard
    with no shim. Out-of-tree callers that persist KanbanCardModel rows
    must update the call site.
  • llm.NewFromConfig no longer reads a caps sub-object from its
    config map. Per-provider capability overrides must be supplied via
    the registered Capabilities returned by the provider factory.
  • The Legacy* event-bus shims, Scheduler.SetKanban, the
    TaskBoard/NewTaskBoard aliases, WithEventBus,
    ValidateGraphDef, GlobalDefaultProvider, WithModelCaps,
    WithLogExporter, WithLogConsole, and WithLogMinSeverity are all
    removed without replacement; migration paths were documented in the
    godoc on the deprecated symbols since v0.1.x.

Out of scope (deliberately deferred)

  • sdk/graph/node/schema_registry.go::NodeSchema.Deprecated bool
    a never-read frontend-contract field, not a code deprecation. Belongs
    in a future "NodeSchema field audit" PR after frontend usage is
    confirmed.
  • sdk/graph/node/schema*.go as a whole — actively consumed by
    sdk/knowledge/node.go::KnowledgeNodeSchema(),
    sdk/graph/node/scriptnode/jsnode.go::PortsForType and the builder
    agent's schema(action=node_usage) tool. Not deprecated.
  • sdk/speech packaging (split into a standalone module) — separate
    refactor.

Tag policy

Title carries [skip-tag] so auto-tag.yml does not cut a new tag for
this PR even though sdk/, sdkx/llm/ and bench/ files were
touched. The breaking changes above are expected to ship together with
the rest of the v0.2.0 cut under a single coordinated tag.

Test plan

  • make ci green locally (sdk / sdkx / bench / examples/voice-pipeline)
  • No external callers of any removed symbol in this monorepo
  • Each commit independently passes make ci
  • CI green on this PR

Made with Cursor

lIang70 added 10 commits April 24, 2026 00:06
deprecated.go was always intended as a single-commit removal target
(see its file-header comment) — every Legacy* symbol carried a v0.2.0
migration godoc since the new Bus/Envelope/MemoryBus surface landed.
With the v0.1.x window closed, do the planned `git rm` and clean up
sibling files that referenced the removed types in comments.

Removed:
- sdk/event/deprecated.go (LegacyMemoryBus, LegacyEventBus, Event,
  EventType, EventFilter, LegacySubscription, LegacyWithBufferSize,
  LegacyWithDropCallback, LegacyMemoryBusOption, LegacyNoopBus + all
  EventGraphStart/EventNodeStart/... constants)
- sdk/event/deprecated_test.go (matching pin tests)

Updated comments to drop dangling references in bus.go (file-layout
header), observer.go, envelope.go, memory.go, kanban/board.go.

No external consumers (sdkx, examples, bench) reference any Legacy*
symbol — verified by grep before deletion.

Made-with: Cursor
Three deprecated symbols all scheduled for v0.2.0 removal, dropped
together since they target the same call sites:

- Scheduler.SetKanban — superseded by WithScheduler, which already
  performs the back-wiring inside kanban.New (see kanban.go: the
  k.scheduler.kanban = k assignment after the option loop). All three
  in-tree callers in tools_test.go were redundant double-wires.

- TaskBoard alias + NewTaskBoard constructor — Board / NewBoard have
  been the canonical names since the kanban split. Migrated the last
  in-tree callers (board_test.go, tools_test.go) to the new spellings.

- WithEventBus(event.Bus) Option — was already a no-op since Board.Bus()
  became the single source of truth for kanban events. Drop the option
  and its dedicated pin test (TestKanban_WithEventBus_DeprecatedNoOp).

Also removed the now-unused event import from kanban_test.go.

Out of scope: RestoreTaskBoard / WithTaskBoard / TaskBoardFrom /
ctxKeyTaskBoard — these are live (non-deprecated) public APIs that
happen to share the "TaskBoard" prefix; they will be renamed in a
separate, non-breaking pass if desired.

Made-with: Cursor
ValidateGraphDef was a one-line wrapper around (*GraphDefinition).Validate()
kept around to avoid an immediate call-site sweep when validation moved
into the graph package. With the v0.2.0 cleanup all in-tree callers
(compiler_test.go) are migrated to def.Validate() directly.

No external consumers reference this symbol — verified by grep across
sdk, sdkx, examples, bench.

Made-with: Cursor
Two deprecated symbols in sdk/llm/resolver.go cleared together since
both have stable replacements that have shipped for the full v0.1.x
deprecation window.

- GlobalDefaultProvider ("__global_default__") + the matching fallback
  branch in defaultResolver.resolveDefaultModel: superseded by the
  DefaultModelStore interface, which any store can implement directly
  without piggybacking on a magic ProviderConfig row. The fallback
  chain is now a clean two-step: DefaultModelStore -> WithFallbackModel.

- WithModelCaps: was a one-line alias for WithExtraCaps.

Test-side cleanup:

- Drop TestResolver_LegacyMagicKey_DynamicDefault and
  TestResolver_LegacyMagicKey_OverridesFallback — both pinned the
  removed fallback branch.
- Drop TestResolver_DefaultModelStore_PreferredOverLegacyMagicKey —
  the "preferred over legacy" assertion is moot once the legacy path
  is gone; DefaultModelStore-vs-WithFallbackModel ordering is still
  covered by TestResolver_DefaultModelStore_FallsBackToWithFallback.
- TestResolver_ExplicitModel_OverridesDefault keeps its intent (an
  explicit "prov/model" string must beat any default lookup) but is
  rewritten to seed a WithFallbackModel pointer rather than the
  legacy magic-key row.

No external callers reference either symbol — verified by grep.

Made-with: Cursor
The untyped config["caps"] sub-object was a v0.1.x carry-over for
configs that stuffed caps into the same JSON blob as api_key/base_url.
The typed pipeline (ProviderConfig.Caps + ModelConfig.Caps + the
registry catalog) has been the canonical source since DefaultResolver
landed, so retire the legacy path together:

- factory.go: NewFromConfig now wraps with registryCaps only; the
  per-call merge with capsFromConfig(config) is gone, and the helper
  itself is deleted (both the structured and the older flat forms).
- resolver.go: drop the corresponding "(3) Legacy Config[caps]" layer
  from the caps-merge chain in createLLM. Order is now strictly
  (registry catalog) -> (ProviderConfig.Caps) -> (ModelConfig.Caps)
  -> (WithExtraCaps).
- factory_test.go: drop the four TestCapsFromConfig_* cases that
  pinned the helper's behaviour.

sdkx/llm/provider_integration_test.go still parses a "caps"
sub-object out of its own env-var JSON to decide whether to skip
unsupported scenarios (e.g. no_temperature) — that is purely
test-side dispatching and never reaches the SDK; left untouched.

Made-with: Cursor
Remove the three v0.1.x convenience options that bolted sink
configuration onto InitLog from the side. The canonical
WithLogProcessor path covers every use case explicitly:

- WithLogExporter(sdklog.Exporter) — covering single-exporter slot
  with hard-coded BatchProcessor wrap. Replaced by
  WithLogProcessor(sdklog.NewBatchProcessor(exp)) at the call site,
  which makes batching policy / severity gating explicit.

- WithLogConsole(bool) — toggle for the implicit default console sink.
  Drop the implicit sink entirely; if no processor is supplied InitLog
  installs a discardProcessor (still safe for global Info/Warn/etc.)
  but emits nothing. Callers that want stdout/stderr output now must
  pass WithLogProcessor(ConsoleProcessors(...)...) — this is the
  forward-compatible recipe that has been documented for the full
  v0.1.x cycle.

- WithLogMinSeverity(otellog.Severity) — only ever affected the two
  shortcuts above. With them gone, severity gating is the processor's
  job (NewSeverityFilter when needed); the option has no remaining
  surface to bind to.

logOptions struct shrinks to {processors, serviceName, serviceVersion}.
InitLog godoc updated to describe the simpler, single-path wiring.

Test cleanup:
- log_test.go: drop TestWithLogExporter and TestWithLogMinSeverity;
  rewrite TestInitLog_ForwardCompatible_ConsoleViaProcessor to stop
  passing WithLogConsole(false) (no longer needed since console is no
  longer implicit).
- logger_test.go, log_test.go, init_all_test.go: drop every
  WithLogConsole(false) suppression — those tests just need a
  no-output InitLog, which is now the default.

External callers (sdkx/telemetry/logfile) only reference InitLog via
docstrings using WithLogProcessor — no code change required.

Made-with: Cursor
The provider-integration test fixture parses a "caps" sub-object out of
its env-var JSON config to decide whether to skip scenarios that exercise
unsupported capabilities (e.g. no_temperature on a model that rejects it).
That sub-object used to be honoured by llm.NewFromConfig too — it no
longer is (see chore(llm): drop NewFromConfig "caps" key earlier in
this PR), so the example in the providerSpec godoc was on track to
mislead readers into thinking the SDK still consumes the field.

Append a note that "caps" here is purely a test-fixture convention,
parsed only by capsHas; real caps must flow through ProviderConfig.Caps
or ModelConfig.Caps via DefaultResolver.

Made-with: Cursor
The function was introduced as a v0.1.x bridge that moved a typed
[]model.Message out of vars["messages"] into channels[MainChannel]
when restoring a Board snapshot. Tracing both call sites shows it is
now dead code and the comment "remove after v2 migration window" can
finally be honoured:

In-process round-trip (Snapshot -> RestoreBoard / RestoreFrom on the
same process): no caller actually uses SetVar("messages", []Message)
to seed a snapshot any more — channel-based addressing has been the
canonical message location since the workflow refactor. The two
remaining SetVar("messages", ...) call sites in
sdk/graph/node/llm_test.go are pure GetVar("messages") read paths and
never go through Snapshot.

Cross-process round-trip (FileCheckpointStore JSON, the only real
persistent surface): json.Unmarshal decodes BoardSnapshot.Vars as
map[string]any, so a JSON array under "messages" comes back as []any,
never []model.Message. The .([]model.Message) type-assertion in
migrateVarsMessages therefore cannot match anything that came off
disk; the function was a no-op for the only path that could conceivably
need it.

The lingering responsibility — guaranteeing channels[MainChannel]
exists when snap.Channels is empty — is inlined into RestoreFrom
(RestoreBoard already had its own explicit branch). Add
TestBoard_RestoreFrom_NoChannels_InitializesMainChannel to mirror
the existing TestRestoreBoard_NoChannels_InitializesMainChannel and
pin the invariant directly on the public surface.

Drop migrateVarsMessages itself and its three pin tests
(TestMigrateVarsMessages_*); they only exercised the now-deleted
helper and constructed Boards via internal-field literals to bypass
the real persistence path.

Made-with: Cursor
WithTaskBoard / TaskBoardFrom / ctxKeyTaskBoard had zero non-test callers
in this monorepo and duplicated the functionality of the live WithKanban /
KanbanFrom pair (which production code does use to plumb a Kanban handle
through context). Carrying both a Kanban-level and a Board-level context
key invites confusion ("which one do I inject?") with no callers to
justify the complexity, so drop the Board-level pair outright as part of
the v0.2.0 surface cleanup.

This is not formally Deprecated-tagged, but qualifies as the same class
of removal: arity-1 unused helpers whose only users were their own unit
tests.

Made-with: Cursor
Aligns the persistence-restore entrypoint with the canonical NewBoard
constructor (the "TaskBoard" alias was already removed in the previous
kanban cleanup commit, leaving RestoreTaskBoard as the only surviving
"TaskBoard"-named symbol). All callers and test names are updated in
lockstep; no shim is left behind because there are zero external
consumers in this monorepo.

This is a v0.2.0 breaking change for any out-of-tree caller persisting
KanbanCardModel rows.

Made-with: Cursor
@lIang70
lIang70 merged commit 27a771f into main Apr 23, 2026
7 checks passed
@lIang70
lIang70 deleted the chore/drop-v0.2-deprecated branch April 23, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant