Skip to content

Instantly share code, notes, and snippets.

@arturohernandez10
arturohernandez10 / StubbingGuide.md
Created December 4, 2025 18:27
Functional-Relational Pseudocode Guide
purpose canonical version type
Define a concise pseudocode style for stubbing complex orchestration logic
true
1
concept

Functional-Relational Pseudocode Guide

A concise style for writing algorithm stubs that emphasize data transformations over control flow, using indentation for scope and set operations over loops.

@arturohernandez10
arturohernandez10 / AgentControl.md
Last active October 9, 2025 01:52
Agent Control

Control facets


Facet 1 — Control Flow Pattern

Describes how the agent executes and revises actions at runtime.

  • Single-Pass — Plan once, execute without revision. Example: “Draft the email in one shot and send.”
@arturohernandez10
arturohernandez10 / AgentsAsInfo.md
Last active October 8, 2025 23:47
Agents as Information

Agents as Information

From an information perspective, we can define agents as follows:

  1. General Agent — An information-processing system that maintains an internal model of the world and updates it through perception and reasoning to decide actions. It transforms information about the world into behavior.

  2. Specialized Agent — A version of the general agent focused on a specific domain or task, using limited world knowledge and task-specific information to act effectively within that scope.

In essence:

@arturohernandez10
arturohernandez10 / versioncontrol.md
Last active September 19, 2025 15:47
Trunk based version control

Trunk based version control

Branching process

Our goal is to establish a predictable flow for feature development and release management.

1. Branching

Work on a feature should branch off either a stable release branch or a release candidate (RC) branch. This ensures that development starts from a trusted, validated state of the code. If we are able to have a continuous integration pipeline, which include unit tests, integration tests, and functional tests, then we can branch off from the main branch.

@arturohernandez10
arturohernandez10 / alloy.lark
Last active August 12, 2025 23:50
Lark grammar for alloy
// ================================================
// Alloy core (minimal but practical) - Lark v3
// Parser: LALR (recommended) -or- Earley
// Lexer: contextual (recommended)
// Notes:
// - Unique terminal definitions (no duplicates).
// - _NL imported & ignored for IDEs.
// - Adds SUM token for quantifier & unary aggregator.
// - Adds unary + / - support.
// ================================================
@arturohernandez10
arturohernandez10 / rates-query-oracle.ts
Last active August 6, 2025 15:14
Rates query property test
import { BIDealType } from "@realsynch/realsynch-shared";
import { ConversionFilters } from "./types";
/**
* Represents a tuple of from and to stages with their respective counts.
* @property from - The starting stage of the conversion.
* @property to - The ending stage of the conversion.
* @property fromTotal - The total number of records that transitioned from the 'from' stage.
* @property toTotal - The total number of records that transitioned to the 'to' stage.
@arturohernandez10
arturohernandez10 / Microbundle-Library.md
Created June 20, 2025 17:07
Building & Publishing a TypeScript Library with **Microbundle** (2025)

Lightweight Guide: Building & Publishing a TypeScript Library with Microbundle (2025)

Scope & audience – This walkthrough is aimed at advanced beginners: you’ve built a couple of Node projects and want a no‑fuss way to turn your reusable code into a shareable package.

Why Microbundle? One dev‑dependency gives you:

  • automatic ESM + CJS + UMD bundles
  • zero‑config TypeScript support
  • minification via Terser
  • a single microbundle CLI for build & watch (github.com)

Data processing improvements & problems

Rationale, currently the system once it has all data from the external system, does all updates in a single call. If anything fails, we would execute the entire call again. If another relevant transaction happens in the interim time, we don't have a way to handle it. The large task record created, with spurious properties, makes it difficult to trace and debug.

  • All reads and updates are done in a single call.
  • The large transaction code, is partially idempotent, but not fully.
  • We don't have a way to handle out of order events.
  • We don't have a way to retry errors.
  • Traceability is not good.
  • There is no queue monitoring.
@arturohernandez10
arturohernandez10 / monitorUsage.md
Created October 5, 2023 21:23
`monitorUsage` Function Documentation

monitorUsage Function Documentation

Overview

The monitorUsage function is designed to inspect and report on the memory usage of specific objects in a Node.js application, particularly those marked with a unique identifier. This tool aims to provide developers with an insight into memory allocation and retention tied to marked cache objects, which can be invaluable for diagnosing potential memory leaks or for optimizing memory usage.

Rationale

In large-scale applications, memory optimization is crucial for performance and scalability. However, determining which objects consume significant memory can be challenging. By marking crucial objects (like cache objects) and using tools like node-heapdump-analyzer, specific insights into these objects' memory footprint can be gained. This function serves as a utility to extract and summarize this information.

I am working on an inline formatting tool for the editorjs opensource component. The objective is to mark portions of text as input or output. The challenge in making such a tool is that we need to deal with the nested nature of html. For our objective it is clear that text cannot be input and output nor we can have output inside input.

We already have a base control that works, but it does not handle nesting properly. We need to come up with a process that can be implemented with the surround(range: Range) API call. And we need to describe the different cases that we need to support, considering the user experience. For example, the user right clicks and sees the tool menu with the specific tool highlighted or not. Then the user presses the button. At that point it is up to the code to decide what the behavior's should be.

Taking all of this in mind lets start with the use cases, followed by any useful API that is available and is relevant to out task. Then we can describe logically but as concise as pos