Skip to content

Releases: skeswa/cog

Cog 0.8.1

Choose a tag to compare

@github-actions github-actions released this 09 Sep 05:57

0.8.1 (2026-09-09)

Bug Fixes

  • ci: run release dispatch jobs after skipped dependencies (d54d7a2)
  • docs: apply homepage dark theme on initial load (7db7315)

Cog 0.8.0

Choose a tag to compare

@github-actions github-actions released this 09 Sep 04:02

0.8.0 (2026-09-09)

⚠ BREAKING CHANGES

  • swift: MechanismController.whenever is removed in all three overloads, with no deprecated alias, forwarding wrapper, or renamed availability stub. Migrate m.whenever(gate, ...) { s in ... } to m.scope(gate, ...) { s in ... }; parameters and closure shape are unchanged. Renaming alone does not make a gated scope session-aware — a call site that needs replacement must select an optional identity and accept it in its body.

Features

  • swift: discard state whose domain lifetime has ended (13bba74)
  • swift: reconcile one mechanism scope per identity in a collection (8309324)
  • swift: replace whenever with an identity-owned scope (8309324)
  • swift: revoke a retired mechanism scope's graph access (8309324)

Cog 0.7.0

Choose a tag to compare

@github-actions github-actions released this 04 Sep 17:04

0.7.0 (2026-09-04)

Features

  • swift: name the state file unit a rig and rename files to <Rig>Rig+<Aspect>.swift (a14135e)

Bug Fixes

  • ci: publish the docs site when DocC is cached (6d5a579)
  • docs: keep the display serif from reflowing the hero (59f7098)

0.6.1

Choose a tag to compare

@github-actions github-actions released this 31 Aug 13:27

0.6.1 (2026-08-31)

Bug Fixes

  • docs: keep both libraries reachable from the shared pages (9e933e2)

Cog 0.6.0

Choose a tag to compare

@github-actions github-actions released this 29 Aug 19:08

0.6.0 (2026-08-29)

⚠ BREAKING CHANGES

  • swift: Cog<Value>.Manual and the key-ignoring CogBox<Value, Key>.Manual initializers take a @MainActor closure instead of a value. Cog<Int>.Manual(0) becomes Cog<Int>.Manual { 0 }. No deprecated overload is provided. Async default: call sites are unchanged.

Features

  • examples: add native TodoMVC app (e64d82e)
  • examples: add Trails navigation example (54a8cda)
  • lint: add manual-cog-underscore rule (b208dad)
  • lint: add tracked-binding-adapters rule (a9f2bff)
  • swift: count created generations on ControlledStream (22ae340)
  • swift: produce cog starting values and async defaults per state (edd1136)
  • swift: ship the async test harness in CogTesting (7edd607)

Bug Fixes

  • swift: prove the probed controller without debug-only seeding (1b64c4e)

Performance Improvements

  • swift: borrow descriptor records through the arena walks (12651b2)
  • swift: cut steady-turn ARC in the turn machinery (5cca865)
  • swift: cut the boundary-sort and turn-name ARC sites (71ed12f)

0.5.0

Choose a tag to compare

@github-actions github-actions released this 23 Aug 06:29

0.5.0 (2026-08-23)

⚠ BREAKING CHANGES

  • swift: Cogs.bootstrapApp(mechanisms:) is now Cogs.assemble(mechanisms:), and withBootstrappedApp, isBootstrappedApp, and hasBootstrappedApp are now withAssembledCogs, isAssembledCogs, and hasAssembledCogs.
  • swift: ManualCog, AsyncCog, ManualCogBox, AsyncCogBox, CogProjection, and CogBoxProjection are unavailable.
  • swift: Manual, async, and projection shape types now live under Cog and CogBox.
  • Rename the graph mutation primitive from commit to turn; the old spellings are removed.
  • Use automatic for non-manual cogs throughout Cog and CogTesting; the old derived spellings are removed.
  • Remove Cogs.valueReferenceLayoutName and the retired generic and interned layout selectors from CogTesting.

Features

  • remove the value-reference layout testing selector (38b30a8)
  • rename derived cogs to automatic cogs (38b30a8)
  • rename the graph mutation primitive to turn (38b30a8)
  • swift: add the CompactArena package trait (38b30a8)
  • swift: nest marked shapes in Cog families (b61c5ec)
  • swift: remove deprecated shape aliases (5ce6d70)
  • swift: rename bootstrapApp to assemble (3c13b47)

Bug Fixes

  • lint: recognize nested Cog shape families (6ff8ff1)

Performance Improvements

  • swift: make specialized arena the default (79211f9)

Continuous Integration

  • release: adopt Release Please and Conventional Commits (38b30a8)

Cog 0.4.0

Choose a tag to compare

@skeswa skeswa released this 18 Aug 09:05

Cog conventions are now executable. The first-party coglint binary ships
behind opt-in SwiftPM plugins while the Cog library itself continues to
resolve with no dependencies.

Breaking

  • No intentional source-breaking library change. Existing 0.3.0 declarations,
    async policies, streams, exports, and external Observation tracking retain
    their spellings and semantics.

