Releases: skeswa/cog
Releases · skeswa/cog
Release list
Cog 0.8.1
Cog 0.8.0
0.8.0 (2026-09-09)
⚠ BREAKING CHANGES
- swift:
MechanismController.wheneveris removed in all three overloads, with no deprecated alias, forwarding wrapper, or renamed availability stub. Migratem.whenever(gate, ...) { s in ... }tom.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
Cog 0.7.0
0.6.1
Cog 0.6.0
0.6.0 (2026-08-29)
⚠ BREAKING CHANGES
- swift:
Cog<Value>.Manualand the key-ignoringCogBox<Value, Key>.Manualinitializers take a@MainActorclosure instead of a value.Cog<Int>.Manual(0)becomesCog<Int>.Manual { 0 }. No deprecated overload is provided. Asyncdefault: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
0.5.0
0.5.0 (2026-08-23)
⚠ BREAKING CHANGES
- swift:
Cogs.bootstrapApp(mechanisms:)is nowCogs.assemble(mechanisms:), andwithBootstrappedApp,isBootstrappedApp, andhasBootstrappedAppare nowwithAssembledCogs,isAssembledCogs, andhasAssembledCogs. - 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
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
coglintCLI 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 outsideCogOps, initial state outside
mechanisms, writable source visibility, and multi-read graph helpers. CogLintBuildToolPluginfor build-time checks and
CogLintCommandPluginforswift 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-pluginsrepository. 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
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
.latestdeclarations and
Work.runselectors retain their 0.1.0 spellings and semantics.
Added
- Ordered one-shot async policies.
.queueruns every selected request in
FIFO order,.exhaustLatestfinishes current work and catches up once with
the newest selection, and.mergedoverlaps runs and publishes in landing
order. TheLatestPolicyandOrderedPolicytype split makes stream work
latest-only at compile time. Work.stream, which turns each changed element of a selected
AsyncSequenceinto 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
AsyncSequencefor manual, derived, and async values. Each iterator owns an
independent graph lease and buffer with.newest(1),.oldest(n), and
.unboundedpolicies.Reader.track, in key-path and closure forms, for making properties of an
external@Observablemodel ordinary selector dependencies. It uses
continuousObservationson 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
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 orfileID:line
labels.- One app-wide runtime:
Cogs.bootstrapApp(mechanisms:), the\.cogs
SwiftUI environment, tracked UI reads, and one-shotpeek. A second
production bootstrap traps in every build. - Turns:
commitin a compact single-value form and aWriterform, 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. MechanismandMechanismController: bootstrap-only registration of
reactions, watches, tasks, and state-gatedwheneverscopes, with
duplicate-name rejection and write-back that queues a new turn.- Declared lifetime:
.appfor sources,whileObservedwith a grace period
for derived and async state, and an opt-inManualCogLifetimefor ephemeral
sources. - Async state:
AsyncCog,AsyncCogBox, total value reads over a declared
default, thestatuslens,CogStatus,Work,.latest, and
exact-generationrefreshreturningCogRefresh. - 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-onlyseed, the
synchronouswithBootstrappedAppfixture, 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/Weatherexample app.