Skip to content

Instantly share code, notes, and snippets.

View emberian's full-sized avatar

emberian

View GitHub Profile

Automatafl Backend Specification

1. Overview

This document specifies the business logic for the Automatafl game platform backend. It follows a Command Query Responsibility Segregation (CQRS) and Event Sourcing architecture.

  • Commands: Represent an intent to change the system's state. They are handled by Aggregates.
  • Events: Represent an immutable fact that has occurred in the system. They are the single source of truth for all state.
  • Aggregates: Encapsulate the business logic and state for a domain entity (e.g., a Game or Player). They process Commands and produce Events.
  • Processes & Sagas: Coordinate complex workflows by listening to Events and issuing new Commands.
here’s the shape of what happened—not the code, the people.
# the narrative arc (beats)
1. **spin-up & static**
two collaborators try to “see” the same thing (repo, live share, preview). tech is the set, but the plot is *synchronizing attention*. you both keep reaching for co-presence (follow cursor, shared ports, screenshare), and the tools half-deliver. this makes small frictions feel bigger.
2. **naming the fog**
you oscillate between excitement (“this is powerful”) and dread (“80k tokens… is this real/unique?”). the other party mirrors it: curiosity + uncertainty. you both *externalize thinking* by writing into README, prompts, specs—trying to pin the butterfly to the page.

2. Core Models & Enums

Core Identifiers

type Uuid = universally unique identifier
type Pid = u8      // Player ID within a single game context (e.g., 0, 1)
type Timestamp = u64 // Unix epoch seconds

Excellent. This is a superb prompt. You have a solid, well-reasoned algebraic theory. My task is to refine it into a canonical specification, tightening the definitions, ensuring completeness (especially for the CQRS aspect, which is implied but not fully specified), and then using that specification to derive a high-level language kernel and syntax that would make programming in this paradigm a natural extension of the theory.

The result will be a two-part document:

  1. The Core Algebraic Theory: A formal specification of the sorts, operations, and axioms for both the command and query/projection sides of the system.
  2. The Axiom Language Kernel: A high-level language design and syntax that provides first-class constructs for the concepts defined in the theory, making the boilerplate minimal and the business logic central.

Part 1: A Refined Algebraic Theory of EventCore

Adaptive Training for Flexible Skill Acquisition: Building Navigable Mental Models of Graph-Structured Tasks

1. Introduction

Many cognitive tasks, from navigating complex software to learning a city's public transport system, involve internalizing structured knowledge. While seemingly straightforward, mastering these domains often requires more than rote memorization of a single sequence of steps. For instance, a software user might learn a specific menu path to access a common feature (e.g., File -> Save As -> Cloud Storage). This linear, procedural knowledge works well when the environment is static and the goal always accessed in the same way. However, if the menu structure changes, a shortcut is introduced, or the user needs to achieve the goal from a different starting point (e.g., saving from a context menu), this rigid, "one-way street" knowledge breaks down. Users struggle, resort to trial-and-error, or inefficiently retrace familiar paths, even if a shorter, direct route exists. This h

Okay, let's get our hands dirty and prototype a proc-macro for the Refined Syntax Idea 4! This will be a non-trivial proc-macro, but breaking it down into steps will make it manageable. We'll focus on the core parsing and code generation, without implementing all the features initially (like full expression parsing within the handlers). We'll build up the functionality iteratively.

Project Setup (Proc-Macro Crate)

First, create a new proc-macro crate within your muchin project. This is crucial because proc-macros must be in a separate crate. Assuming your main muchin crate is in a directory called muchin, do the following:

cd muchin
cargo new muchin_macros --lib
@emberian
emberian / devnetstopslot.md
Created April 3, 2024 22:30 — forked from amc-ie/devnetstopslot.md
Mina Devnet 1.5.0 Stop Slot Release

❗ This release is only to be used as part of the Devnet Upgrade ❗


This release is the first phase of the Devnet upgrade that specifies the stop slot in the codebase that formally begins the process. This isthe first stage in a two stage process; the next devnet release will usher in the start of the new Devnet and as such the new era of Berkeley functionality on our Devnet!


Supported environments include macOS, Linux (Debian 10, 11 and Ubuntu 20.04 LTS), and any host machine with Docker.

@emberian
emberian / migrationrelease.md
Last active April 2, 2024 00:42
Mina 3.0.0 Migration Tooling Release Notes Draft

The O(1) Labs team is excited to announce the release of the tools required to migrate Devnet archive database! The release will enable archive node operators on Devnet to incrementally migrate their database before the Berkeley Upgrade on Devnet.

The new tools included are:

  1. mina-archive-maintenance: A tool to verify that the devnet archive database is correct and up-to-date. If the database is missing blocks, then the tool patches using blocks exported as json files by mina daemon. Users can also find these blocks in gs://mina_network_block_data location. Please refer here for documentation on this tool.

  2. mina-berkeley-migration-script: This script uses multiple tools to migrate devnet database and verify the migrated database. For documentation on how to use the tooling, either the toplevel simplified script or understanding the individual components, please refer to the [draft documentation]

@emberian
emberian / migrationrelease.md
Last active March 29, 2024 22:53 — forked from amc-ie/preupgraderelease.md
Migration Tooling Release

April Fool's! These release notes are from ChatGPT.

You might want to read the real deal.

🚀💥 O(1) Labs Team is ALL FIRED UP to Drop the LATEST Devnet Archive Migration Tools! 💥🚀

🎉 BIG NEWS, Friends! 🎉 We're thrilled to bits to unveil the shiny new gadgets you'll need for a smooth sail through the Devnet Archive Database Migration! Get ready to kick things up a notch before the Berkeley Upgrade hits Devnet. 🚀

What's Cooking? 🔥

{"timestamp":"2024-03-22 02:10:42.349677Z","level":"Info","source":{"module":"Dune__exe__Precomputed_block","location":"File \"src/app/berkeley_migration/precomputed_block.ml\", line 238, characters 10-21"},"message":"Finished downloading precomputed blocks","metadata":{}}
{"timestamp":"2024-03-22 02:56:07.268961Z","level":"Info","source":{"module":"Dune__exe__Berkeley_migration","location":"File \"src/app/berkeley_migration/berkeley_migration.ml\", line 490, characters 6-17"},"message":"Migrating mainnet blocks","metadata":{}}
{"timestamp":"2024-03-22 02:56:07.277535Z","level":"Info","source":{"module":"Dune__exe__Berkeley_migration","location