Added

  • The syntax-only coglint CLI with deterministic recursive path discovery,
    exact source locations, explicit production and test target roles, Xcode,
    GitHub, and SARIF reporters, and reason-bearing next-line suppression. The
    opt-in build-tool plugin fails a build on findings; every diagnostic links
    to its rule article and its expected repair.
  • Six initial convention rules covering declaration suffixes, passing Cogs
    into views, primitive calls outside CogOps, initial state outside
    mechanisms, writable source visibility, and multi-read graph helpers.
  • CogLintBuildToolPlugin for build-time checks and
    CogLintCommandPlugin for swift package coglint, both backed by a
    checksummed macOS 14 artifact containing native arm64 and x86_64 binaries.
  • Permanent DocC articles generated from the same fixture corpus that tests
    every rule, plus a setup guide for the version-matched plugin package.

Changed

  • Lint distribution uses the separately versioned-but-coupled
    skeswa/coglint-plugins repository. Keeping its binary target outside Cog's
    root manifest prevents ordinary library consumers from eagerly downloading
    an unused lint artifact or resolving the linter's source dependencies.
  • Cog and Weather sources now dogfood the same linter command gated in CI.

CogLint artifact

SwiftPM checksum: 0dbcf7166769ed8e34b9f70597af6fc93b7df422e1ab713dcdce0cff56181877

The artifact contains native macOS 14 arm64 and x86_64 executables.

Cog 0.3.0

Choose a tag to compare

@skeswa skeswa released this 18 Aug 03:56

Async state can now schedule, stream, enter, and leave the Cog graph through
explicit typed boundaries. Version 0.2.0 was intentionally not published: its
only proposed payload was an arena-core replacement, and M6 measurements kept
the simple core as the shipping default.

Breaking

  • No intentional source-breaking change. Existing .latest declarations and
    Work.run selectors retain their 0.1.0 spellings and semantics.

Added

  • Ordered one-shot async policies. .queue runs every selected request in
    FIFO order, .exhaustLatest finishes current work and catches up once with
    the newest selection, and .merged overlaps runs and publishes in landing
    order. The LatestPolicy and OrderedPolicy type split makes stream work
    latest-only at compile time.
  • Work.stream, which turns each changed element of a selected
    AsyncSequence into its own Cog turn. Dependency replacement and state
    release cancel the iterator and reject late elements; natural completion
    preserves the last success, and a current failure retains the last value in
    CogStatus.
  • cogs.values(of:buffering:), a current-value-first multicast
    AsyncSequence for manual, derived, and async values. Each iterator owns an
    independent graph lease and buffer with .newest(1), .oldest(n), and
    .unbounded policies.
  • Reader.track, in key-path and closure forms, for making properties of an
    external @Observable model ordinary selector dependencies. It uses
    continuous Observations on 26-era runtimes and a documented one-shot
    re-arm shim on older deployment targets.
  • A separate pinned benchmark package covering allocations, propagation,
    boundary notices, value-reference layouts, edge layouts, pinned-key scaling,
    swift-state-graph, and raw Observation, with committed threshold files and a
    live allocation witness.
  • A Weather dashboard task that consumes Cog values asynchronously and follows
    the selected city without installing another state owner.

Changed

  • The simple class-state runtime remains the consumer default. The arena core
    and shared linked edge pool remain test- and benchmark-selectable research
    implementations after passing the same public behavior suite but missing
    M6's allocation, ARC, and pinned-key targets.
  • Keyed value references keep their public descriptor-and-key identity while
    the selected inline representation avoids a per-reference allocation.

Cog for Swift 0.1.0

Choose a tag to compare

@skeswa skeswa released this 17 Aug 18:20
a5a2d2c

The first usable release: declarations, one app-wide runtime, turns, the
SwiftUI boundary, mechanisms, declared lifetimes, and a first async slice.

Added

  • Cog, ManualCog, and their boxes: declarations that name state without
    creating it, with keyed value references from one declaration, .readOnly
    projections, per-declaration equality rules, and explicit or fileID:line
    labels.
  • One app-wide runtime: Cogs.bootstrapApp(mechanisms:), the \.cogs
    SwiftUI environment, tracked UI reads, and one-shot peek. A second
    production bootstrap traps in every build.
  • Turns: commit in a compact single-value form and a Writer form, with
    nested commits joining, sibling commits staying separate, and commits during
    a flush queueing in FIFO order.
  • Lazy pull with dirty flags, versions, and equality gates, so a read settles
    exactly what it needs and an equal write propagates nothing.
  • Cycle detection that names the whole descriptor-and-key path and fails fast.
  • A bound on cold first-read nesting. A first read of a never-computed chain
    nests, because a cog's dependencies are known only once its selector has run.
    Past 128 nested computations Cog fails with an error naming the innermost
    links, in debug and release alike, instead of exhausting the stack. Warm
    re-settlement is iterative and stays unbounded by graph depth.
  • Mechanism and MechanismController: bootstrap-only registration of
    reactions, watches, tasks, and state-gated whenever scopes, with
    duplicate-name rejection and write-back that queues a new turn.
  • Declared lifetime: .app for sources, whileObserved with a grace period
    for derived and async state, and an opt-in ManualCogLifetime for ephemeral
    sources.
  • Async state: AsyncCog, AsyncCogBox, total value reads over a declared
    default, the status lens, CogStatus, Work, .latest, and
    exact-generation refresh returning CogRefresh.
  • SwiftUI boundary: per-state Observation boundaries created on first UI read,
    notices emitted only when a value actually changes, and UI notices ordered
    before reactions within a turn.
  • CogTesting: isolated contexts, TestClock, debug-only seed, the
    synchronous withBootstrappedApp fixture, and narrow diagnostic seams.
  • Debug history: a bounded log of turns, writes, recomputations, notices, and
    effect runs, with zero cost in release builds.
  • DocC documentation and the swift/Examples/Weather example app.