head
Categories:
-
Merge pull request #177 from alwaldend/t3code/anki-application-boundaries
Enforce Anki application and package boundaries
-
Merge pull request #175 from alwaldend/t3code/anki-linked-server
Link the Anki server into the CLI executable
-
Merge pull request #174 from alwaldend/t3code/anki-grpc-backend
Add explicit Anki backend access and complete Go schemas
-
Merge pull request #128 from alwaldend/t3code/anki-collection-as-code
Reconcile Anki collections with executable native plans
-
Merge pull request #169 from alwaldend/t3code/anki-archive-build
Rebuild collection archives independently of reconciliation
-
Merge pull request #168 from alwaldend/t3code/anki-planning
Extract pure executable Anki collection planning
-
Merge pull request #167 from alwaldend/t3code/remove-anki-backend-managers
Remove backend managers from the native collection workflow
-
Merge pull request #165 from alwaldend/t3code/anki-collection-store
Coordinate collection reservations and archive publication
-
Merge pull request #166 from alwaldend/t3code/anki-backend-managers
Add scoped managers for Anki backend lifetimes
-
Merge pull request #160 from alwaldend/t3code/anki-text-export
Add prepared-connection Anki collection export
-
Merge pull request #161 from alwaldend/t3code/anki-resource-store
Extract shared Anki resource clients and snapshots
-
Merge pull request #156 from alwaldend/t3code/anki-collection-export-import
Add explicit Anki collection state management
-
Merge pull request #157 from alwaldend/t3code/anki-collection-backend
Add a collection backend for prepared Anki servers
-
Merge pull request #146 from alwaldend/t3code/anki-cargo-go-api
Add generated Anki service clients and a managed Go backend
-
Merge pull request #147 from alwaldend/t3code/extract-anki-grpc-project
Add the Anki gRPC server with configurable transports
-
Migrate Python dependencies to native uv locks and update Python
Use component-owned pyproject.toml and uv.lock files directly with rules_python and Gazelle. Remove maintained requirements files, optional lock comparison tests, custom wrappers and the obsolete firmware pip shim. Update rules_python and its Gazelle plugin to 2.4.2, and select bundled Python 3.14.4 without a custom runtime archive. Pin Bazel-managed uv 0.13.0. Preserve compatible package versions and update PySide6 for Python 3.14. Migrate the existing K3s role’s Python installer and Autoscroll install hint. Correct Autoscroll import-root wiring and zero-argument help formatting.
Validation: native lock output inspection, consumer E2E and build tests, Python tool CLIs, offscreen Qt SVG construction, repository quality, semantic lint and a disposable Ansible dependency-installation fixture with zero changes on its second run. No infrastructure was deployed.
OpenSpec-Change: infra/src/openspec/changes/migrate-python-dependencies-to-uv
LLM-disclaimer: This commit was generated by an LLM.
-
Add the Anki gRPC server with configurable transports
Build Anki 26.09.3 from its unmodified, pinned Cargo workspace and submodules in third_party. Use standard crate_universe dependency helpers and rules_rust targets; remove the provider-reflection helper and metadata-only wrapper manifest. Reuse the repository OpenSSL build for workspace-enabled native TLS and lock the approved package set.
Serve official Anki protobuf commands over CLI-selected stdio, TCP, or Unix sockets. Initialize one backend at startup without a custom RPC. Include CLI help, release metadata, a registered landing page, and the finished project status.
Verify native/server builds, TCP and Unix persistence/reconnection, Go stdio compatibility, Clippy, schemas, site, quality, and semantic lint. Inspect emitted SQLite collections and the native dependency boundary. The Go API and approach diagram remain in PR #146; both PRs target master, and shared files leave #146 after this merges.
OpenSpec-Change: infra/src/openspec/changes/extract-anki-grpc-project
LLM-disclaimer: This commit was generated by an LLM.
-
Document Anki configuration APIs with Mermaid diagrams
Show the existing Load, Dump, and Export Go operations in a process chart and the configuration model in a class diagram with path references and filesystem locations. Add the corresponding README explanation and remove stale merge instructions for the already-merged configuration API.
Render light/dark SVGs for the site and dark WebP previews through maintained Bazel targets. Preserve configuration behavior, collection placeholders, and the main reconciliation PR’s architecture documentation.
This documentation is extracted from #128 and targets master independently. The source diagrams match its published versions; unpublished preview edits remain local. Verify renders, config CLI E2E, site output, quality, and lint.
OpenSpec-Change: projects/anki_as_code/openspec/changes/extract-configuration-documentation
LLM-disclaimer: This commit was generated by an LLM.
-
Add a collection backend for prepared Anki servers
Add BackendCollection and its options object to the reusable Go backend. It implements Backend while borrowing an already-started server: Start opens the collection, Connection lends gated generated-client access, and Stop closes the collection without stopping the borrowed backend. Keep the public methods limited to Backend; restore destinations belong in options.
Open .anki2 databases directly. Restore .colpkg inputs through Anki into an owned temporary directory by default, or an empty persistent destination selected with RestoreDirectory. Observe consuming package exports and retain files when cancelled native work makes cleanup uncertain. Callers stop the collection before the process and clean retained temporary files after reaping.
Serialize startup with shutdown and reject preparation after a completed Stop. Leave failed-start cleanup to explicit Stop instead of a hidden shutdown timeout. Keep the connection adapter limited to Anki unary calls, tracking completed export failures as consumed collections so their temporary files can be removed. Track every unary caller and retain sticky uncertainty after unconfirmed responses. Stop drains active callers within its context while ordinary operations remain concurrent. Native E2E covers active and cancelled media requests, concurrent progress access and cleanup after backend reaping. Native E2E verifies overlapping lifecycle calls, storage/media persistence, restore ownership, backend reuse, readiness, consuming exports and failures. The anki_as_code integration is maintained separately in PRs #128 and #156; its native, CLI and configuration E2E are verified against this library.
OpenSpec-Change: projects/anki_grpc/openspec/changes/collection-backend
LLM-disclaimer: This commit was generated by an LLM.
-
Manage OpenSpec CLI installation on Host Bot
Install the pinned npm CLI under the managed user prefix and share Node.js prerequisites with the existing npm tooling. Document the managed installation.
OpenSpec-Change: users/simeonwarren/host_bot/openspec/changes/manage-openspec-cli
LLM-disclaimer: This commit was generated by an LLM.
-
Extract shared Anki resource clients and snapshots
Centralize native resource access in internal/resource.Store. Construct Anki’s generated clients once on a caller-owned prepared connection, and read fresh upstream deck, note-type, note and card messages plus existing preset names. Preserve unmanaged resources and filtered-card references; return no partial snapshot after errors and retain caller ownership of lifetime and returned data.
Include the selected deck ID when preset reads fail while preserving the native error cause. Expose the generated clients for resource operations without forwarding every method or creating generic CRUD models. Keep state bindings, config projection, planning, mutation order, files and backend lifecycle outside this package.
Document the API and verify native operations, ordering, fresh reads, detached values, cancellation and borrowed lifetime with JSON/native package artifacts. Consumer integration belongs to PR #128 and PR #160; both stay master-based.
OpenSpec-Change: projects/anki_as_code/openspec/changes/extract-native-resource-store
LLM-disclaimer: This commit was generated by an LLM.
-
Integrate state commands with the native collection workflow
State commands now accept existing .anki2 databases and .colpkg archives through –collection. Compose the managed process and collection backends per operation, preserving direct database writes and using Anki native export for changed archives. App.WithCollection owns the scoped operation and cleanup; callers construct namespaced state stores directly from its prepared connection. Close the collection before the worker with bounded cleanup.
Extract the lifecycle and state CLI integration from #128 as an independent master-based prerequisite. Collection export, plan, apply and build remain placeholders; backend, state, config, codec and resource implementations are unchanged. #128 retains the overlap until this prerequisite merges.
Verify database and package state operations, batched imports, namespace isolation, no-op archives, cancellation, cleanup and preservation of native notes, reviewed cards, history, presets and media with the existing E2E coverage. Include the state flow diagram and current lifecycle documentation.
OpenSpec-Change: projects/anki_as_code/openspec/changes/extract-collection-workflow
LLM-disclaimer: This commit was generated by an LLM.
-
Add scoped managers for Anki backend lifetimes
Callers borrow prepared native backends through Manager.WithBackend or ManagerCollection.WithCollection while managers own startup and ordered cleanup. Share their lifecycle sequence through private withBackend, with cancellation-independent cleanup and each manager’s existing shutdown timeout. Keep constructors, backend names and the public manager API unchanged. Preserve callback errors and custom cancellation causes, and reap workers on scope exit.
Keep source reservations, idle-worker caching, archive publication policy and Anki-as-code services outside this independent library change. Native E2E verifies readiness, process reaping, failure/cancellation/panic cleanup, combined errors, delegated cleanup order, persistence and package restoration. Validate repository quality, semantic lint, native consumers and documentation.
OpenSpec-Change: projects/anki_grpc/openspec/changes/scoped-backend-managers
LLM-disclaimer: This commit was generated by an LLM.
-
Integrate collection export with an isolated CLI
Expose collection export through the native workflow and existing exporter/config store while preserving source resources, state and archive bytes. Add config export for JSON-default or TOML config sets supplied through files or stdin. Keep plan, apply and build as placeholders; reconciliation remains in #128.
Keep concrete App in pkg/ankiascode and Cobra commands in internal/cli behind a private flat application interface. cmd/anki_as_code composes App and cli.New and handles signals. Group native commands under col with alias collection and text-only commands under config with alias conf; pass paths, namespace keys, protobuf objects and contexts explicitly.
Reuse the merged collection.Store for source reservations and archive publication. Its callbacks receive prepared grpc.ClientConnInterface; application workflows construct resource/state stores and exporters locally. Backend managers own native lifetime. Keep this PR against master; the collection-store and empty-media prerequisites are merged.
Verify isolated dispatch, flags, syntax, codecs, stream/error handling and native database/package export and state workflows. Emit native collections and TOML/JSON artifacts; validate repository quality, semantic lint, CLI builds and integrated documentation.
OpenSpec-Change: projects/anki_as_code/openspec/changes/integrate-collection-export-cli
LLM-disclaimer: This commit was generated by an LLM.
-
Remove backend managers from the native collection workflow
The collection store is the sole production manager consumer and already chooses a fresh stdin/stdout worker per source scope. Remove Manager, ManagerSTD, ManagerCollection and their constructors. Keep BackendSTD and BackendCollection with their explicit Start, Connection and Stop contracts.
Have collection.Store construct both owners directly, lend the prepared connection and close the collection before reaping the worker. Keep bounded cleanup in one private application helper, preserve callback/cancellation/crash errors and panic unwinding, and retain source reservations through cleanup. Existing archive publication and native restore-retention behavior remain unchanged.
Replace manager spies with real worker subprocess observations in the existing native store E2E. Verify process reaping, retained connection rejection, failed-start recovery, source reuse and callback success/error/cancellation/panic/crash paths. Retain direct backend, collection and application E2E, emit native collection artifacts, and validate quality, semantic lint, CLI and documentation builds without new dependencies.
The paired library API change is recorded in projects/anki_grpc/openspec/changes/remove-backend-managers.
OpenSpec-Change: projects/anki_as_code/openspec/changes/own-backend-lifecycle
LLM-disclaimer: This commit was generated by an LLM.
-
Extract pure executable Anki collection planning
Separate planning from native execution so callers can prepare an executable CollectionPlan from supplied configs, a native snapshot and stored state without I/O or input mutation. internal/plan exposes one pure Build function; native execution and App integration remain in #128, independently targeting master.
Index captured Anki protobufs directly and resolve desired configs once into existing prepared protobufs. Share path/ID indexes across ownership checks and comparison. Produce typed operations and report entries together, with expected_state, proposed_bindings and path references for new objects instead of fabricated native IDs. Keep implementation indexes and resource moves private to planning.
Retain stable native member identities or original stored names, explicit move provenance and collision-free name releases. Protect untracked resources, template deck targets and resident filtered cards, including the cloze template-zero mapping. Permit tracked deck and note-type replacement without claiming untracked names. Anki owns native validation, normalization and generated-card migrations.
Native E2E captures exported TOML and snapshots before stopping its backend, then verifies deterministic detached plans, unchanged inputs/database, independent returned payloads, member drift, moves, empty namespace convergence and ownership protection. Extend the ownership fixture before refactoring; all seven baseline public reports remain unchanged. Emit executable JSON and native collection artifacts, document orchestration with Mermaid, and validate quality, semantic lint, consumers and integrated documentation.
Use folded-name order to prepare parents before mixed-case descendants. Keep preset aliases in the owned protobuf state and move disjoint bindings directly using existing resource maps, without duplicated ID, occupancy or replacement maps. Cover directory moves, occupied destinations, preset payload ownership and native deck replacement.
Keep desired decks in a single path index and sort emitted operations directly. Derive filtered-deck exclusions only for card assignments, reuse Resources for moved bindings and the pinned typed protobuf clone API, and use bounded member-ordinal slices. Verify declaration-order independence and resulting filtered kinds before implementation; preserve reports, ownership and executable-plan contracts.
OpenSpec-Change: projects/anki_as_code/openspec/changes/extract-pure-planning
LLM-disclaimer: This commit was generated by an LLM.
-
Rebuild collection archives independently of reconciliation
Add internal/rebuild.Builder with an injected apply operation. It copies a regular collection package into private staging beside the destination, rejects source aliases, and publishes only after successful native work. Failure and cancellation preserve the base and existing output, including both context cancellation and its custom cause for errors.Is.
Native E2E coverage updates actual Anki state and verifies changed/no-op packages, failed publication, cancellation, panic cleanup and invalid paths. It emits collection archives and JSON state. No dependencies are added.
This is the independent build prerequisite for #128; application and CLI integration remain there.
OpenSpec-Change: projects/anki_as_code/openspec/changes/extract-archive-builder
LLM-disclaimer: This commit was generated by an LLM.
-
Order Anki lessons and Guzhenren notes by source creation IDs
Use each grammar lesson’s earliest note creation ID for its padded prefix, with deck IDs only for the four empty lessons. Preserve the chronological sequence within lessons and number Guzhenren vocabulary files within their existing passage groups; retain all 133 sentences in chapter reading order.
Update explicit moves while preserving every note, deck, type and exported state payload. Verify the native rebuild, source identities, content, media, due dates and review history, plus an empty post-build plan.
OpenSpec-Change: users/simeonwarren/anki/openspec/changes/refresh-collection-20261017
LLM-disclaimer: This commit was generated by an LLM.
-
Add explicit Anki backend access and complete Go schemas
Add a gRPC backend for explicit TCP/Unix endpoints and opt-in collection archive write-back. Keep WriteBack false by default, publish enabled archives independently of earlier RPC failures, and retain recoverable files when publication fails. Keep native executable configuration explicit and strip symbols from optimized workers.
Expose all 25 pinned Anki Go schema packages through one third-party catalog and standard protobuf generation. Preserve upstream versions and approved dependencies. Verify native backend persistence, remote ownership, transport behavior and existing application consumers.
This is the backend/schema prerequisite for https://github.com/alwaldend/src/pull/173. Both PRs target master; the CLI PR will be trimmed after this merges. Application command registration and its generator remain with anki_as_code. Preserve the current worker runtime build input until the CLI embedding change replaces it, so existing master application consumers remain functional.
OpenSpec-Change: projects/anki_grpc/openspec/changes/add-explicit-backend-access OpenSpec-Change: infra/src/openspec/changes/complete-anki-go-protos
LLM-disclaimer: This commit was generated by an LLM.
-
Link the Anki server into the CLI executable
Collection commands launch the current executable with server serve, so an installed anki_as_code needs no companion executable, extraction or PATH discovery. Keep process isolation and the existing bounded backend shutdown behavior.
Share the Rust transport, command dispatch and descriptor generator between the standalone command and one argc/argv C ABI entry point linked through cgo using existing Bazel rules. Require explicit worker configuration for Go application collection operations, remove production discovery and the implicit standalone worker runtime input, and configure the product worker with its own executable. Name the Go host package ankiserver and its client-side lifecycle package ankiclient. Keep server run as a generic native CLI passthrough and make server serve delegate to server run serve. Rust owns serve dispatch, help, transport arguments and validation.
Target master independently of API CLI PR #173. Verify installed native operations with an empty PATH and unavailable temporary storage, missing worker configuration, explicit library workflows, TCP/Unix interruption, and native collection persistence. Test fixtures declare their executable inputs.
OpenSpec-Change: projects/anki_grpc/openspec/changes/expose-linked-server OpenSpec-Change: projects/anki_as_code/openspec/changes/run-linked-server OpenSpec-Change: infra/src/openspec/changes/complete-anki-go-protos
LLM-disclaimer: This commit was generated by an LLM.
-
Expose Anki services through the CLI
Generate service and method commands from all 25 compiled Anki schemas, with protobuf JSON/TOML input and output and no per-method wrappers. Route execution and validation through one shared App operation supporting managed offline paths, borrowed connections and explicit TCP/Unix servers.
Use the linked server through the same executable. Preserve caller-owned resources and make managed archive write-back explicit, enabled by the CLI and existing application workflows independently of request outcomes. Bound incomplete input by cancellation and timeout, and preserve linked Unix server lifetime across client disconnections.
Verify installed execution, payloads, persistence, native connection ownership and package boundaries through end-to-end workflows.
OpenSpec-Change: projects/anki_as_code/openspec/changes/add-grpc-api-cli
LLM-disclaimer: This commit was generated by an LLM.